I started with the obvious classes (Elevator, Request, Controller) and felt okay about that part.
Start by clarifying requirements and constraints (e.g., N floors, M elevators, real-time guarantees, fault tolerance). Then present a high-level design with core classes, scheduling algorithm, and state machine, and finally dive into concurrency, overload, and failure handling. Emphasize trade-offs and justify your choices.
Pro tip: Show that you think about edge cases and failure modes early, and propose a simple, robust design that can be extended. Mention that you'd start with a single-threaded event loop or actor model to avoid concurrency bugs, then scale if needed.
Ask about building size, traffic patterns, real-time constraints, fault tolerance, and whether the system is distributed. Define functional and non-functional requirements.
Identify main entities: Elevator, Floor, Request, Scheduler, Controller. Define key methods and state transitions for each.
Choose a scheduling algorithm (e.g., SCAN, LOOK, or destination dispatch) and explain how it handles multiple requests and optimizes wait time.
Describe how to manage concurrent requests, state transitions, and synchronization. Use locks, queues, or actor model to ensure thread safety.
Explain handling of overloaded elevators, stuck elevators, power failures, and how to recover or degrade gracefully.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.