← Back to practice catalog

System design interview guide

Airbnb Reservation System Design

TL;DR:

Picture two families who each want the same beach house for the same holiday weekend. Both open the listing, both see the nights as free, and both start typing their card details within a few seconds of each other. The house can only go to one family, so the booking system has to pick a winner and tell the other family the dates are gone before anyone is charged for a stay that cannot happen. The part of the system that does this is called a reservation system, and it is hard because browsing can be slightly out of date while the final booking must never be wrong. A host's calendar imported from another website makes it harder, because it can arrive late and disagree with a stay that is already confirmed.

Overview diagram for Airbnb Reservation System Design

Problem statement

Design the reservation core for a short-term rental marketplace: guests browse dates, set the nights aside for a few minutes (a hold), pay, confirm, cancel, and receive refunds, while hosts keep their calendars in sync. The hard part is that browsing can be slightly out of date, but the final booking step must never give the same night to two guests.

Introduction

The problem: two families, one beach house

Picture two families who both want the same beach house for the same holiday weekend. The first family opens the listing on a laptop and sees that the nights are free. The second family opens the same listing on a phone a few seconds later and sees the same thing. Both pick the dates, both see a price, and both start typing in their card details. The house can only be given to one of them. If the website tells both families “you are confirmed”, the host will have two cars in the driveway on Friday, one family will be turned away after they have already booked flights, and the company will spend money on refunds, a replacement home and an apology.

The part of the system that prevents this is called a reservation system. For every home it keeps track of which nights are free, which nights are being held for someone who is paying right now, which nights belong to a confirmed stay, and which nights the host has blocked. Its whole job is to make sure that each night of each home ends up with at most one confirmed guest, even when many people are trying at the same moment.

A reservation system looks like a calendar with a payment form attached, and that is why interviewers like it. The simple version takes two minutes to describe, and the real version is full of small choices about timing, money and trust. This page walks through those choices in the order you would actually make them: first what we are solving and why, then what the system must do, then how big it is, and only after that the design.

Why teams bother with a reservation system

You have probably used one without thinking about it. You book a hotel room, a rental car, a table at a restaurant or a seat on a train, and the site tells you either “you are confirmed” or “sorry, that was just taken”. Behind that simple message there is a reason the company cares about getting it right.

Trust on both sides. A guest who has planned a trip around a booking must be able to rely on it, and a host who has agreed to a stay must be able to rely on the guest actually having the right to be there. One double booking can lose both of them for good.

Money. A wrong booking costs real money: refunds, moving a guest to another home, paying the host for the trouble, and sometimes legal fees. That cost is far larger than the cost of making the booking step carefully.

Selling every night. A host loses income for every night that stays empty. If nights stay blocked after a guest has wandered away from checkout, or if a host's calendar is wrongly blocked, the home earns less than it could.

Speed for browsing. Millions of people look at calendars for every one person who books. Browsing has to feel instant, or guests leave for a competitor.

These reasons pull in different directions. Browsing wants to be fast and wide, and booking wants to be slow, careful and exact. A good design is mostly the art of keeping these two apart.

What problem are we solving?

A guest picks a home and a range of dates. The system has to answer three things, one after another:

“Are these nights free right now, what will they cost, and if I pay, will they really be mine?”

When the answer is yes, the guest ends up with a confirmed reservation and the nights are marked as theirs. When the answer is no, because someone else got there first, the guest is told clearly, during checkout, that the dates are gone. Later the guest can cancel, and the nights go back to the calendar and the money goes back to the guest according to the host's rules.

To do this the system has to remember, for every home and every night, who owns that night. How to remember that, and how to update it safely when two people act at the same time, is the heart of the problem. We will not guess at it yet. First we need to be clear about what the system must do, and how well, so that every design choice later has a reason behind it.

This page is the interview deep dive in the system design interview guides hub. If the idea of holding something for a few minutes while someone pays is new to you, the vaccine booking guide shows the same pattern with appointment slots.

How to approach

We know what a reservation system is, why teams care, and what success looks like for a guest and a host. In an interview you do not start by drawing boxes. You start by turning a short, vague prompt into a clear contract: what the system must do, how well it must do it, and what is out of scope. Only then do you size the problem, make the design decisions one at a time, and draw the result. The list below is the order this page follows.

How to design a reservation system in an interview

  1. Clarify the problem: whether the whole marketplace is in scope or only booking, whether hosts approve each request or guests book instantly, how payment fits in, and how out of date browsing may be.
  2. Write the functional requirements (what the system does) and the non-functional requirements (how correct, how fast, how big).
  3. Estimate the size: how many homes, how many people browse for each person who books, how many guests race for the same dates, and how long a checkout takes.
  4. Make the design decisions in order: what unit of inventory we store, what browsing reads, how we stop two guests taking the same nights, how long nights are set aside during payment, how the price is fixed, how money and nights move together, what cancelling does, and how a host's outside calendar fits in.
  5. Draw the picture those decisions produce, then walk one booking through it.
  6. Go deeper where the interviewer pushes: the exact race, payment retries, expiring holds, imported calendars, and one production failure.

Clarifying questions (say these in the room)

In a real interview the prompt is only a few words: “Design a reservation system for a rental marketplace.” Before you design anything, ask questions until the problem is clear. Each answer below changes the design, which is why it is worth asking.

You: “Are we designing the whole marketplace, or only the reservation part for homes that are already listed?”

Interviewer: “Only the reservation core: availability, booking, payment, cancellation, and calendar sync.”

That answer keeps reviews, messaging, host sign-up and search ranking out of the main design, so you can spend your time on the part that has to be exactly right: who owns which night.

You: “Does a guest book instantly, or does the host approve every request first?”

Interviewer: “Assume instant book for the main path. You can mention request-to-book as a variant.”

So no human sits between the guest and the confirmation. That matters because it means the system itself must stop two guests from taking the same dates. Host approval is not what will protect the calendar.

You: “Does the guest pay at the instant they click, or do we set the nights aside for a few minutes while the card is being checked?”

Interviewer: “Use a short hold, then confirm. The guest gets a brief checkout window.”

A hold means the nights are set aside for one guest for a short time, so nobody else can take them while that guest pays. This tells you the reservation will move through states such as held, confirmed, expired and cancelled, and that something has to give nights back when a hold runs out.

You: “Can the calendar a guest browses be slightly out of date, as long as the final booking step checks the real calendar?”

Interviewer: “Yes. Browsing can lag, but the final booking must be correct.”

This is the most important answer of the round. It means browsing and booking are two different jobs with two different promises, and you are allowed to make browsing cheap and fast.

You: “Should I include prices, taxes and refunds, or treat those as separate services?”

Interviewer: “Include enough to show that the price is locked during checkout and that payment and refund calls are safe to retry.”

So you do not need to design a full finance platform. You do need to show that the price a guest saw is the price they pay, and that tapping Pay twice does not charge twice.

You: “Roughly how many homes are there, and what does the busiest moment look like?”

Interviewer: “Millions of homes. Browsing is the heavy read. On a holiday weekend or a viral listing, many guests race for the same few nights.”

Those two facts feed the sizing in the next section. They also tell you early that the correctness rule has to work under heavy contention on one home, not only on average.

You: “I want to keep reviews, search ranking, host onboarding, payment processing internals and dispute handling out of scope. Does that match what you want?”

Interviewer: “Yes, focus on the reservation core.”

If the interviewer later asks about ranking, card networks or imported-calendar brands, you do not need to answer yet. Park those until the design decisions, where each one has a natural place.

Functional requirements

Functional requirements describe what the system does. From the answers above, the reservation system must:

  1. Show which nights are free for a home. A guest picks a home and a range of dates and sees whether those nights look available. This answer is for browsing only, and it does not promise anything.
  2. Show a price before the guest pays. The price includes the nightly rates, the cleaning fee, the service fee, taxes and the currency, so the guest knows exactly what will be charged.
  3. Set the nights aside for a short time. When the guest continues to payment, the nights are held for them, so nobody else can take them while the card is being processed.
  4. Confirm exactly one winner. If two guests ask for overlapping nights, only one of them ends up with a confirmed stay, and the other is told clearly and quickly.
  5. Take payment safely. Authorizing the card, charging it and refunding it must each be safe to repeat, so a retry never moves the money twice.
  6. Cancel and refund. A guest can cancel. The nights return to the calendar and the guest receives the refund that the cancellation rule allows.
  7. Let hosts block nights and connect another calendar. A host can mark nights as unavailable, import dates from a calendar on another site, and export this site's bookings out to it.

