Design an Elevator System and Scheduler
RemitlySoftware Engineer · OnsiteLast updated
This question evaluates a candidate's object-oriented design and algorithmic scheduling competencies, focusing on concurrency control, fault tolerance, queue management, tie-breaking rules, and time/space complexity analysis within an elevator control system.
Design an object-oriented elevator system. Define core classes and interfaces (elevator, controller, request, floor, buttons, sensors) and their interactions, including concurrency and fault handling. Propose a scheduling algorithm that optimizes travel time and fairness. Given pending requests for floors [1, 99, 2], show how your scheduler ensures stopping at 2 before 99 while using only a single internal queue data structure; detail the queue operations required, tie-breaking rules, and time/space complexity. Explain how your design scales to multiple elevators and supports peak traffic modes.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.