Design a Parking Garage Object Model
Company: Uber
Role: Software Engineer
Category: Software Engineering Fundamentals
Difficulty: medium
Interview Round: Onsite
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.
Quick Answer: This question evaluates object-oriented design, domain modeling, data structure selection, and concurrency control for resource allocation in a multi-level parking garage.