← Back to All Questions
Medium~50 minE-Commerce

Design Hotel Booking System

Booking.comExpediaAirbnbMarriottHilton

📝 Problem Description

Design a hotel booking system like Booking.com or Expedia. Users can search for hotels by location and dates, view availability, and make reservations. Handle inventory management, overbooking prevention, and concurrent booking requests.

👤 Use Cases

1.
Guest wants to searches hotels so that sees available hotels with prices
2.
Guest wants to books a room so that reservation confirmed, inventory updated
3.
Guest wants to cancels booking so that room available again, refund processed
4.
Hotel wants to updates inventory so that availability reflected in search

✅ Functional Requirements

  • Search hotels by location, dates, guests
  • View hotel details, amenities, photos
  • Check room availability
  • Book room with payment
  • Cancel/modify reservations
  • Hotel admin inventory management
  • Reviews and ratings

⚡ Non-Functional Requirements

  • Search latency < 500ms
  • No double-booking (critical)
  • Handle 10K bookings per minute
  • 99.99% availability
  • Support 500K hotels globally

⚠️ Constraints & Assumptions

  • Inventory is finite - overbooking must be prevented
  • Prices vary by date and demand
  • Different room types with different inventory
  • Timezone handling for check-in/out

📊 Capacity Estimation

👥 Users
50M DAU, 10K bookings/minute
💾 Storage
500GB (hotels, rooms, bookings)
⚡ QPS
Searches: 50K/sec, Bookings: 200/sec
📐 Assumptions
  • 500K hotels, 50 rooms average = 25M rooms
  • 365 days of availability data = 9B room-nights
  • Average booking: 2 nights
  • Booking conversion: 3%

💡 Key Concepts

CRITICAL
Inventory Locking
Prevent overbooking with pessimistic or optimistic locking on room-date combinations.
CRITICAL
Reservation Hold
Temporarily hold inventory during checkout (10-15 min TTL).
HIGH
Saga Pattern
Distributed transaction: Hold → Pay → Confirm, with compensating actions on failure.
HIGH
Availability Calendar
Pre-computed availability for fast search queries.

💡 Interview Tips

  • 💡Preventing double-booking is the core challenge
  • 💡Discuss the booking flow in detail
  • 💡Cover the hold pattern with timeout
  • 💡Address search vs booking data freshness