Parking lot spot assignment

DesignEasy30 min

Your task

Design the backend for a parking-lot system. The lot has a fixed number of spots in a few size classes (compact, standard, large). When a car enters, the system assigns and reserves a free spot of a fitting size; when it leaves, the spot frees up and a fee is computed from the duration. A display should show how many free spots remain. Cover the data model, how spot assignment works, and how you avoid double-assigning a spot.

It covers

  • State machine
  • Concurrency