Design a Parking Lot (Low-Level Design)
How the interviewer asks it
“Design a parking lot with several floors, spots of different sizes for motorbikes, cars and vans, and entry and exit gates. Model vehicles, spots, tickets and hourly pricing, and show how a vehicle gets the nearest spot that fits.”
Typed drills are free and unlimited: the AI scores your answer against the outline below.
What the interviewer is looking for
- You agree on scope before writing classes: floors, sizes, payment, display boards.
- Clear core classes: ParkingLot, Floor, Spot, Vehicle, Ticket, and a pricing strategy.
- Spot assignment behind an interface so the rule can change.
- Thread safety when two cars arrive for the last spot.
- You resist inheritance trees where a field or enum would do.
How to structure your answer
- 01
Clarify
Which vehicle sizes can use which spots? Pay on exit or entry? One entry gate or many?
- 02
Core model
Vehicle with a size, Spot with a size and state, Floor holding spots, Ticket with entry time, spot and vehicle.
- 03
Assignment
A SpotFinder interface; the nearest-fit version keeps a free-spot set per size per floor.
- 04
Pricing
A PricingStrategy taking the ticket and exit time, so hourly, flat and weekend rates are swappable.
- 05
Concurrency
Reserve a spot atomically when issuing a ticket; release it on exit.
Best answers from candidates
No candidate answers yet. Type yours, and if it scores 6 or more you can show it here without your name.
Answers are shared by candidates, without names, after a privacy check. Add yours
Common mistakes
- A subclass for every vehicle and spot type with no behaviour in them.
- Pricing logic inside the Ticket or ParkingLot class.
- No answer for two gates assigning the same spot.
Follow-up questions to expect
- Add reserved spots for electric cars with chargers.
- Show a live count of free spots per floor on a board at the entrance.
Now answer it out loud
Max will ask you this exact question, listen to your answer, push on the weak spots with follow-ups like the ones above, and score you when you finish.
Practice with MaxFree: a 5-minute voice round and unlimited typed drills, with scored feedback. No card, and your camera is never recorded.
More low-level design interview questions
Preparing for this round? Read how to prepare for a low-level design (LLD) interview.