Design an online hotel reservation system.
The system should allow customers to search for hotels, view available room types, create a reservation, and complete checkout through a third-party asynchronous payment provider.
Focus especially on these deep dives:
-
Availability search:
Given a hotel, check-in date, check-out date, party size, and quantity of rooms, return only room types that are available for every night in the requested date range.
-
Checkout and payment timeouts:
During checkout, distinguish between these two cases and handle each correctly:
-
The user never actually paid, and the checkout session timed out.
-
The user did pay, but the third-party payment provider's asynchronous response arrived later than the timeout configured by your system.
Discuss functional requirements, APIs, data models, consistency guarantees, concurrency control, timeout handling, and scalability.