Requirements


Functional Requirements:


  • Allow user to reservate a speceific parking spot.
  • Show user available parking spots.
  • Allow user to indicate for how long he is going to stay (optional if he does not know).
  • Generate QR to let the user enter the parking lot.
  • Let the user enter the parking lot with his plate number.
  • The user has 15 minutes of tolerance, if he does not shows up he lose is spot and pays a reservation fee.
  • Allow payments through the app.
  • Calculate the time he spends parking.
  • Calculate the payment based on the time.


Non-Functional Requirements:


  • Low latency to let the users access to the parking lot quickly.
  • High availability to not get the users stuck in the parking lot.
  • Save the info for 6 months in order to analyze the type of vehicles that come to the parking lot.
  • Strong consistency to always know the available spots


API Design


GET /showAvailableSpots

Send the list of the available spots in the parking lot, such as the floor, the schedule for that spot (in case some appointed it)

{

"floor": 2,

"schedule": {

"startDate": "02/02/2026 - 12:00:00",

"endDate": "02/02/2026 - 15:00:00"

}

}


POST /makeReservation

Make a reservation fot a parking spot, the user have to send the info of his car (brand, model), the period of time he is going to stay.

http body:

{

"carInfo" : {

"brand": "Ford",

"model": "Fiesta 2022" ,

"numberPlate": "XBD-123"

},

"startTime": "02/02/2026 - 14:00:00",

"endTime": "02/02/2026 - 19:00:00"

}

reponse:

{

"reserved": true

}


POST /makePayment

Make the payment of the reservation and save the info in case the user spends more time parked

http body:

{

"cardNumber": 400000000001

"expirationDate": "02/02/2029"

"securityCode": 123,

"orderNumber": 321

}


response:

{

"successPayment": true,

}


POST /checkIn

Save the date and hour when the user enters the parking spot

httpBody

{

"startDate": "02/02/2026 - 12:00:00",

"plateNumber": "WBM-234"

}

response:

{

"success": true

}


POST /chekOut

Calculate the extra time the user spended in the parking spot and charge an extra fee, based on the startTime and free the space the user were using.

http body:

{

"plateNumber": WBD-234,

"leavingTime": "02/03/2026 - 12:00:00"

}


response:

{

"extraFee": false,

}



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

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