Non-functional requirements

Non-functional requirements describe how well the system must do its job. They are the numbers and promises that shape the design.

  1. Correctness of nights. At most one confirmed stay may own each night of each home. This is the one rule that must never be broken, even on the busiest weekend of the year.
  2. Fast browsing. Browsing is by far the most common action, so it must feel instant. That is only possible if browsing is allowed to be a little behind the real calendar.
  3. A price that holds still. The price shown at the start of checkout must not change before the card is charged. A guest who accepted one price must not be charged another.
  4. Money moves once. A second tap on Pay, or a retry after a timeout, must never charge or refund twice. A booking without a charge and a charge without a booking are both bad outcomes.
  5. Nights come back. Nights held by someone who walked away from checkout must return to the calendar soon, so hosts do not lose income to abandoned checkouts.
  6. Clear loss. A guest who loses a race should hear it during checkout, in plain words, and not after the money has moved.
  7. Visibility. Support must be able to answer “did this guest own the nights, were they charged, and was the host told?” without reading five different logs.

Out of scope (and why you park these)

Write a short out-of-scope list on the board so the interviewer sees you can bound the problem.

Full marketplace search and ranking. Deciding which homes appear first is a large product by itself. It is enough to say that search takes in availability updates and may be slightly out of date.

Host onboarding, identity checks and reviews. These matter to the business, but they do not change the central rule about nights, so keeping them out lets the round stay on reservation safety.

Building a payment processor. You talk to a payment provider through a clear boundary. The design should explain authorizing, charging and refunding safely, and it does not need to explain how card networks work inside.

Legal dispute handling. Chargebacks and arguments between guests and hosts need their own workflows, but they are not part of the normal booking path unless the interviewer widens the prompt.

That is the requirements stage. If you want to practice it before reading on, try the requirements stage on Practice System Design (about 5–10 minutes), then come back for the sizing and the decisions.

Minute pacing (about 40 minutes)

MinutesFocus
0–5Clarify the problem; write functional and non-functional requirements; agree out of scope
5–12Capacity, then the design decisions and the high-level boxes with one booking story
12–25Detailed design for hold, confirm and cancel, then the exact two-guest race (the deep dive)
25–35Payment retries, expiring holds, imported host calendars, failures, fraud
35–40One production war story and questions

In the room (how you open): “I’d start by agreeing what is in scope, which is the reservation core. Then I’d ask whether guests book instantly or hosts approve, whether nights are held while the guest pays, and whether browsing may lag. I’d also ask how big it is and how hot one popular home can get. I’ll write the requirements on the board, size the problem, and then make the design decisions one at a time, so every box I draw has a reason.”

If you remember one thing: Ask first, write the requirements down, and only then design. Tell one booking story before you name any tables or locks.

Capacity estimation

Now that the requirements are clear, the next step is to find out how big the problem is, because the size decides which parts need strict correctness and which parts need raw speed. The numbers below are rough estimates meant to anchor the whiteboard, and you should say that out loud and tune them in the room.

DimensionIllustrative scale (an estimate)What it means for the design
ListingsMillions worldwideSplit calendar data by home (or by region) into separate pieces called shards, so one popular home never shares a slice with every other home.
Calendar sizeAbout a year or two of nights per home, so on the order of billions of night rowsSmall rows, one per night, are fine. They are cheap to store and easy to reason about.
Availability readsRoughly a hundred or more browses for every booking attemptServe from a cache or search index, then re-check at booking time.
Booking writesPerhaps a thousand reservations a second at the busiest momentsEach one is a short, exact transaction touching a few nights of one home.
Hot datesHoliday weekends and viral homesMany guests will race for the same few night rows on the same home.
Checkout timeA few minutes for a guest to payHolds must expire on their own, or the calendar fills with abandoned checkouts.
PaymentsA slow outside serviceNever keep a database lock open while waiting for the payment provider.
Host calendar syncImports from outside calendars that arrive minutes or hours lateTreat imports as warnings to reconcile, not as the truth.

What the numbers imply

  • Reads and writes have different promises. Browsing answers “what seems free right now?”, while booking answers “did I just take these nights?”. If you make every browse read strongly exact, the product feels slow and costs a lot. If you let the booking step trust a stale browse, the product double-books.
  • Storage is not the problem. Even a few billion night rows at tens of bytes each is on the order of a hundred gigabytes, which spreads easily across those home-sized shards once data is split by home.
  • Contention is local. Two guests only fight over the same home, never over the whole marketplace. So splitting data by home keeps every race inside one shard and one short database step that either fully succeeds or fully rolls back.
  • A hold is a clock. If a thousand holds start each second and each lasts up to ten minutes, up to hundreds of thousands of holds can be alive at once in the worst case. Something has to expire them reliably.
  • Payment latency belongs outside the lock. A payment call can take seconds. If the database locks were open that long on a hot home, everyone else on that home would queue behind a guest who is still typing.

Checkpoint: Which promise does browsing make, which does booking make, and why can they not be the same?

If you remember one thing: Browsing needs speed and can be slightly wrong; booking needs exactness and has to be short.

Design decisions

We now know what the system must do, how correct it must be, and roughly how big it is. Now we choose. Each decision below answers one question that the requirements raised, and each one rules out an easier idea that would not survive the requirements. Read them in order, because every decision builds on the one before it.

Decision 1: What do we store as inventory?

The requirements said that at most one confirmed stay may own each night. Before anything else we need to decide what exactly the system keeps track of. The simplest idea is to keep a list of reservations, each with a check-in date and a check-out date, and to answer “is this free?” by asking whether any existing reservation overlaps the new dates.

That works for one person using the system at a time. It breaks as soon as two guests act together. Both guests ask “does anything overlap?”, and both are told no, because neither reservation has been written yet. Then both write. There was no single thing in the database that the two of them were fighting over, so nothing could say “only one of you may go first”.

There are three ways to give the system something to protect.

  • One row per night of each home. The calendar has a row for July 4, a row for July 5, and so on, each marked free, held, booked or blocked. A stay from July 4 to July 7 must take three specific rows, so two overlapping stays must fight over at least one row.
  • A date range with a rule that rejects overlap. Some databases can refuse two overlapping ranges for the same home directly. It is elegant, but it is harder to split across many machines and harder to explain on a whiteboard.
  • A count of free units per night. For a hotel with thirty identical rooms, each night keeps a number of rooms left, and the rule is that the number must never go below zero.

For a single home, one row per night is the clearest choice, so we choose it. A date range uses half-open dates, meaning the check-in night is included and the check-out day is not. A stay from July 4 to July 7 owns the nights of July 4, 5 and 6, and the guest leaves on the 7th, so the next guest can arrive on the 7th without a conflict. The comparison table for the three models is in Core design approaches below.

Decision 2: What does browsing read?

The requirements asked for fast browsing, and the sizing showed that browsing outnumbers booking by something like a hundred to one. The simplest idea is to let browsing read the same night rows that booking uses, so there is only one source of truth.

That is correct, but it spends the most precious resource on the least important question. The main calendar database has to handle the exact, careful, short transactions that decide who owns a night. If every browse also reads from it, a busy weekend of browsing slows down the very bookings that must stay exact. And it is wasted effort, because a browsing answer is only a hint. The guest will not own the nights because the page said they were free.

So we split the two jobs. Browsing reads from a cache or a search index, a copy of the calendar that is updated shortly after every booking or cancellation. It is allowed to lag by a short time. The booking step never trusts that copy. It always re-checks the real calendar. The cost is that a guest may occasionally see a date as free and then be told at booking time that it was just taken. That is a better outcome than slowing every browse, and it is the reason the interviewer agreed that “browsing can lag”.

Decision 3: How do we stop two guests taking the same nights?

Decision 1 gave us night rows, so there is now something for two guests to fight over. The question is how the system makes sure only one of them wins. The simplest idea is “check, then write”: read the nights, see that they are free, and then mark them booked. We saw in Decision 1 why that fails. Between the check and the write, another request can do the same thing, and both end up believing they won.

