Bird
0
0

Which class in a parking lot system should keep track of all parking spots available on a single floor?

easy🧠 Conceptual Q1 of 15
LLD - Design — Parking Lot System
Which class in a parking lot system should keep track of all parking spots available on a single floor?
AFloor
BParkingLot
CVehicle
DSpot
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of Floor class

    The Floor class represents one level in the parking lot and manages all spots on that level.
  2. Step 2: Identify which class manages spots

    Since spots are located on floors, Floor should keep track of all spots on it.
  3. Final Answer:

    Floor -> Option A
  4. Quick Check:

    Floor manages spots = D [OK]
Quick Trick: Floors hold spots; parking lot holds floors [OK]
Common Mistakes:
MISTAKES
  • Confusing ParkingLot with Floor for spot management
  • Assigning spot tracking to Vehicle class
  • Thinking Spot manages other spots

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes