Server1. Nginx VS Apache, which one is faster, and why? Nginx is definitely faster. The main reason is that it’s made to handle just HTML and static content, as well as the fact that it’s event-based. So less threads => less memory => higher efficiency. Noticeably, Apache 2.4+ versions also have event-based request handling. Since then the speed seems to match up with Nginx. Hence, the differences are not very noticeable. 2. Should we put code on a server and DB located on a different continent? Definitely not. The latency between the code base and the DB itself already costs too much load time. This will result in a very slow load-speed. Hence the abandon-rate will also skyrocket. It’s best to put them on the same Data Center. 3. Should we implement memory cache on a server that has 512MB RAM? No, we should not. 512MB is not enough to cache anything efficiently. The cache would end up eating all the RAM and leave no room for the actual web server and its modules to run. Or it would actually never get enough RAM to handle caching. In that case, we should just implement disk-caching. 4. How can we point a real domain to localhost for development? This is a developer-trick. Most CMS’s have fixed domains per code-base. Hence they would get redirected if another domain is pointed there. However, we can use the hosts file to overcome this and point the active domain to localhost for development. 5. Do you ever use version control? Which? Why? How often? Yes, Git or SVN or Mercurial Why: Because when developing, code changes rapidly. Amateurs may use Undo & Redo to recover lost work of short time, but that process is dangerous. A working version of the code may be lost. That’s why you should always use version control to keep track of changes. Anything that requires over 15 minutes of coding would require a commit. That way, we can roll back, reuse old code, and fix bugs with ease. 6. Which do you think is the more efficient web host between Windows and Linux? Linux is more efficient. Scenario: Handling 1,000 CCU With Linux, we can use 512MB RAM and run a Nginx server and disk cache. The Linux kernel only takes up about 100MB, leaving 400MB for the web serving. Meanwhile, Windows will need at least 2GB. In that case, most of the RAM is used to run Windows itself, leaving only little for the web server. That means we need to pay four times the money for Windows to do the same thing that Linux does.
Languages1. What is the most popular language on the web? Why? PHP is most popular because:
- It’s free.
- It’s used by the most popular CMS (WordPress).
- It’s run directly from a PHP file, which means much faster development and a shorter development cycle.
a) jQuery or
b) pure JS or
c) pure CSS for animation effects?Performance-wise, it’s best to use CSS3’s animation effects. Such as fade, easing, roll, and so on. In case of custom animations, such as parallax, we can use the jQuery library. It’s strongly advised that you not use pure JS because of the amount of code required, and the high risk for bugs. 4. How do you identify hover effect on a mockup? Normally, on a mockup we can see the mouse pointer which is either a hand or an arrow. This indicates that the element has a hover effect. In case there is no pointer, there might be a side annotation on the mockup defining what background or font color changes on mouse-over. If not, we should ask the designer for clarification. 5. Are you able to make responsive web without a mobile mockup? Certainly. For a professional developer, a mockup often is not required for mobile versions, unless in very tricky situations. For example:
- Menus often get hidden and open via the “burger bar”
- Most images will span 100%, but for product/post grid it may be wise to use two columns to avoid lengthy scrolling.
- Most text will go full screen width.
- Overall, a responsive layout must be easy to use for the mobile user.