KatInterview

Design a Short-Term Rental Platform at Scale

System DesignModel answer
HardModel answerSystem Designdistributed-systemsconcurrencygeo-search

Last updated

Design the backend for a global property rental marketplace handling millions of listings, concurrent bookings, and sub-200ms search with zero overbooking.

Context

You're building the backend for a property rental platform that operates globally. Hosts list their homes, guests search by location and dates, and the platform must guarantee no two guests are ever confirmed for the same property on the same night.

Functional Requirements

  1. Search: Guests can find available listings by geographic area (lat/long + radius), travel dates, and number of guests.
  2. Booking: Guests can reserve a listing for a date range. The system must prevent double bookings under any level of concurrency.
  3. Listing management: Hosts can create and update listings, set nightly prices, and block or open dates on their availability calendar.

Non-Functional Requirements

  1. High availability: Both the search and booking flows must tolerate failures without going down.
  2. Strong consistency on writes: Booking confirmations must be strictly correct — overbooking is never acceptable.
  3. Search latency: p99 search results must return within 200 ms.

What Your Answer Should Cover

  1. Data model: Schemas for listings, bookings, and availability calendars, with rationale for your choices.
  2. API design: Core endpoints for search, listing management, and the booking flow.
  3. System architecture: The major components — search index, booking service, databases, caching layer — and how they connect.
  4. Read vs. write strategy: How you separate the high-throughput read path (search) from the high-consistency write path (booking).
  5. Scaling: How the system handles geographic traffic spikes and peak booking periods (holidays, sale windows).

Take 35–40 minutes. Start by stating your assumptions about scale, then walk through each area. Be prepared to go deeper on the concurrency control mechanism and the search latency budget.

Hints

Hint 1

Search and booking have opposite requirements — search tolerates stale data, booking tolerates almost no concurrency error. Design them as separate paths from the start rather than sharing a single database read/write model.

Hint 2

Think about where your shard or partition key lands. If a listing, its calendar, and its bookings all live on the same shard, your booking transaction stays single-shard ACID with no distributed coordination needed.

Hint 3

For availability filtering in search, the index will always lag the booking database by a few seconds. That's fine — just make sure the booking path re-validates before confirming. Explain this explicitly so the interviewer knows it's intentional.