Design object model for an elevator system
AmazonSoftware Engineer · OnsiteLast updated
This question evaluates object-oriented design and system-architecture skills for modeling a multi-elevator control system, including class responsibilities, interactions, request flow, and scheduling policies.
Design the object-oriented model for an elevator (lift) system in a multi-floor building that may have multiple elevators.
The system should support:
- External requests: people on each floor can press Up/Down call buttons.
- Internal requests: passengers inside the elevator can select a destination floor.
- An elevator can move up/down, open/close doors, and stop at requested floors.
- A scheduler/controller decides which elevator should handle which requests (especially when there are multiple elevators).
Tasks
- Identify and describe the main classes, their responsibilities, and relationships. Examples might include:
Elevator,ElevatorController,Floor,Request,Button, etc. - Explain how the system handles request flow end-to-end:
- A user presses an Up/Down button on a floor.
- An elevator is assigned and moves to that floor.
- The user selects a destination floor inside the elevator.
- The elevator services multiple requests while moving.
- Propose a scheduling strategy (algorithm) for choosing which elevator should handle new requests (at a high level, not full code). Discuss how it works in typical scenarios (e.g., many people going up in rush hour).
- Discuss how your design can handle edge cases and extensions, such as:
- Elevators going into maintenance mode.
- Overload (too many people inside).
- Emergency stop or fire mode.
- Adding more elevators or floors in the future.
You may use UML-style notation or plain text descriptions for classes and interactions.
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.