Hotel Reservation

Design a single-chain hotel reservation engine — travelers search date-range availability across properties, place a hold, and confirm a booking without ever overbooking a room type past the chain’s...

00

Practice checkpoints

The requirements are open as a taste. From the numbers onward, the full guide opens in the app.

  1. 01
    Clarify scope
  2. 02
    Requirements + scale
  3. 03
    API + data modelUnlocks in the app
  4. 04
    Draw architectureUnlocks in the app
  5. 05
    Deep diveUnlocks in the app
  6. 06
    Trade-off decisionUnlocks in the app
01

Requirements that shape the design

Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.

Functional requirements

01What does a traveler actually get from search?

Search takes a property, a check-in/check-out range, and a guest count, and returns room types with a total bookable price — availability and rate together, because an open room without a price is not a result anyone can book.

02Are we booking a specific room or a room type?

A room type: the hotel sells one of its 40 Deluxe Queens, not room 312 — inventory is a per-night counter per room type, and the front desk assigns physical rooms at check-in.

03What happens between “book now” and “confirmed”?

Checkout places a hold that reserves the count for every night of the stay for about 10 minutes while payment runs; if payment fails or the guest walks away, the hold expires and the counts return by themselves.

04Can guests cancel or change dates, and does it cost them?

Yes — cancellation is normal business, governed by the rate plan’s free window and fees, and a date change re-validates availability for the new range before the old nights are released.

05Do we ever sell more rooms than physically exist?

Deliberately, yes: each room type carries a configured oversell margin (sell 105 of 100) tuned to historical no-show rates, plus a walk flow — relocate and compensate — for the rare night everyone shows up.

06The confirm call times out and the app retries — two bookings?

No: confirm carries an idempotency key, so any retry of the same attempt maps to the same reservation and a single charge.

Out of scopeMarketplace aggregation over independent supplier hotels (the travel-marketplace variant — here the chain owns its inventory) · Dynamic pricing and revenue-management algorithms (we read the rate plans, we do not compute them) · Loyalty programs, points redemption, and corporate negotiated rates

Non-functional requirements

01How fresh does search availability have to be?

Seconds-stale is acceptable for search — the booking transaction checks the true counters, so a stale cache can only cost an apology at checkout, never an oversell past policy.

02Two guests grab the last room-night at the same instant?

Exactly one succeeds: the decrement is conditional and atomic per night row, so there is no read-then-write gap for two bookings to share the last room.

03A 7-night stay where one middle night is full — partial booking?

Never: all nights of a stay commit in one transaction — all seven counters decrement or none do, because a guest holding nights 1-4 and 6-7 is corrupt data, not a booking.

04How lopsided is read traffic versus write traffic?

Roughly 200 searches for every booking, so reads scale on caches and replicas while writes stay on one small, strongly consistent counter store.

05A confirmed reservation can never vanish?

Correct: a reservation is durable — synchronously replicated SQL — before the guest sees a confirmation number, because a lost booking surfaces as a guest standing in a lobby at midnight.

Keep asking — the interview is a conversation

Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.

  • Single chain that owns its inventory, or a marketplace over independent hotels? I will assume we own it — the marketplace is a different design.
  • Do guests book a room type or a specific room number?
  • Is overbooking a business requirement here, and who owns the margin?
  • What cancellation terms exist — free windows, fees, non-refundable rates?
  • How stale may search availability be before it hurts conversion — seconds or minutes?
01

Unlock the full playbook for Hotel Reservation

Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.

02

Numbers that force architecture decisions

Locked in the app

03

Architecture path

Locked in the app

04

API and data model

Locked in the app

05

Deep dive directions

Locked in the app

+Series

Practice the related series