POST /reservations
{
"vehicleType": string,
"reservationDateAndTime": timestamp,
"reservationDuration": timestamp,
"userID": string,
"paymentStatus": boolean
}
GET /reservations/{id}
UPDATE /reservations/{id}
GET /availability
The database should be a Relational Database Management System that includes the reservation data (userID, vehicleType, reservationDateAndTime, reservationDuration, paymentStatus) and the tracking data (enteredUserID, exitedUserID, noShowUserID)
The Track server tracks in real-time the number of vehicles that enter and exit, and their size. Based on this tracking, it makes a calculation of the amount of available parking lots. This estimate is stored in the Database. The client makes an online reservation, inputting: their name, their vehicle type, the date and time of the reservation, and the expected duration for parking. Based on this data, the Reserve server queries the database, checking if there is any matching availability. If there is a matching availability, the Reserve server let the client pays the reservation, and the server updates the Database. If there is no availability, the Reserve server proposes to the client alternative time that best matches the reservation. The Track server checks if the reservation has been honored, and otherwise calculates the discrepancy in time between the reservation and the actual entering in the parking lot. Past a certain time, the Reserve server cancels the reservation. Before this time, the Reservation implements a penalty fee that is function of the discrepancy in time.
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Dig deeper into 2-3 components and explain in detail how they work. For example, how well does each component scale? Any relevant algorithm or data structure you like to use for a component? Also you could draw a diagram using the diagramming tool to enhance your design...
Explain any trade offs you have made and why you made certain tech choices...
Try to discuss as many failure scenarios/bottlenecks as possible.
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?