The fix is to make the check and the write one indivisible step on the real calendar. The booking service opens a short database transaction, takes a lock on every night row in the requested range, looks at them while holding the lock, and only if all of them are free does it mark them held for this guest and commit. The second guest's transaction has to wait for the first to finish, and when it finally looks, the nights are no longer free, so it is rolled back and the guest gets a clear “these dates were just taken” answer. This directly satisfies the requirement that at most one stay owns a night, and it gives the losing guest a clear answer during checkout.

Other ways were considered and set aside. Locking the whole home for every booking is simple, but it would make a home with many different date ranges wait behind unrelated requests. A lock kept in the application server's memory fails the moment there is more than one server. A lock in a separate lock service adds an extra network hop and a new thing that can fail, when the database that owns the rows can already do the job. The exact walk-through of this step, including what the database does when two guests arrive at once, is in the deep dive.

Decision 4: How long do we set the nights aside while the guest pays?

Winning the nights does not mean the guest has paid yet. Typing a card number and passing bank checks takes a few minutes, and the requirements said that other guests must not be able to take the nights during that time. The simplest idea is to mark the nights as booked the moment the guest wins them, and to give them back only if payment fails.

The trouble is the guest who simply closes the tab. Nothing fails, and nothing succeeds, so nobody ever gives those nights back. The host loses income, and other guests see the home as unavailable for no reason. That breaks the requirement that nights come back.

So the nights are first marked as held, and a hold carries a deadline called held_until. A hold lasts a short time, for example ten minutes (a product choice, not a law), and it ends in one of two ways. If payment completes before the deadline, the hold becomes a confirmed booking. If the deadline passes, the nights go back to free. Two safeguards keep this honest. A background sweeper job releases expired holds. And the booking step also checks the deadline itself, so a hold that has expired is treated as free even if the sweeper has not caught up yet. The hold length is a real tradeoff: a longer hold gives guests more time and fewer failed checkouts, while a shorter hold keeps nights available for others. Choose a number, measure how many holds expire, and say that you would tune it.

Decision 5: How do we keep the price the same while the guest pays?

The guest was shown a price when they chose their dates, and the requirements say that this price must not change before the card is charged. The simplest idea is to compute the price again at the moment of payment. It sounds fine, until a host changes the weekend rate, a tax rule updates, or a discount ends while the guest is typing their card number. The guest agreed to one amount and would be charged another.

So when the guest asks for a price, the pricing service creates a quote: a saved record with the nightly rates, cleaning fee, service fee, taxes, currency, a version number and an expiry time. The quote gets an id. The hold stores that quote id, and the confirm step charges the amount from the quote, not a fresh calculation. If the quote has expired by the time the guest pays, the system does not guess. It returns a clear error and asks the guest to refresh the price. If the pricing service is down, checkout stops rather than inventing taxes and fees.

Decision 6: In what order do money and nights move together?

Inventory and money now both have to change, and there are two ways to get the order wrong. If the system charges the card before it owns the nights, it can take money from a guest who then loses the race, and refunds follow. If it marks the nights booked before the money is safe, it can give a stay to someone whose card then fails. The requirements say that a booking without a charge and a charge without a booking are both bad.

So the order is fixed. First, the guest wins a hold on the nights (Decision 3), which stops everyone else. Second, the system asks the payment provider to authorize the card, which means “check the card and set the money aside, but do not take it yet”. Third, once the authorization is good and the hold is still alive, the system captures the money, which means “now take it”, and marks the reservation confirmed. If capture fails clearly, the hold is released.

There is one more problem: networks fail halfway. A request to the provider can time out after the provider has already done the work, and the app will want to retry. If the retry makes a second authorization or a second charge, the guest pays twice. The answer is an idempotency key, a unique id sent with each request so that the receiver can tell “this is the same request again” and return the same result instead of repeating the work. The booking system uses one for the reservation request itself, and a separate one for each money call: authorize, capture and refund. We also never keep a database lock open while waiting for the provider, because the hold already protects the nights. Everything that is not part of the promise, such as emails, search updates and host calendar exports, happens after the booking is saved, from a list of pending messages called an outbox, so a slow email can never make a booking fail.

Decision 7: What does cancelling do?

A cancellation has to do two jobs that must stay in step: give the nights back and give the money back. The simplest idea is to delete the reservation. That loses the record support needs, ignores the host's cancellation rules, and can leave money unrefunded or refunded twice.

So cancelling is a state change, not a deletion. The reservation moves from confirmed to cancelled in one transaction that also frees the nights. The booking service reads the cancellation rule that applied to this reservation, works out how much to refund, and writes a refund request with its own idempotency key into the outbox. The refund is sent to the payment provider after the transaction commits. That order matters: the nights must not show as free while the reservation still says confirmed, and a retried refund request must not create a second refund.

Decision 8: How does a host's outside calendar fit in?

Many hosts also list the same home on other websites, so they bring in dates from that calendar and send this site's bookings out to it. The simplest idea is to treat the outside calendar as the truth and copy its blocks straight into our night rows. That is risky, because outside calendars are slow and lossy. A block might arrive hours after the other site booked the dates, and it might overlap a stay that this site has already confirmed.

So imports are advice, not commands. A block from the outside calendar can mark future free nights as unavailable, which is safe. If the block overlaps a stay that is already confirmed here, the system keeps the confirmed stay, records a conflict, warns the host, and stops selling any future overlapping nights until the host resolves it. Exports to other calendars go through the same outbox as emails, after the booking is saved. The confirmed booking in our own database is always the stronger truth.

Putting the decisions together

Taken together, the eight decisions are the design. The calendar holds one row per night of each home. Browsing reads a lagging copy, and booking always re-checks the real calendar in a short locked transaction. A winner gets a hold with a deadline and a locked quote. Payment is authorized and then captured with idempotency keys, never while a database lock is open. Cancelling is a state change that returns the nights and sends a safe refund. Outside calendars can block future nights, but they cannot cancel a confirmed stay.

In the room (a fuller opening you can actually say): “I’d keep one row per night of each home as the source of truth, and let browsing read a cache that may be slightly stale, because the booking step re-checks the real calendar. At booking time I’d open a short transaction, lock the rows for the requested nights, and if all of them are free I’d create a hold with a deadline and store the price quote on it. The second guest racing for the same nights waits, then finds them taken and gets a clear conflict. After the hold exists I’d authorize the card with an idempotency key, never holding a database lock while waiting for the provider, then capture and confirm. Emails, search updates and calendar exports run from an outbox after the booking is saved. Cancelling is a state change that frees the nights and sends one idempotent refund. Imported calendars can block future nights, but they never cancel a confirmed stay.”

The next section draws these decisions as one picture and shows who owns what.

High-level architecture

The decisions above were made one at a time. This section puts them on one page as a picture: which boxes exist, who owns what, and how one booking travels through them. The deeper mechanics come later, so keep this at the level of a map.

A good high-level design separates the parts that answer quickly from the parts that own money and inventory. The guest-facing API coordinates the journey, but the calendar owns the rule that one night cannot be sold twice.

The calendar service stores the trusted night rows for each home — the copy that decides ownership. It knows whether a night is free, held, booked, blocked by the host, or marked unavailable by an outside calendar. The booking service tracks each reservation through its states, from held to confirmed to cancelled. The pricing service returns a quote with rates, taxes, fees and an expiry time. The payment adapter talks to the payment provider and makes authorize, capture and refund calls safe to retry. The outbox and workers handle the follow-up work after a booking is saved: they keep a short list of pending messages (the outbox) and send emails, update search, and export calendar changes once the booking itself is already true.

[ Guest app ]
     |
     v
[ Reservation API ] ---- quote ----> [ Pricing / tax service ]
     |
     | reserve / confirm / cancel
     v
[ Booking service ] ---- authoritative writes ----> [ Calendar DB ]
     |                                           (listing-night inventory)
     |
     +---- authorize / capture / refund ----> [ Payment provider ]
     |
     +---- outbox after commit ----> [ Email ] [ Search index ] [ Host calendar export ]

[ Host calendar import ] ---- reconcile ----> [ Calendar service ]

In the room: Draw the synchronous path first: guest to reservation API to booking service to calendar database. Then draw payment as a provider call around the hold and confirm states, and draw email, search and calendar sync as asynchronous work after the booking is saved. This order tells the interviewer you know which parts are allowed to lag.

