Requirements


Functional Requirements:


  • Allow reservation of a parking spot.
  • Process payment for the reservation.
  • Enable parking of a car in the reserved spot.
  • Support early departure before reservation time expires.
  • Gate check-in/out.
  • Handle no show.



Non-Functional Requirements:


    List the key non-functional requirements (eg low latency, scalability, reliability, etc.)...


API Design

Parking Lot Management

  • POST: Create a parking lot segment, defining criteria such as:
    • Difficulty to reach from the entrance (scale from 1 to 5)
    • Difficulty to leave towards the exist (scale from 1 to 5)
    • Rating of the space available for a parking spot (small, medium,relaxed)
    • Security level (1: No special considerations, 2: Guard available, 3: Cameras available)
  • PUT: Update a parking lot segment
  • GET: Retrieve all parking lot segments
  • GET: Retrieve a parking lot segment by ID

Parking Spots Management

  • GET: Retrieve all parking spots
    • Filter by availability
  • GET: Retrieve a single parking spot by ID
  • POST: Create a parking spot, to be used when configuring the system, with the following available criteria:
    • width, depth, height
    • accessibility rating (1, 2, 3: wheelchair can be used)
    • parking lot segment id
  • PUT: Update a parking spot, to be used when configuring the system

Reservation Management

  • POST: Create a new parking spot reservation
  • PUT: Update a new parking spot reservation, for example, in order to end the reservation. We do not delete in order to maintain history
  • GET: Retrieve all servations
    • Filter by parking spot ID
    • Filter by active reservations
    • Filter by date


High-Level Design

Describe the overall system architecture. Identify the main components needed to solve the problem end-to-end. Use the diagramming tool to create a block diagram.




Detailed Component Design

Reservation Management

  • How to create a new reservation?
    • Ask the user for some considerations, such as experience in navigating a parking spot, accessibility considerations, vehicle type/size considerations, time/date
      • Then retrieve all parking spots matching such criteria considering also the parking lot segment
      • Retrieve all future reservations for such parking spots
      • reserve the first available parking spot matching all conditions and having no reservation in the requested time/date
    • Select the first parking spotA new reservation is done by inserting a new record in the table `reservations`

Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.