7
Back to Problem Dungeon

Elevator System

hard

Step 1: Requirements

Requirements

Questions to ask the interviewer

  1. How many elevators and floors?
  2. What scheduling algorithm — FCFS, SCAN, LOOK, destination dispatch?
  3. Capacity limit per elevator?
  4. Do we handle priority (fire/VIP)?
  5. Maintenance mode per elevator?

Functional requirements

  • Building with N floors and M elevators.
  • External buttons (up/down) on each floor; internal buttons (floor numbers) inside each elevator.
  • Elevator picks up and drops off passengers efficiently.
  • Scheduling algorithm assigns external requests to the best elevator.
  • Each elevator has states: Idle, MovingUp, MovingDown, DoorOpen.
  • Display current floor and direction on each floor.

Non-functional requirements

  • Fair scheduling (no starvation of distant floors).
  • Minimize average wait time.
  • Extensible scheduling (swap algorithms without changing elevator logic).

Assumptions

  • Single building.
  • No weight sensor (just max capacity count).
  • All floors are accessible by all elevators.

1 / 7 — Requirements