LLD Problem · Medium

Design a Parking Lot

Design a multi-floor parking lot supporting different vehicle types with pluggable pricing and spot allocation. Key requirements: - Levels with typed spots (bike/car/truck) - ticket issue on entry with timestamp - nearest-spot allocation strategy (pluggable) - pricing strategies (hourly/flat/peak) - exit with payment - capacity reporting.

Problem statement

Design a multi-floor parking lot supporting different vehicle types with pluggable pricing and spot allocation. Key requirements: - Levels with typed spots (bike/car/truck) - ticket issue on entry with timestamp - nearest-spot allocation strategy (pluggable) - pricing strategies (hourly/flat/peak) - exit with payment - capacity reporting.

Functional requirements

  • 01.Vehicles can enter and exit
  • 02.Allocate the nearest available spot by vehicle type
  • 03.Compute fees on exit using configurable pricing
  • 04.Support multiple floors
  • 05.Generate tickets and receipts

Non-functional requirements

  • •Concurrent entries/exits must not double-book a spot
  • •99.9% availability
  • •P95 entry latency < 200ms

Constraints & assumptions

  • ›Max 5 floors
  • ›Max 1000 spots per floor
  • ›Three vehicle types: BIKE, CAR, TRUCK