Design a Multi-Level Parking Garage With Different Spot Sizes
Last updated: November 29, 2026
Quick Overview
Design the object model for a parking garage at an Amazon office campus with several levels, spot sizes (motorcycle, compact, large) and vehicle types (motorcycle, car, van). Support parking a vehicle in the smallest suitable free spot, unparking by ticket, and reporting free spots per size.
Amazon
November 29, 20260
0
0 solved
Design the object model for a parking garage at an Amazon office campus with several levels, spot sizes (motorcycle, compact, large) and vehicle types (motorcycle, car, van). Support parking a vehicle in the smallest suitable free spot, unparking by ticket, and reporting free spots per size.
A frequently used Amazon onsite low-level design question. The interviewer looks for clean entities, a fit rule that is easy to change, O(1) or O(log n) spot allocation rather than scanning every spot, and attention to concurrency at the gates.
What the Interviewer Expects
- Identify entities: Garage, Level, Spot, Vehicle, Ticket
- Encode which vehicle sizes fit which spot sizes
- Allocate in better than linear time using free lists per size
- Issue and resolve tickets
- Address concurrency when two gates park at once
Key Topics to Cover
How to Approach This
- Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
- Choose data structures based on access patterns, not familiarity.
- Prefer immutable data and message passing over shared mutable state for concurrency.
- Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
- How would you add EV charging spots?
- How would you compute fees by duration with different rates?
- How would you make allocation prefer the lowest level or nearest elevator?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Vehicle sizes are ordered: MOTORCYCLE < CAR < VAN, and spot sizes the same. A vehicle fits any spot of its size or larger; prefer the smallest fitting size, then the lowest level and spot number. Unpa...
High-Level Design
SizeIntEnum for both vehicles and spots so 'fits' isspot.size >= vehicle.size.Spot(level, number, size);Ticket(id, plate, spot, entry_time).Garagekeeps, per spot size, a min-heap...