Elevator Simulator

Description

Experience the joy of riding an elevator without even getting out of your seat!

I created this simulated elevator experience in response to a question I was asked in an interview.

"How would you engineer an elevator?"

Well, I've gone and done just that. And after completing this exercise, I think I have a better understanding of how Id do it.

Challenges

Deciding how to efficiently move to the next floor in the queue while also minimizing the amount of back-tracking required to deliver all riders to their desired floor.

You can't simply move from one floor to the next in the order that the buttons were pressed because it would result in a lot of additional back and forth travel, adding extra wear and tear to the elevator components and slowing down the experience for riders.

Resolutions

I decided that the elevator should always be moving in the direction of the next floor in the queue (based on the order buttons were pressed).

However, to minimize the amount of back and forth travel, the elevator should also stop to let passengers out on floors between the current floor and the next destination floor in the queue.

Tech

HTML
CSS
JavaScript
Node
Webpack