Follow-ups the interviewer may ask

After you draw the boxes, interviewers often poke at ownership and timing before they go deep on locks. Short answers:

Interviewer: “Why not let browsing read the calendar database directly, so there is one source of truth?”

You: “Browsing outnumbers booking by a large factor, and it only needs a hint. I would keep the primary for the exact, short booking transactions and let browsing read a cache or index that updates after each booking or cancellation. The booking step re-checks the real nights, so a stale browse is never a wrong booking.”

Interviewer: “Where does the payment call sit relative to the calendar transaction?”

You: “After it. The transaction creates the hold and commits. Then I call the provider with an idempotency key. I never keep database locks open while waiting on a slow outside service, because on a hot home that would make every other guest wait behind someone still typing.”

Interviewer: “What if the email or the search update fails after the booking succeeds?”

You: “The booking is already true, so that is not a failure of the booking. Those side effects come from an outbox written in the same transaction, and workers retry them until they succeed.”

Core design approaches

Decision 1 chose one row per night. This section lays the three models side by side so you can say why, and so you know when the answer would change. Pick one and explain why.

ApproachPlain ideaGood whenWatch out
One row per listing-nightStore each night as free, held, booked or blockedMost short-term rental interviewsA date range becomes many row locks, but the model is easy to reason about.
Range reservation with an exclusion ruleStore date intervals and let the database reject overlapStrong when the database supports range constraintsHarder to split across machines and harder to explain quickly.
Count per listing-nightStore remaining_units for hotel-like inventoryHotels, room types, or shared poolsThe count must never be allowed to go below zero.

For an Airbnb-style single home, one row per listing-night is usually the clearest interview answer. A request for July 4 to July 7 claims the nights of July 4, July 5 and July 6. The booking transaction locks those rows, verifies that none is held, booked or blocked, and then writes the hold. For a room type with 30 identical rooms, the same table can store remaining_units instead of a single booked bit, and the rule becomes “the count must not drop below zero”.

For the product flow, use hold, then confirm. A hold gives the guest a few minutes to pay without letting another guest take the same nights. It also creates a clock that you must operate. If payment never completes, the hold expires and the nights return to the calendar. If payment succeeds, the reservation moves to confirmed.

Data model

The design decisions told us what to keep, so the next question is what exactly gets stored. The data model should make the central rule obvious: if you cannot point to the row that prevents two stays from overlapping, the design is not finished.

RecordImportant fieldsWhy it exists
listinglisting_id, host, timezone, statusDates are interpreted in the home's local time, not the guest's device time.
listing_nightlisting_id, night_date, state, reservation_id, held_until, sourceThe authoritative inventory row for each sellable night.
reservationreservation_id, guest, listing, check-in, check-out, status, quote idThe booking the guest sees, and its state machine.
quotenightly rates, fees, taxes, currency, expires_at, versionFreezes the price the guest accepted during the hold.
payment_intentprovider id, idempotency key, auth status, capture statusConnects money movement to a reservation without a double charge.
refundrefund id, amount, reason, provider id, idempotency keyMakes cancellations and provider retries auditable.
calendar_sync_eventsource, external uid, range, status, conflict reasonTracks imports and exports for host calendars.
outbox_eventevent type, payload id, created_at, processed_atMoves email, search and calendar side effects to after the booking is saved.

Use half-open date ranges: [check_in, check_out). A stay from July 4 to July 7 owns the nights of July 4, July 5 and July 6, and checkout happens on July 7. Saying this out loud avoids timezone and off-by-one mistakes. Also say that the nights are always read in the home's own timezone, because “July 4” starts at a different moment for a guest in another country.

Detailed design

We now know what is stored and who owns it, so we can put the pieces in motion. This section follows one booking from the moment a guest looks at a calendar until the stay is confirmed, and then follows a cancellation. Then it shows the same thing from the caller's side: the calls a client makes and the answers it receives. Read it once as a story. The exact race, the retries and the host calendar come in the deep dive right after it.

The reservation journey has four moments the guest can see: browsing dates, placing a hold, paying to confirm, and possibly cancelling later. Each moment should leave the system in a state that support can explain. The order matters because inventory and money are both involved, and neither should pretend the other succeeded before it actually did.

When a guest checks availability, the API can read from a fast availability index or a short-lived cache. That read is for browsing only. It helps the guest choose dates, but it does not create a right to those dates. The response should avoid language such as “guaranteed available”, because another guest may be holding or booking the same nights a moment later. If a price is requested, the API asks the pricing service for a quote and returns a quote id with an expiry. The quote stores nightly rates, cleaning fees, taxes, service fees and currency, so the amount does not drift while the guest is filling in payment details.

When the guest taps reserve or continue to payment, the booking service starts a short transaction on the real calendar. It loads the quote and verifies that it has not expired. It locks the listing_night rows for every night in the half-open range. If any night is already held by another active hold, booked by a confirmed reservation, or blocked by the host, the service rolls back and returns a 409 conflict with copy such as “These dates were just taken.” If all nights are free, the service writes a reservation row in the HELD state, marks the nights as held for that reservation, sets held_until, stores the idempotency key for this reserve request, commits, and returns what the client needs to start payment.

Only after the hold exists should the payment step run. The payment adapter authorizes the card with an idempotency key based on the reservation id and the payment attempt. If the network times out after the provider accepted the authorization, a retry must ask for the same authorization result and not create a second hold on the guest's card. The API should not keep database locks open while waiting for the provider. The hold is already the inventory protection.

Confirmation is another short database step. The booking service verifies that the reservation is still in HELD, the hold has not expired, and the payment authorization is valid. It captures the payment, or records a provider capture result using the same idempotent payment intent. Then it moves the reservation to CONFIRMED, marks the nights booked, and writes outbox events for the guest email, the host email, the search-index update and the calendar export. If capture fails in a clear and final way, the system releases the hold and tells the guest that payment failed. If the provider result is unclear, the reservation may sit in a short PAYMENT_PENDING state while a reconciliation job asks the provider what really happened.

Cancellation follows the same discipline. The booking service checks the cancellation policy for the reservation, computes the refund amount, and moves the reservation to CANCELLED in a transaction that releases the nights back to the calendar. It writes a refund command with an idempotency key and sends it to the payment provider after the transaction commits. That order matters: the app should not show the nights as free while the reservation still says confirmed, and provider retries should not create multiple refunds.

Host calendar sync is slower and less trusted than the booking path. Imports from other calendars create outside blocks or conflict records. If an imported block overlaps an already confirmed reservation from this system, the system does not delete the reservation. It keeps the confirmed booking, marks the sync event as a conflict, alerts the host, and stops selling future overlapping dates until the host resolves the mismatch. Exports to outside calendars happen through the outbox after a booking or cancellation commits.

  1. Browse from a cache or search index; that answer is only a hint about what looks free.
  2. Ask the pricing service for a quote and keep its id so the price stays fixed while the guest pays.
  3. Open a short database transaction, lock the night rows, create a held reservation with a deadline, and commit.
  4. Authorize the card with an idempotency key (a unique id so a retry returns the same result), without holding any database lock open.
  5. Confirm by checking the hold is still alive, capturing payment, marking nights booked, and writing outbox events for email and search.
  6. On cancel, free the nights and write a refund request in one transaction, then send the refund after that commit.

In the room recap: “Browsing is a hint. Reserve locks the live night rows and creates a short hold. Payment authorization is idempotent and does not keep database locks open. Confirm captures payment, marks nights booked, and writes outbox events after the booking is saved. Cancel releases nights and sends one idempotent refund. Calendar sync can lag, but it cannot silently override confirmed reservations.”

API design: what the client calls and what it gets back

This system is mostly behavior behind a few calls, so the API design covers three things: the calls a guest app makes, what the server answers, and the small admin and host surface.

The calls.

EndpointRole
GET /v1/listings/{listing_id}/availability?from=&to=Browse availability for home-local dates. This reads a cache or index.
POST /v1/listings/{listing_id}/quotesCompute and freeze the price, taxes and fees for a short time.
POST /v1/reservationsCreate a hold for a date range, with an idempotency key.
POST /v1/reservations/{reservation_id}:confirmConfirm after payment authorization, capturing the money.
POST /v1/reservations/{reservation_id}:cancelCancel and start the refund flow.
POST /v1/calendar-imports/{source}:syncImport a host's outside blocks and detect conflicts.

