OODMedium71% interview frequency · Last seen 2025-08

Design a Parking Lot

Problem

Design an object-oriented parking lot system.


The lot has multiple levels, each with parking spots of different sizes (compact, regular, large). Vehicles (motorcycle, car, van) require appropriately sized spots.


Implement classes and methods to:

- Park a vehicle and return a ticket

- Unpark using a ticket and calculate fee

- Report available spots by type


Discuss class hierarchy, extensibility, and concurrency if time allows.

Common follow-ups

  • How would you support electric vehicle charging spots?
  • How do you handle payment integration?

Solution

# Solution locked
# Sign in to unlock expert solutions
# with multi-language code and analysis

Sign in to unlock

Create a free account to preview problems. Subscribe for full access to our curated bank — expert tutorials, follow-ups, and practice tools you won't find on public sites.