Design an elevator control system
GoogleSoftware Engineer · OnsiteLast updated
This question evaluates system design skills including architectural modeling of components, scheduling and concurrency control, state-machine design, and fault-tolerance for real-time control systems, and falls under the System Design domain.
Design an elevator control system for a building with N floors and M elevators. Model the core classes (e.g., Elevator, Request, Controller, Door, Floor), define key methods (e.g., requestPickup(floor, direction), requestDropoff(floor), step()/tick(), getStatus()), and choose a scheduling strategy (e.g., nearest-car or SCAN). Discuss state transitions, handling concurrent requests, priority and fairness, error cases (overload, stuck elevator), extensibility (service modes), and provide class interfaces or pseudocode for the main operations.
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.