Bird
0
0
LLDsystem_design~20 mins

Class identification (ParkingLot, Floor, Spot, Vehicle) in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Parking Lot Class Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Identify the primary responsibility of the ParkingLot class
In a parking lot system, which of the following best describes the main responsibility of the ParkingLot class?
ARepresent a single floor within the parking lot
BRepresent a single parking spot where a vehicle can park
CManage the overall parking facility including floors and spots
DTrack the details of a vehicle such as license plate and type
Attempts:
2 left
💡 Hint
Think about which class would oversee the entire parking structure.
🧠 Conceptual
intermediate
1:30remaining
Which class should handle vehicle parking logic?
In the parking lot system, which class is best suited to handle the logic of parking a vehicle into a spot?
AFloor
BSpot
CVehicle
DParkingLot
Attempts:
2 left
💡 Hint
Consider which class represents the place where a vehicle actually parks.
Architecture
advanced
2:00remaining
Determine the correct relationship between Floor and Spot classes
Which of the following best describes the relationship between Floor and Spot classes in a parking lot system?
ASpot inherits from Floor to reuse properties
BSpot contains multiple Floor objects representing levels
CFloor and Spot are unrelated and operate independently
DFloor contains multiple Spot objects representing parking spaces
Attempts:
2 left
💡 Hint
Think about how floors and spots are organized in a real parking lot.
scaling
advanced
2:30remaining
Scaling the ParkingLot system for multiple vehicle types
To support different vehicle types (car, motorcycle, truck) with different spot sizes, which class should be extended or modified?
AExtend Vehicle class to include type and size, and modify Spot to check compatibility
BModify ParkingLot to assign spots based on vehicle type only
CAdd vehicle type logic only in Floor class without changing Spot or Vehicle
DCreate separate ParkingLot instances for each vehicle type
Attempts:
2 left
💡 Hint
Consider where vehicle size and spot size compatibility should be checked.
tradeoff
expert
3:00remaining
Choosing the best class to track parking spot availability efficiently
For efficient tracking of available parking spots in a large parking lot, which class should maintain the availability data and why?
AEach Floor should maintain availability for its spots to reduce ParkingLot complexity
BParkingLot should maintain a global availability map for all spots to enable quick lookup
CEach Spot should maintain its own availability and ParkingLot queries all spots directly
DVehicle class should track availability as it knows which spots are occupied
Attempts:
2 left
💡 Hint
Think about balancing data centralization and query efficiency.