Problem statement
Design the object model and public APIs for the control software of an elevator installation in a mid-rise office building. The core owns a bank of elevator cars, ingests pressed buttons from the lobby and from inside each car, decides which car serves which request, and drives every car's motion and doors through their state machines. This is the in-process control kernel a hardware layer or a simulator would drive, not the physical wiring.
Operating context. One building, 8 to 20 floors, a bank of 2 to 6 cars sharing the same shaft group. Two request kinds arrive: a hall call (someone on a floor presses up or down) and a car call (a rider inside a car presses a destination floor). A host loop ticks the system forward: on each tick the kernel advances car positions, opens or closes doors, and may assign or reassign pending hall calls to cars. Each car maintains its own set of pending stops and a current travel direction, and services stops in a sweep so it does not thrash. Dispatch policy must be swappable so a nearest-car rule today can become a scan or load-aware rule tomorrow without touching motion or door code. A single thread drives the tick loop; the host owns the clock and passes elapsed time in.
Out of scope. The physical motor/sensor drivers and safety interlocks, real-time scheduling guarantees of the hardware, the building HVAC and lighting, any UI or floor-indicator rendering, and persistence of ride history between runs. Assume separate systems own those.
What to produce. The class hierarchy (entities, value objects, and the controller/dispatcher services), the public API each class exposes, and the state transitions of a car (idle, moving up/down, doors opening/open/closing) and of a request (pending, assigned, served). Be explicit about: how a car keeps up and down stop queues and sweeps them without reversing early, how door and motor states are modeled so a car never moves with doors open, how the dispatcher is a pluggable strategy that maps a hall call to a car, and how a new dispatch policy is added without editing the cars or the controller.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design LLD
- Oop Solid
- Patterns Strategy
- Patterns State
- Statemachine