AlgoMaster Logo

Design Elevator System

Ashish

Ashish Pratap Singh

medium

In this chapter, we will explore the low-level design of an elevator system in detail.

Lets start by clarifying the requirements:

1. Clarifying Requirements

Before starting the design, it's important to ask thoughtful questions to uncover hidden assumptions and better define the scope of the system.

Here is an example of how a conversation between the candidate and the interviewer might unfold:

After gathering the details, we can summarize the key system requirements.

1.1 Functional Requirements

  • Support multiple elevators operating within the same building
  • Handle both internal (cabin) and external (hall) floor requests
  • Assign requests to the most appropriate elevator, based on proximity and direction
  • Simulate basic elevator behaviors like moving between floors and stopping at requested floors
  • Display real-time updates for each elevator’s current floor and movement direction (UP/DOWN)

1.2 Non-Functional Requirements

  • Modularity: The system should follow object-oriented principles with clearly defined components
  • Scalability: The design should be scalable to support buildings with many elevators and floors
  • Concurrency Handling: The system must handle simultaneous floor requests without conflicts or race conditions
  • Responsiveness: The system should respond quickly to user input and reflect changes (e.g., floor updates, direction changes) in real-time
  • Maintainability: The design should be clean, modular, and easy to test, debug, or enhance

After the requirements are clear, lets identify the core entities/objects we will have in our system.

2. Identifying Core Entities

Premium Content

This content is for premium members only.