Design the backend for an online hotel booking platform.
The system should let users:
-
search for hotels by location, dates, and number of guests
-
view hotel details, room types, prices, and availability
-
reserve a room and complete payment
-
receive a booking confirmation
-
cancel a booking according to policy
Start by clarifying functional and non-functional requirements. Then define the core data model in detail, including the main entities, important attributes, and relationships among hotels, room types, nightly inventory, reservations, users, and payments.
Also discuss the quantitative requirements you would want to establish or assume, such as expected search traffic, booking throughput, latency targets, and data consistency needs. Explain how you would prevent overselling the same room inventory while keeping search fast at high scale.