Design a Parking Lot (OOD)

Problem Design an object-oriented parking lot with multiple levels and several spot types.

Requirements

  • Spot types: motorcycle, compact, large.
  • Vehicles: motorcycle, car, bus (a bus needs 3 large spots).
  • park(vehicle) -> ticket; unpark(ticket) -> fee.
  • Pricing by vehicle type and duration.

Areas to design

  • The class hierarchy (Vehicle, Spot, Level, ParkingLot, Ticket).
  • The spot-finding strategy and vehicle-to-spot fit rules.
  • Separation of pricing from allocation, and thread safety for concurrent parks.
added …
LeaderboardSalaryAccount