POST /v1/reservations should include listing_id, check_in, check_out, guest_count, quote_id and idempotency_key. The dates are home-local dates, and the range is half-open. The server, not the client, expands that range into nights and locks them. If the same idempotency_key arrives again, the server returns the same reservation instead of creating a second one.

GET availability -> may read cache or index
POST quote       -> freezes price for a short window
POST reservation -> live calendar transaction creates HELD
POST confirm     -> payment capture + CONFIRMED + outbox

What the client receives. A successful reserve returns the reservation id, its state (HELD), the held_until deadline so the app can show a countdown, and the locked quote. A successful confirm returns the reservation in the CONFIRMED state. A cancel returns the new state and the refund amount that will be sent.

Which status code means what.

CodeMeaningWhat the guest app does
409These dates are no longer availableTell the guest and let them pick new dates.
410The hold expired before payment finishedStart again; the nights may now belong to someone else.
402Payment failedRelease the hold and offer another card.
422The quote expired or does not match the policyRefresh the price and ask the guest to accept it again.
429Too many attempts (abuse or bot protection)Slow down and retry later.

What hosts and operators change. Hosts block or unblock nights and connect or disconnect an outside calendar through a small host API. Operators can cancel or refund on a guest's behalf through an admin API, and every admin action writes an audit record, because a bad admin action can do the same damage as a race condition.

Deep dive: the questions an interviewer asks next

You have drawn the design and walked one booking through it. This is the point where a good interviewer starts digging, and the questions usually come in a fairly predictable order, because each answer raises the next one. Read this section as that conversation. Each question is followed by an answer you can give, plus a hint of where the interviewer is likely to go next. If the next answer is already clear to you, you can say it before they ask.

“You said booking locks the nights. What goes wrong without that, and what does it look like?”

Start with the weak design, which is the one most people sketch first. It reads the calendar, sees that the night is free, and inserts a reservation a moment later. Between those two steps another request can do exactly the same thing. Both users passed the check, because the check was not the lock.

Bad design

Guest A: read July 4 free
Guest B: read July 4 free
Guest A: insert reservation and charge
Guest B: insert reservation and charge
Result: two guests, one home

The safer design makes the write path own the truth. The booking transaction locks every night in the requested range and changes them together. If the database uses one row per night, the transaction locks those rows. If it uses a table of reserved nights, a uniqueness rule on (listing_id, night_date) for active reservations rejects the second writer. Either way, the second request gets a 409 before any money is captured.

Great design

BEGIN
  load quote and check expiry
  lock listing_night rows for [check_in, check_out)
  if any active hold/book/block exists -> ROLLBACK + 409
  create HELD reservation
  mark nights held with held_until
COMMIT
then authorize payment with idempotency key

Two guests race for the same listing-night; the calendar transaction lets one hold win and returns conflict to the other

To see the race closed, imagine one free night and two requests that reach the database in the same millisecond. The database lets guest A's transaction take the lock first. A marks the night held and commits. Only then is guest B's transaction allowed to look at the row, and it now sees “held by reservation A”, so it rolls back and returns 409. Neither request could see the other's half-finished work, because there was no half-finished work to see.

Where it goes next: the interviewer will probably ask how this behaves when the range covers several nights, and what happens if the rows are locked in different orders.

“A stay covers several nights. What stops two overlapping stays from getting stuck waiting on each other?”

Take two stays on the same home: A wants July 4 to July 7 (nights 4, 5, 6) and B wants July 6 to July 9 (nights 6, 7, 8). They overlap on July 6. Each transaction must lock its own set of rows, and a deadlock appears if A locks night 6 first while B has locked night 7, and then each waits for a row the other holds. The standard fix is to always lock the rows in the same order, for example by ascending date. Then whichever transaction reaches night 6 first wins it, and the other waits at the row and never holds anything that the first needs.

It also helps to say how stays that only touch at the edge behave. A stay from July 4 to July 7 and one from July 7 to July 9 do not conflict, because the first owns nights 4, 5 and 6, and the second owns nights 7 and 8. That is the half-open range doing its job. If your calendar creates night rows lazily instead of ahead of time, say that you rely on the uniqueness rule on (listing_id, night_date) to reject the second insert, because you cannot lock a row that does not exist yet.

Where it goes next: “What if a guest just taps Pay twice, or the app retries after a timeout?”

“The guest double-taps, or the phone retries after a timeout. What stops two reservations?”

The reserve request carries an idempotency key. The server saves that key on the reservation in the same transaction that creates it, and it has a uniqueness rule on it. If the same key arrives again, the server finds the existing reservation and returns it instead of locking nights a second time. Without this, the second tap would find the nights held by the first tap's own hold and report a confusing conflict to the very same guest.

Payment needs its own protection, and it is separate. Each call to the provider gets a key built from the reservation id and the payment attempt. If a retry reaches the provider, the provider recognizes the key and returns the first result. Both layers are needed: payment idempotency alone would stop a double charge but would still let the inventory be taken twice, and inventory idempotency alone would stop a double hold but would not stop a double charge.

Where it goes next: “What if the provider took the money but your API timed out before you saw the answer?”

“The provider captured the money, but your API timed out before the client saw success. What now?”

This is the case where the booking system does not know the truth. The reservation sits in PAYMENT_PENDING, and the guest must not be charged again by a blind retry. A reconciliation job asks the provider, by the same payment intent and idempotency key, what actually happened. If the provider says the money was captured and the hold is still valid, the job finishes the confirmation. If the provider says nothing was captured, the job releases the hold or lets the guest try again. If the money was captured but the hold has already expired and someone else owns the nights, the job refunds the guest and sends them an apology message.

The rule to say out loud is: when unsure whether inventory is free, do not confirm, and when unsure whether money moved, ask the provider before moving it again.

Where it goes next: “And what if the hold itself expires while the guest is still paying?”

“What if the hold expires while the guest is in the middle of paying?”

The booking step never trusts that a sweeper has already cleaned things up. When the guest confirms, the service re-checks held_until as part of the same transaction that changes the state. If the deadline has passed, the confirm is refused with a 410, and any authorization that succeeded in the meantime is voided. The sweeper's job is only to release the nights in bulk and keep the calendar tidy, and a reader of the calendar treats a hold past its deadline as free even before the sweeper runs.

A subtle detail is that the guest may have a successful card authorization at the moment the hold expires. That is why confirm checks both things together: the hold must be alive and the authorization must be valid. If either is false, the system voids the authorization instead of capturing it.

Where it goes next: the interviewer may move away from the guest and ask about the host's other calendar.

“A host's outside calendar says the weekend is blocked, but we already confirmed a guest. What do you do?”

Do not delete the guest. Outside calendars are delayed and often lossy, so the import is treated as data to reconcile, not as an order. The confirmed booking in the reservation database stays. The sync event is marked as a conflict, the host gets a clear warning, and future overlapping nights stop being sold until the host resolves the mismatch, for example by cancelling on the other site or contacting the guest. The import may still block nights that are free, because that is safe and prevents a future double booking.

Where it goes next: “What breaks first when one listing goes viral?”

“One home goes viral and thousands of guests try the same weekend. What breaks first?”

All of those requests have to go through the same few night rows, so those rows are the bottleneck, and the transaction that holds the lock is the thing to protect. Keep it short: lock, check, update, commit, and nothing else inside it. No payment calls, no emails, no network waits. The losing guests are rejected quickly with a 409 and do not pile up, which is also the best experience for them. Because data is split by home, one hot home affects only its own shard, and the rest of the marketplace stays healthy. You can add a small queue or a rate limit in front of hold creation for that home if the number of attempts becomes abusive, and a cheap “already held” check on the cache can turn away obviously doomed attempts before they reach the database.

Where it goes next: “And a hotel with thirty identical rooms?” For that, replace the booked bit with a remaining_units count per night, and make the rule that a conditional update only succeeds while the count is above zero.

Say it in the interview: “One short transaction on the authoritative calendar locks the rows in a fixed order, checks for conflicts, creates a hold with a deadline, and commits. Payment happens after that with idempotency keys and never inside a lock. Expired holds are rechecked at confirm time and swept in the background. The cost is that browsing may show a date that is gone, and I accept that and measure it.”

