</> MAANG.io
system design · 301

Advanced

Master system design interviews with scalable architecture patterns, distributed systems, and real-world design challenges.

0/480 solved 0% complete

Section 11: The House That Is Only Itself - Evolution I: From Fungible Rooms to Unique Homes

Executive Summary: The interviewer's final twist changes one assumption — a room type has N interchangeable units, a home has exactly one. The hold, idempotency, the payment saga, the outbox and the staleness contract all survive it: transaction discipline is portable. Everything encoding fungibility breaks: 2.92 billion per-cell rows become 8 million per-listing-year documents (16 GB, 365x fewer objects); availability becomes authored by 5 million hosts, inverting the write profile to 16.5 availability writes/sec against 2.8 booking writes/sec; and overbooking stops being unwise and becomes incoherent.

Fifty-five minutes in, the interviewer puts the marker down and changes the subject.

"Last thing. Suppose we're not selling hotel rooms at all. We're Airbnb — eight million individual homes, each one unique, each calendar owned by a different person. What breaks?"

The temptation is to list differences: reviews, photos, payouts, fees. Resist it — that is product surface. Exactly one assumption changed, and a Staff answer names it first: a room type has N interchangeable units; a home has exactly one. Everything below is downstream of that fact. So derive it — starting, counterintuitively, with what survives.

What Survives, and Why That Is the Headline

Dana now wants one specific two-bedroom in Little Havana, 2026-03-13 through 2026-03-16 — same three nights, same checkout-day discipline. Most of Section 7 applies unchanged:

  • The hold (D5) — durable in the database, TTL enforced in the query predicate. The guest still fills a form for two minutes; the card authorisation still takes its half-second.
  • Idempotency (Section 4) — Dana still double-clicks Confirm, and her client-generated key returns the same confirmation number.
  • The payment saga (D6) — identical: hold first, authorise at confirm, capture asynchronously (at check-in for FLEX-REF), a compensation per step, and a timed-out authorisation resolved by retrying the same PSP key, never guessing.
  • The transactional outbox (Section 7) — the event row commits inside the booking transaction; the relay publishes at-least-once to idempotent consumers.
  • The staleness contract (D7) — search may lag because the booking transaction re-validates against the source of truth. The index may be wrong; the commit may not be.

Key Insight: Transaction discipline is portable; the inventory model is not. What survived describes how a write is made safe; what breaks encoded what is being sold. That is why Section 5 framed the counter as decision D1, with the flip trigger "inventory becomes non-fungible." A candidate who wrote it as a decision walks through this door; one who wrote it as doctrine starts over.

Hotel room type Home listing
Units per cell N interchangeable (30 suites) exactly 1
Model (D1 / D12) counter per (property, type, date) array per (listing, year)
Objects 31M rows chain-wide, 6.2 GB 8M documents, 16 GB (not 2.92B rows)
Availability authored by the booking — derived the host
Dominant write bookings, 28/sec peak calendar edits, 16.5/sec vs 2.8 bookings
"Available" means a counter is positive a predicate over host rules and range
Overbooking tuned allowance (D9) impossible, allowance permanently 0

Quick check before moving on:


Sign in to continue reading

The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.

Sign in to read the full lesson

Sign in to MAANG.io

Use your Google or Microsoft account — no password to remember.

Continue with Google Continue with Microsoft

Please accept the terms above to continue.