1.Get all available room from a hotel: GET /v1/{hotelID}?date_range={date_range}&other_filters
2.Book a room with a date range: POST/v1/book/;
payload: {
hotelID: str,
roomID: str,
userID: str,
dateRange: (datetime, datetime)
}
response: {bookingID: str, status: str}
3.Cancel a booking: POST/v1/cancel;
payload: {
bookingID: str,
userID: str
}
Table Hotel:
HotelID (PK)
Rating
Location
// Other features
Table Room:
RoomID (PK)
HotelID
RoomSize etc
Table RoomDate:
RoomDateID (PK)
RoomID
Date
Status
Table Reservation:
UserID (co-PK)
RoomDateID (co-PK)
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?