Bird
0
0
LLDsystem_design~5 mins

Elevator, Floor, Request classes in LLD - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the main responsibility of the Elevator class in a building system?
The Elevator class manages the elevator's current state, including its current floor, direction, and the list of requests it needs to serve.
Click to reveal answer
beginner
How does the Floor class typically interact with the Elevator system?
The Floor class represents a building floor and can generate requests when a user wants to go up or down, signaling the Elevator system to respond.
Click to reveal answer
beginner
What information does a Request class usually contain in an elevator system?
A Request class contains details like the source floor, destination floor, and the direction of travel (up or down) to help the elevator decide its movement.
Click to reveal answer
intermediate
Why is it important for the Elevator class to maintain a queue of Requests?
Maintaining a queue helps the Elevator class efficiently plan stops and serve multiple requests in an organized manner, improving system responsiveness.
Click to reveal answer
intermediate
How can the Elevator system decide which request to serve next?
The system can use algorithms like 'nearest floor first' or 'direction-based scheduling' to pick the next request that minimizes travel time and wait time.
Click to reveal answer
Which class is responsible for generating a request when a user presses a button on a floor?
AFloor
BElevator
CRequest
DController
What key data does a Request class NOT typically include?
ADestination floor
BUser's name
CSource floor
DDirection
Why does the Elevator class keep track of its current floor?
ATo know where to stop next
BTo count passengers
CTo open doors automatically
DTo change the building's floor numbers
Which scheduling strategy helps an elevator serve requests efficiently?
ARandom floor selection
BServing requests in reverse order
CIgnoring requests
DNearest floor first
What does the Floor class represent in the elevator system?
AThe elevator's motor
BThe elevator's control panel
CA building level where users wait
DA request queue
Explain the roles of Elevator, Floor, and Request classes in an elevator system.
Think about how a person calls and uses an elevator.
You got /3 concepts.
    Describe how an elevator system decides which request to serve next and why this is important.
    Consider how elevators avoid unnecessary travel.
    You got /3 concepts.