This is a coding puzzle often used when hiring a developer to test their ability to problem solve and write algorithms. This constraints also test their fundamental ability to write good, modern JavaScript without using external libraries such as jQuery. Lastly by requiring a UI that shows the elevators updating in real-time, their ability to use HTML and CSS to build a functional UI is tested.
- 10 Story Building
- 3 Elevators
- Build a program to control the actions of a set of elevators inside of a building.
- An empty elevator can go up or down.
- An elevator with passengers must continue in its current direction
- An elevator must stop at all floors requested before it reverses direction.
- Build a simple display that shows the 3 elevators within that building, animating the position of the elevators in real-time with CSS.
- You must use plain JavaScript with no external libraries (jQuery, Cash, etc.).
- You must use valid HTML5 and CSS3.
- The program needs to implement a central data store that holds the state of each elevator as well as any data necessary for the program.
- You must make use of callback functions or promises.
- Basic HTML and CSS - Was the display created efficiently with minimal HTML and CSS
- JavaScript - Was the Javascript properly written, did they use consistent code style and did the make any logic errors
- Data structures - Was the structure of the data store efficient
- DRY coding practices (objects) - Was the code for the 3 elevators duplicated or was it inherited, did they use objects or functions
- Callback functions - Were the callback functions for the elevator and buttons implemented correctly were proper triggers used
- CSS Animations - Was the display animated properly with CSS animations