Design an Elevator Control System
Problem Description
Design an object-oriented elevator control system for a building equipped with multiple floors and multiple elevators.
The system must support the following functionalities:
- Hall Requests: Users on any floor can request an elevator to go either up or down.
- Cabin Requests: Users inside an elevator can select a specific destination floor.
- Elevator State Tracking: The system should continuously track each elevator's current floor, direction of travel, door state (open/closed), and its list of pending stops.
- Request Assignment: Hall requests must be assigned to an appropriate elevator.
- Efficient Movement: Elevators should move efficiently, avoiding obviously suboptimal scheduling decisions.
The primary focus should be on a clean object-oriented design and the core scheduling logic. You are explicitly not required to model low-level motor hardware, networking protocols, or a graphical user interface.
Candidates should discuss the main classes, their responsibilities, state transitions, and how requests are processed. Optionally, describe a simple dispatch algorithm and how the design could be extended in the future.
AI interview prep
Core dilemma
Balancing real-time request processing and efficient resource (elevator) utilization with the complexity of scheduling algorithms and maintaining system state consistency. The challenge lies in optimizing for throughput and fairness while managing a dynamic, concurrent system.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Design an Elevator Control System
Problem Description
Design an object-oriented elevator control system for a building equipped with multiple floors and multiple elevators.
The system must support the following functionalities:
- Hall Requests: Users on any floor can request an elevator to go either up or down.
- Cabin Requests: Users inside an elevator can select a specific destination floor.
- Elevator State Tracking: The system should continuously track each elevator's current floor, direction of travel, door state (open/closed), and its list of pending stops.
- Request Assignment: Hall requests must be assigned to an appropriate elevator.
- Efficient Movement: Elevators should move efficiently, avoiding obviously suboptimal scheduling decisions.
The primary focus should be on a clean object-oriented design and the core scheduling logic. You are explicitly not required to model low-level motor hardware, networking protocols, or a graphical user interface.
Candidates should discuss the main classes, their responsibilities, state transitions, and how requests are processed. Optionally, describe a simple dispatch algorithm and how the design could be extended in the future.