Design a Parking Garage Object Model
UberSoftware Engineer · OnsiteLast updated
This question evaluates object-oriented design, domain modeling, data structure selection, and concurrency control for resource allocation in a multi-level parking garage.
Design an object-oriented model for a multi-level parking garage.
The garage should support:
- Multiple floors and parking spots.
- Different vehicle types, such as motorcycle, car, van, and electric vehicle.
- Different spot types, such as motorcycle, compact, large, accessible, and electric-charging spots.
- Vehicle entry, ticket creation, spot assignment, vehicle exit, payment calculation, and spot release.
- Querying current availability by spot type.
Describe the main classes, relationships, methods, and data structures you would use. Discuss how your design would handle spot allocation, pricing, and concurrent entry or exit events.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.