Bird
0
0
LLDsystem_design~20 mins

Elevator, Floor, Request classes in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Elevator System Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding the role of the Request class in elevator systems

In an elevator system design, what is the primary responsibility of the Request class?

ATo represent a user's call for the elevator from a specific floor and direction
BTo manage the list of floors serviced by the elevator
CTo control the movement of the elevator between floors
DTo monitor the elevator's current position and speed
Attempts:
2 left
💡 Hint

Think about what a user does when they want to use an elevator.

Architecture
intermediate
2:00remaining
Identifying the correct relationship between Elevator and Floor classes

Which of the following best describes the relationship between the Elevator and Floor classes in a typical elevator system design?

AElevator contains multiple Floor objects representing floors it can visit
BFloor contains multiple Elevator objects representing elevators stopping there
CElevator and Floor are independent with no direct association
DFloor inherits from Elevator to reuse movement logic
Attempts:
2 left
💡 Hint

Consider how an elevator knows which floors it can go to.

scaling
advanced
3:00remaining
Scaling elevator request handling for a high-rise building

In a high-rise building with 50 floors and 10 elevators, which design choice best improves the scalability of handling elevator requests?

ALet each elevator handle requests independently without coordination
BUse a centralized request queue shared by all elevators
CAssign each elevator its own request queue and coordinate via a scheduler
DProcess requests only when elevators are idle to reduce complexity
Attempts:
2 left
💡 Hint

Think about balancing load and avoiding conflicts among elevators.

tradeoff
advanced
3:00remaining
Choosing between polling and event-driven request handling

For the Elevator system's Request class, which tradeoff best describes using an event-driven approach over polling to handle requests?

APolling reduces latency but uses more memory
BEvent-driven reduces CPU usage but increases system complexity
CEvent-driven increases latency but simplifies code
DPolling eliminates the need for synchronization mechanisms
Attempts:
2 left
💡 Hint

Consider how the system reacts to new requests and resource usage.

component
expert
3:00remaining
Estimating capacity for elevator request queue in peak hours

In a building with 20 floors and 5 elevators, during peak hours, each floor generates on average 10 elevator requests per minute. If each elevator can process 15 requests per minute, what is the minimum size of the request queue to avoid dropping requests?

AAt least 200 requests to handle double the incoming rate
BAt least 50 requests because elevators can process 75 requests total per minute
CAt least 10 requests since elevators process requests continuously
DAt least 100 requests to buffer all incoming requests
Attempts:
2 left
💡 Hint

Calculate total incoming requests per minute and total processing capacity.