⌘K
Flycodx

Design an Elevator System

Design an Elevator System

MediumLLD0% accepted

Design an elevator system for a 20-floor building with 3 elevators. Implement the elevator scheduling algorithm (SCAN/LOOK), handle external requests (floor buttons) and internal requests (destination buttons).

Approach

Design elevator system with LOOK scheduling algorithm and state machine.

Input

Elevator at floor 5 going up; requests at 7, 3, 9

Output

LOOK: serve 7, 9 (going up); reverse; serve 3; optimal: floor 7 then 9 then 3

Scenarios & Expected Answers

Sign in to continue

Create a free account to view answers and mark progress.

  • Free forever — no credit card
  • Theory Q&A with detailed answers
  • Points, streaks & leaderboards
Auto Save On