KatInterview

Designing a Multi-Restaurant Booking Platform

System DesignModel answer
MediumModel answerSystem Designconcurrencydistributed-systemsdatabases

Last updated

Build a reservation system where users find and book tables across restaurants while preventing double-bookings under concurrent requests.

You're building a platform that connects diners with restaurants for table reservations. Users should be able to find available seating across multiple venues, secure a reservation, and modify or cancel it later. Restaurant owners need to set up their seating capacity, operating hours, view incoming reservations, and track guest arrivals and absences.

Your design should address:

Core Functionality:

  • Users query open time slots by filtering on city, date, desired time, and group size
  • Users complete a reservation for a selected slot
  • Users update or remove their existing reservations
  • Restaurants define their table inventory and service windows
  • Restaurants view their reservation schedule and update party status

Key Constraints:

  • The platform serves numerous restaurants across multiple cities
  • Browsing activity significantly exceeds actual booking completions
  • No table can be confirmed for two different groups during overlapping periods—this is your primary correctness requirement
  • Payment processing, rating systems, and food menus are outside this scope

Design Phases:

Phase 1 — Foundation Establish what the system must achieve for both user types and what it explicitly won't handle. Define the core API contracts and storage schema for venues, seating inventory, operating schedules, and reservation records. Show how you'll track which tables are occupied when.

Phase 2 — Preventing Conflicts Detail the end-to-end flow when a user commits to a time slot. If two users simultaneously select the final available table for the same period, your design must ensure only one succeeds. Address retry scenarios, connection failures during booking, and how venue-side changes (like removing tables) affect existing reservations.

Phase 3 — Performance at Scale Most requests are users exploring options across many venues. Explain how availability queries remain responsive and reasonably current. Then consider a scenario where a highly sought-after venue releases new booking dates: describe how your system handles the surge without degrading service for other venues or treating users unfairly.

Provide rough capacity estimates to justify your choices, explain your trade-offs, and describe how you'd verify the system is working correctly.

Hints

Hint 1

Think about separating read-heavy browsing from write-critical booking confirmation—different consistency needs suggest different strategies.

Hint 2

The core correctness challenge is serializing access to the same table-time combination; consider database primitives that naturally enforce mutual exclusion.

Hint 3

For high-traffic venues, consider whether you need temporary claims on tables before final confirmation, and how those claims expire if abandoned.