teacher
Sign in

Parking Lot

Design a multi-level parking lot with spot allocation, tickets and pluggable fee rules, in Java and C++.

40 min3 interactive1 problems

Requirements

Ask first, then fix the scope. A reasonable set for a 45 minute round:

  • The lot has several levels; each level has spots of three sizes: small, medium, large.
  • Vehicles are bike, car or truck. A vehicle may use a spot of its own size or larger.
  • On entry the driver gets a ticket. On exit the driver pays by the hour, rounded up, minimum one hour.
  • If nothing fits, entry is refused.
  • Several gates may call park and leave at the same time.

Out of scope: payment gateways, number-plate cameras, reservations.

1 of 7