KatInterview

Design a Table Booking Platform for Restaurants

System DesignModel answer
HardModel answerSystem Designsystem-designconcurrencydistributed-systems

Last updated

Design a multi-restaurant reservation platform where diners search availability by party size and time, then book, modify, or cancel — without ever double-booking a table.

Table Booking Platform

A hospitality company wants to build a platform that lets diners discover open tables at restaurants and reserve them online. Restaurants also use the same platform internally — staff log walk-in guests and manually entered reservations through a back-office tool that shares the same table inventory.

What the system needs to do

For diners:

  • Search a restaurant's open slots by party size, date, and preferred time
  • Book an available slot and receive a confirmation
  • Change or cancel an existing reservation

For restaurant staff:

  • Configure the restaurant's floor plan (tables and their capacities) and operating hours
  • Set a standard seating duration, which may vary by party size or daypart
  • View a live dashboard of all reservations and walk-ins for the day
  • Seat walk-in guests or enter phone reservations directly, using the same table inventory

Hard requirement

The system must never give two parties the same table for overlapping time windows, even when several diners race to book the last suitable slot simultaneously.

Availability search results should feel fast. It is acceptable for search results to be slightly stale (a table that just got booked might still appear for a second or two), but a booking must only succeed when a table is genuinely free.

Scope and constraints

  • A reservation ties a party size to a start time. The table is held for the restaurant's configured seating duration (e.g., 90 minutes). Two reservations conflict if their windows overlap on the same table.
  • Combining multiple small tables to seat a large party is out of scope for this design.
  • Assume the platform serves thousands of restaurants, with peak total booking attempts in the tens of thousands per minute around popular meal times.

Clarifying questions to consider

Work through these before jumping into your design — they materially affect your choices:

  1. Does a diner pick a specific table, or just a party size and time, leaving table assignment to the restaurant?
  2. How should the system handle the window between a diner starting the checkout flow and actually confirming? (What if they abandon?)
  3. Should popular restaurants be allowed to overbook intentionally, or is capacity always hard?
  4. How do time zones affect availability search and conflict detection?
  5. What notification channels are expected — email, SMS, both?

Describe your design. Cover the data model, how you prevent double-booking under concurrent load, how you keep availability search fast, and how you'd scale the write path for a restaurant that gets a surge of bookings at the same moment (e.g., when a celebrity chef is featured in the press).

Hints

Hint 1

Start by nailing down the conflict rule precisely before anything else: two reservations conflict when their time windows overlap on the same table. Write that as a predicate. Everything else — the lock strategy, the schema, the cache invalidation — flows from that definition.

Hint 2

Separate the read path from the write path. Availability search can be served from a precomputed, slightly stale cache per restaurant. A booking confirmation must go through the authoritative data store with a concurrency guard. Mixing these two paths is where most designs fall apart.

Hint 3

A short-lived hold (say, 5–10 minutes) bridges the gap between a diner viewing availability and completing checkout. Think carefully about what happens when the hold expires, and how you make the confirmation step idempotent so a network retry doesn't create a duplicate booking.