Scale and failure details live in Scaling the system and Failure handling. What to watch is in Observability.

If you remember one thing: The deep dive is a conversation. Check-then-insert is the red flag, one locked transaction on the real calendar is the fix, and each answer is something you could have said before they asked.

Key challenges

The deep dive showed that the core step is simple once it is one short transaction. What makes the real system hard is everything around that step, and a handful of hard parts show up again and again. Name them early in the interview, because each one is a place the interviewer is likely to push.

ChallengeWhat goes wrong if ignoredStrong answer
Availability vs bookingA guest sees “available” and assumes it is reservedSay browsing can be stale; booking re-checks and locks.
Overlapping date rangesTwo reservations share a nightLock the night rows in a fixed order, or use a database rule that rejects overlap.
Hold expiryThe calendar stays blocked after an abandoned checkoutA sweeper releases expired holds, and confirm re-checks the deadline itself.
Payment retryDouble charge, or a charge without a bookingIdempotency keys and reconciliation by reservation id.
Pricing changesA guest accepts one price but pays anotherStore a quote id and version on the hold.
Calendar sync lagA host's calendar disagrees with a guest's confirmationThe booking database is the source of truth; imports create conflict records.
Fraud reviewRisk checks hold nights foreverShort risk window, an explicit pending state, and release on timeout.

If you remember one thing: Stale browsing, expiring holds and payment retries are design requirements, not production surprises.

Scaling the system

Those hard parts get worse as traffic grows, so the next question is what happens when the number of homes and guests multiplies. You do not have to wait for the interviewer to ask. Right after you finish the design, say the scaling story yourself, then be ready for the follow-ups.

What you can say upfront: “I would split the calendar by home, because two guests only ever fight over the same home, so each fight stays inside one shard and one short transaction. Browsing reads a cache or index that is updated after each booking, and I would measure how often a guest sees a date as free and then loses it. Booking stays on the primary for that home, with transactions kept short and no outside calls inside them. For many regions, each home gets a home region and its booking writes go to that one place, so two regions can never confirm the same night. A viral home makes one shard hot, which I would accept, because it is better for one listing to be hot than for every popular listing to fight over one global table.”

That one paragraph answers most of what follows. Here are the follow-ups, in the order they usually come.

Interviewer: “Traffic doubles next quarter. What do you change?”

You: “Browsing first, because it is the heavy half. It reads copies, so I add more cache and index capacity and nothing about correctness changes. Then I check the booking side: shard sizes, transaction time and the busiest homes. If the shards have headroom, nothing changes there either.”

Interviewer: “How do you shard the calendar, and why by home?”

You: “By listing id, or by region and then listing id. A booking only touches the nights of one home, so every transaction stays on one shard and never needs a cross-shard commit. That is what lets the exactness rule stay simple.”

Interviewer: “Your search shows a date as free and the guest loses it at booking. How bad is that?”

You: “That is the price of fast browsing, so I would measure it with a number such as conflict_after_search_available: how often a guest saw available and then lost at reserve. If it is low, the cache freshness is fine. If it climbs, I speed up the updates from booking and cancellation into the index, or I mark very popular dates as ‘likely to go’ in the user interface. I would not make every browse read the primary.”

Interviewer: “What about running in more than one region?”

You: “I would not pretend a single global active-active calendar is easy. Most homes have a home region, and booking writes for that home go to its home region, or to one primary owner. Search data can be read globally, but two regions must never confirm the same night independently.”

If you remember one thing: Scale by splitting data by home and keeping the booking transaction short; scale browsing with copies that are allowed to lag.

Failure handling

Scaling answers “what if there is more traffic”. This section answers “what if something breaks”. Again, say it first. Failures here come from the payment provider, from the database, from background workers and from outside calendars, and what impresses an interviewer is that the answer was decided before the failure happened.

What you can say upfront: “Every failure has a decision made in advance. If the payment provider is slow, the reservation stays in a short pending state and a reconciliation job asks the provider what happened, so no one is charged twice and no one is charged without a booking. If the database fails over during a reserve, the idempotency key lets the guest's retry return the same reservation. If a worker crashes after a confirm, the outbox retries the side effects. If the sweeper falls behind, confirm still checks the hold deadline itself. And the guiding rule is: when we are not sure the nights are free, we do not confirm, and when we are not sure money moved, we ask before moving it again.”

The follow-ups are about the details of those decisions.

Interviewer: “The payment provider times out. What does the guest see?”

You: “They see a short ‘processing’ state, and their bank may show a pending authorization. The reservation stays in a pending state, and a reconciliation job asks the provider about that payment intent and either confirms, voids or releases the hold. I never fire a new charge blindly.”

Interviewer: “The database fails over in the middle of a reserve. What happened to the booking?”

You: “The guest may not have seen an answer, so they retry. Because the reserve carried an idempotency key stored in the same transaction, the retry either finds the reservation that did commit and returns it, or finds nothing and creates it cleanly. They never end up with two holds on the same nights.”

Interviewer: “A worker crashes right after a confirm. The booking exists, but the guest got no email.”

You: “The booking is true, so nothing about the nights or the money is wrong. The email, the search update and the calendar export are all rows in the outbox written in the same transaction as the confirm, so workers retry them until each one is processed. I alert on how old the oldest unprocessed outbox row is.”

Interviewer: “The sweeper that releases expired holds is down. What happens?”

You: “Dates would look unavailable longer than we promised, which costs hosts income but breaks no one's booking. Calendar reads and confirm both treat a hold past its deadline as free, so most of the damage is avoided, and I alert on holds that are older than their allowed window.”

Interviewer: “The pricing service is down. Do you still let guests check out?”

You: “No. Checkout fails closed, because I would not invent taxes and fees. A guest can still browse. I would rather turn away a checkout for a few minutes than charge a wrong amount.”

FailureWhat the guest or host experiencesWhat to build
Payment provider timeoutA “processing” screen; the bank may show a pending authorizationReconcile by payment intent; confirm, void or release the hold.
Database failover during a reserveThe guest retries after a timeoutThe idempotency key returns the same reservation if the commit happened.
Worker crash after confirmBooking exists, but the email or search update is lateOutbox retries side effects until processed.
Hold sweeper delayedDates look unavailable longer than promisedTreat expired holds as free on read; alert on expired holds still blocking.
Calendar import conflictThe host says another platform already booked itA conflict record and host alert, and no deletion of the confirmed booking.
Pricing service unavailableThe guest cannot get a final checkout amountFail closed for checkout; never invent taxes or fees.

If you remember one thing: If the system is unsure whether the nights are free, it does not confirm; if it is unsure whether money moved, it reconciles before charging again.

Observability (what you measure)

Failure handling decides what to do when something breaks. Observability is how you notice the break in the first place, and a raw request success rate alone will not tell you. Watch the whole journey, from browse to confirmed to refunded, and make sure support can answer ownership and money questions quickly.

SignalWhy it matters
reserve.conflict_rate by listing and dateSeparates healthy contention from stale search or bugs.
Expired holds still blocking nightsFinds abandoned inventory and broken sweepers.
Payment authorization-to-confirm lagFinds money in limbo before support does.
Quote mismatch and expired quote rateShows whether the quote lifetime is too short or a pricing deploy is unstable.
Calendar sync conflicts by sourceIdentifies unreliable channel managers or host setup issues.
Outbox age for search and emailConfirms side effects are not stuck after a booking.
Refund retries and duplicate refund attemptsProtects finance correctness.

Dashboards should answer a support question: “Did this guest own the nights, did we charge them, and did we tell the host?” If the answer needs five logs and guesswork, the design is missing traceability. One alert should never be silent: two active reservations owning the same night must page someone immediately.

Security and abuse

Measuring health is not enough if someone can still lock calendars for free. A reservation system also needs to be hard to abuse, because a bot that creates short holds can block nights without paying a cent. Require guests to sign in before creating holds, so anonymous bots cannot block calendars. Limit how many holds one user, device, network address or listing can create in a short window, especially on high-demand dates. Score risk for suspicious payment methods, impossible travel patterns, repeated holds that never confirm, and accounts that try to lock many homes at once. Risk checks should have a time budget. If a review needs hours, do not keep public inventory blocked unless the product explicitly chooses that cost.

