Design an object-oriented elevator control system for a building with multiple floors and multiple elevators.
The system should support:
-
Hall requests from each floor, where a user can request to go up or down
-
Cabin requests from inside an elevator, where a user selects a destination floor
-
Tracking each elevator's current floor, direction, door state, and pending stops
-
Assigning hall requests to an appropriate elevator
-
Moving elevators efficiently while avoiding obviously poor scheduling decisions
Focus on clean object-oriented design and the core scheduling logic. You do not need to model low-level motor hardware, networking, or a graphical UI.
Discuss the main classes, responsibilities, state transitions, and how requests are processed. If useful, also describe a simple dispatch algorithm and how you would extend the design later.