Protect payment and tax data. Keep card data inside the payment provider boundary, store provider tokens rather than raw card details, and avoid logging full billing addresses or tax identifiers. Host calendar links can leak availability, so treat imported calendar links as secrets. Admin tools that change calendars or refunds need audit logs, because a bad admin action can create the same damage as a race condition.

Cost awareness

Every choice so far also has a price, and interviewers like to hear that you noticed. The expensive part is not only servers. A double booking creates refunds, relocation support, host compensation, bad reviews and sometimes legal work, which is why exactness at booking time is worth more than shaving a few milliseconds with unsafe cached writes.

At the same time, making every browse hit the primary calendar is wasteful. Use a cache and an index for browsing, then pay the cost of a short transaction only when the guest tries to reserve. Holds also have a cost: long holds raise conversion but hide nights from other guests. Payment authorization fees, text messages and email, tax calculations and fraud reviews all add cost, so move them off the critical path where correctness allows.

Green Dashboard. Angry Users. The Production Mindset System Design Interviews Expect.

Everything so far describes how the reservation system should work on a good day. This section is about what happens on a bad day, told as short stories from the people who carry the pager (the on-call engineers). Textbooks teach boxes and arrows. On-call teaches something else: a booking system can look healthy while guests and hosts are stuck, and it can look busy while it protects nothing.

A low error rate can mean “everyone is booking fine” or “bookings are succeeding while two families own the same weekend.” A calm calendar dashboard can mean “all is well” or “abandoned holds are quietly blocking half the nights”. Interviewers like this gap because it separates a diagram from someone who has run the thing.

Four nightmares that look fine on a dashboard:

What the dashboard showsWhat is actually happening
Booking success rate is 99.9%Two families hold confirmations for the same weekend
No request is failingThe hold sweeper is down and abandoned checkouts are blocking nights
Payment calls return successThe booking never confirmed, and guests see two pending charges
Imports show “synced”An outside calendar overlapped a confirmed guest and nobody was told

Scene 1: The holiday home that double-booked

The moment: Weeks earlier, two families each booked the same beach house for the same holiday weekend and each received a confirmation email. On Friday both arrive with luggage, and both believe they own the nights. The host calls support. On the dashboard only a handful of conflicts have been recorded, but each one is a high-trust incident, because support has to relocate one guest, the host is angry, and finance has to unwind a payment.

The trap: Somewhere the system checked a slightly old copy of the calendar and then wrote a reservation later, or it saved a reservation without a rule that forbids two active stays on the same night. The overall booking success rate stayed high, because from the system's point of view both bookings succeeded. The fix is not better wording. It is one trusted database step that locks and updates the nights together, or a database rule that makes overlap impossible for active reservations.

What to build:

  • A duplicate-night detector that pages immediately when two active reservations own the same night.
  • A database rule that rejects active overlap, and idempotency on the reserve call.
  • A dashboard that links reservation id, payment intent and night rows, so support can see what happened in one place.

Scene 2: Ghost holds block the calendar

The moment: A host notices that their cabin has shown “unavailable” for the last three weekends, even though they have not blocked anything and no bookings appear. Guests searching see fewer options than really exist, and the host's income drops. The API looks healthy, because no request is failing.

The trap: Each hold stores a deadline (held_until), but that deadline was treated as a suggestion instead of a clock someone has to operate. The background job that releases expired holds broke after a deploy, and failed payments never freed their nights, so the calendar slowly filled with ghosts of abandoned checkouts.

What to build:

  • A metric for the age of held reservations, and an alert when holds survive past their allowed window.
  • Calendar reads and confirm that treat a hold past its deadline as free, even before the sweeper runs.
  • A daily check that counts held nights with no live reservation behind them.

Scene 3: Payment is authorized, but booking is unclear

The moment: A guest tries to book a flat on a weak connection, sees a spinner for a long time, and closes the app before any success screen appears. Their bank shows a pending charge, but their reservation list shows nothing. They try again, and now their bank shows two pending authorizations, and support has to explain both.

The trap: A background worker crashed or timed out between the payment step and the booking state change. The guest's retry created a second authorization, because the second request was not tied to the first one's payment record at the provider.

What to build:

  • A clear state machine and a reconciliation job. Every payment intent belongs to exactly one reservation.
  • Retrying capture or void with the same idempotency key.
  • A review state for “provider says captured, reservation not confirmed”, so no one tries random new charges.

Scene 4: Host calendar sync imports a conflict

The moment: A host who already has a confirmed guest on this site connects their calendar from another platform. The import says the same weekend is blocked elsewhere, and the host is surprised and a little panicked.

The trap: A naive system would mark the nights unavailable and quietly confuse the confirmed guest's booking. A safer system keeps the confirmed reservation, creates a conflict event, alerts the host, and stops selling any future overlapping nights until the host resolves the mismatch.

What to build:

  • A conflict record and a host alert for any overlap with a confirmed stay.
  • A rule that confirmed bookings in our database always win for online inventory.
  • A metric for calendar conflicts by source, so an unreliable channel manager shows up quickly.

In the interview: Pick one scene and tell it like a short story: what people felt, which metric lied, and what you would build next. You do not need all four. For this system the strongest story is two guests racing for one night, because it proves you understand the core rule.

Bottlenecks and tradeoffs

Those stories all trace back to a small number of choices where you cannot have both things you want. Interviewers listen for whether you can name the tension, say what breaks, and pick a side on purpose. Here are the four that matter most for a reservation system.

Booking truth vs search speed

The tension — Search wants to answer millions of “is this free?” looks quickly across many homes. Booking wants a careful, exact answer for the few guests who actually try to pay.

What breaks — If every browse is forced to read the live calendar, the product becomes slow and expensive. If booking trusts the browse answer, two guests can both believe they won the same night.

What teams do — Let browsing lag a little, then re-check and lock the real nights only when the guest reserves.

Say in the interview — “Browse is a hint, booking is the lock, and I measure how often a guest loses a date they saw as free.”

Hold length vs host revenue

The tension — A longer hold gives guests more time to finish typing card details. A shorter hold returns nights to other guests sooner so the host can still sell them.

What breaks — A long hold hides nights from everyone else after a guest wanders away. A short hold raises failed checkouts when real guests run out of time.

What teams do — Choose a hold lifetime, measure how often holds expire versus how often checkouts succeed, and make that product decision explicit.

Say in the interview — Name the number, say it is a product choice, and say what you would measure to tune it.

Payment certainty vs inventory time

The tension — Card networks are slower and less reliable than a local database step, and the nights must stay set aside while payment runs so nobody else takes them.

What breaks — Holding nights forever after an unclear payment, or keeping database locks open while waiting on the provider, blocks every other guest on that home.

What teams do — Keep a short pending state, ask the provider what really happened when the answer is unclear, and release the nights when the window runs out.

Say in the interview — “The hold protects the nights, so I never keep a database lock open while waiting for the provider.”

Strict calendar sync vs host flexibility

The tension — Outside calendars help hosts avoid selling the same weekend on two sites, but those feeds arrive late and can disagree with a stay this site already confirmed.

What breaks — Trusting imports too much can erase a guest's stay. Ignoring them leads to double bookings across platforms.

What teams do — Treat our reservation database as the truth for online bookings on this site, and treat imports as blocks or conflicts that need a host to reconcile.

Say in the interview — “Imports can block free nights, but they never cancel a confirmed stay.”

If you remember one thing: Every tradeoff here is between speed and certainty, and the design puts certainty exactly where money and nights change hands.

Interview tips

You now have a full design and the tradeoffs behind it, so the last thing to practice is defending it when the interviewer pushes back. These five are the pushes that come up most after you finish the design:

Checking availability is not the same as booking

In the room

You might say: “The app checks whether the dates are free, and then the guest can pay.”

Interview Push: “Two guests both checked availability a second ago. Which one owns the dates?”

Land here: Checking availability did not set the nights aside for anyone. That read may have come from a cache or a search index. Ownership starts only when the reserve request locks the real night rows and commits a hold. Say this clearly because it is the center of the design: browsing can be fast and slightly stale, and booking must be exact.

Two guests racing need one database winner

In the room

You might say: “We insert a reservation row after the guest pays.”

Interview Push: “What prevents another server from inserting an overlapping reservation at the same time?”

Land here: Paying does not decide who owns the nights. The short database step that locks the calendar does. Use one row per night with those locks taken in a fixed order, or a database rule that rejects two active stays on the same night. The first guest's request finishes and the second gets a clear “these dates were just taken” answer (often a 409 conflict). Only after the system owns a hold should it move on to authorizing payment.

Payment retries must not create new bookings or charges

In the room

You might say: “If payment times out, the app can call confirm again.”

Interview Push: “What if the provider captured money but your API timed out before the client saw success?”

Land here: Keep one payment record tied to the reservation, and send a unique id with every authorize, capture and refund so a retry returns the same answer instead of moving money again. A background job checks the provider before any new money movement. The guest should not be charged twice just because a phone network dropped a response.

Calendar imports are not stronger than confirmed reservations

In the room

You might say: “We import the host's calendar from the other site and update availability.”

Interview Push: “The import overlaps a confirmed reservation. Do you delete the guest booking?”

Land here: No. A stay that is already confirmed in our booking database stays put. The import creates a conflict record and alerts the host. Future availability may be blocked until the host resolves it, but the system should not silently undo a guest's confirmation because an outside feed arrived late.

The price belongs to the hold window

In the room

You might say: “We work out the price when the guest pays.”

Interview Push: “What if weekend pricing or tax rules change while the guest is paying?”

Land here: Save the price the guest accepted as a short-lived quote: nightly rates, fees, taxes, currency, and an expiry. The hold stores that quote's id, and confirm checks the quote is still usable, so the amount they accepted is the amount charged. If the quote has expired, return a clear error and ask the guest to refresh the price.

Red flags to avoid without correcting yourself: “check availability, then insert”, “the payment is the lock”, “retry the charge”, “overwrite the booking with the import”, “recompute the price at checkout”.

After each push, close with one real part of the design you would build, such as a locked night row, an idempotency key or a quote id, not “we will scale it later.”

What should stick

After working through the requirements, the decisions and the depth sections, you should be able to explain:

  1. Search is a hint. Availability browsing can be cached and slightly stale because booking re-checks the real calendar.
  2. Booking is the lock. Reserve must own the night rows in one short transaction, locked in a fixed order.
  3. Hold, then confirm. A short hold protects checkout while payment runs, and expired holds must be released, with the deadline re-checked at confirm time.
  4. Money is idempotent. Authorizing, capturing and refunding retries return the same logical result instead of double charging.
  5. Calendar sync is reconciliation. Outside feeds can block future dates or raise conflicts, but they do not silently override confirmed reservations.

Tell it in the room: “I keep one row per night of each home as the source of truth. Browsing may be stale. Reserve locks the live nights and creates a hold with an idempotency key. Payment authorizes, then confirm captures and marks the nights booked, and outbox workers send email and sync calendars. The second guest racing for the same night gets a 409.”

Quick check before a mock: (1) What does a stay from July 4 to July 7 own? (2) What is the lock, the check or the transaction? (3) What happens to an outside calendar block that overlaps a confirmed stay? → (1) The nights of July 4, 5 and 6 (2) the transaction on the real calendar (3) a conflict record and a host alert, with the stay kept.

Practice next: Open Design an Airbnb Reservation System on Practice System Design and run a timed attempt using clarifying questions and one booking story, without peeking until you have a draft on the board.

Key Takeaways

  • Browsing can be stale because it is only a hint; booking must lock and re-check the real night rows in one short transaction.
  • Store one row per night of each home, and use half-open date ranges so a stay from July 4 to July 7 owns the nights of the 4th, 5th and 6th.
  • Hold the nights with a deadline while the guest pays, release them with a sweeper, and re-check the deadline at confirm time.
  • Authorize first, capture on confirm, and give every money call and the reserve request its own idempotency key, never holding a database lock while waiting for the provider.
  • Freeze the price in a quote stored on the hold, so the amount the guest accepted is the amount charged.
  • Cancelling is a state change that returns the nights and sends one idempotent refund, and outside calendars can block free nights but never cancel a confirmed stay.
  • Split data by home so each race stays inside one shard, and watch conflict rate, ghost holds, payment lag and outbox age.

Quick revision notes

The problem in your own words. A reservation system decides, for every night of every home, who owns it. The hard part is that browsing can be slightly out of date, but the booking step must never give the same night to two guests, even when many people race for the same weekend.

The design in one breath. The calendar keeps one row per night. Browsing reads a lagging copy. At booking time the service opens a short transaction, locks the rows for the requested nights in a fixed order, and if all are free it creates a hold with a deadline and a locked price quote. Payment is authorized and then captured with idempotency keys, never inside a lock. Cancelling frees the nights and sends one safe refund. Emails, search updates and calendar exports run from an outbox after the booking is saved.

The choices you must be able to defend. One row per night rather than a list of reservations, because two guests need something to fight over. A hold with a deadline rather than marking nights booked early, so abandoned checkouts give nights back. Imports as advice, so a late outside feed cannot erase a confirmed stay.

The numbers worth remembering. A stay from July 4 to July 7 owns three nights. Browsing outnumbers booking by something like a hundred to one, so browsing and booking get different promises. Splitting data by home keeps every race inside one shard.

The mistakes that cost points. Checking availability and then inserting, treating payment as the lock, charging before owning the nights, retrying a charge without an idempotency key, recomputing the price at checkout, trusting an imported calendar over a confirmed booking, and forgetting that a hold is a clock someone has to operate.

Frequently asked follow-ups

  • How do you prevent double booking for overlapping date ranges?
  • How do check availability and book differ in the flow?
  • How do holds, payment authorization, and confirmation work together?
  • How do cancellations return nights and trigger refunds?
  • How do external host calendars sync without corrupting the source of truth?

Deep-dive questions and strong answer outlines

How do you stop two guests from booking the same night?

I would make checkout re-check availability inside one short database step on the trusted calendar. The system either locks one row per night or writes reservation-night rows with a uniqueness rule on listing and date. The first reservation commits; the second receives a clear conflict (often HTTP 409) and must choose new dates.

Why is GET availability not enough for checkout?

Availability reads can come from a cache or search index and may be slightly out of date. They help the guest browse, but they do not reserve anything. The reserve or confirm step must read the current calendar on the primary store and take the hold or booking there.

How do payments fit the reservation state machine?

Create a short hold first (nights set aside while the guest pays), authorize the card with a unique retry id, then capture only when the reservation moves to confirmed. If capture fails, release the hold. If a worker retries after a timeout, the payment provider and booking system both return the same logical result instead of charging twice.

How do cancellations and refunds work?

Cancellation is a state change with policy, not a silent delete. The booking service checks the cancellation rule, computes refund lines, releases the nights in the same database step, writes a follow-up message to send later, and calls the payment provider with a refund key that is safe to retry.

How do host calendar imports work?

Blocks imported from another calendar are advice until reconciled against the booking calendar. Confirmed reservations from this system win for online inventory. Conflicts create host-visible warnings and block future availability, but they do not silently delete confirmed guest bookings.

AI feedback on your design

After a practice session, InterviewCrafted summarizes strengths, gaps, and interviewer-style expectations—similar to a written debrief. See a static example report, then practice this problem to get feedback on your own answer.

FAQs

Q: Are we designing all of Airbnb?

A: No. Keep search ranking, reviews, messaging, host onboarding, and dispute tooling out of scope unless the interviewer expands the prompt. This guide focuses on reservation truth: dates, holds, payment, cancellation, and calendar sync.

Q: Should availability search be strongly consistent?

A: Usually no. Browsing can tolerate a small delay because checkout re-checks the authoritative calendar. The user may occasionally see a date that disappears at book time, but that is safer than slowing every search request with heavy locks.

Q: What about multi-unit listings such as a hotel room type?

A: Model inventory count per night instead of a single booked/free bit. The same rule still applies: the transaction must not let the count fall below zero, and the guest sees a conflict if another reservation wins the last unit.

Q: Where do taxes and fees belong?

A: A pricing service returns a quote with nightly rate, cleaning fee, service fee, taxes, and currency. The hold stores that quote version so checkout cannot silently change the amount while the guest is paying.

Q: What does a successful reservation response promise?

A: It promises that the reservation state was saved and the calendar nights are owned by that reservation. Email, host calendar export, analytics, and search-index updates happen after commit and may retry without changing that promise.

Practice interactively

Open the practice session to use the canvas and stages, then review AI feedback.