Airbnb connects 4+ million hosts with 150+ million guests across 220+ countries. Designing an accommodation platform tests your understanding of geospatial search, availability management, booking transactions, dynamic pricing, and trust systems (reviews, verification). This guide covers the core architectural components for a system design interview.
Listing Search
The core search query: “find available listings near [location] for [dates] matching [filters].” This combines: (1) Geospatial search — find listings within a geographic area (city, neighborhood, or map viewport). Use Elasticsearch with geo_point fields for latitude/longitude. geo_bounding_box for map-viewport searches, geo_distance for radius searches. (2) Date availability — filter listings that are available for the requested check-in/check-out dates. This is the hardest part: checking availability against a calendar of blocked/booked dates for each listing. Pre-filter with Elasticsearch (index available date ranges), then verify with the availability service. (3) Filters — price range, property type (entire home, private room, shared room), number of guests, amenities (wifi, pool, kitchen), instant book, superhost, rating. All indexed in Elasticsearch as structured fields. (4) Ranking — ML model scores listings by: relevance to the query, booking probability (based on listing quality, price, and user history), host response rate, review score, and recency of last booking. Personalization: boost listings similar to ones the user has previously viewed or booked. Search results show a map view (pins on the map) and a list view (cards with photos, price, rating) simultaneously. The map and list are synced: panning the map updates the list.
Availability Calendar
Each listing has an availability calendar: a day-by-day record of whether the listing is available, booked, or blocked by the host. Data model: calendar_entry: listing_id, date, status (available/booked/blocked), price_override (host can set custom prices for specific dates, e.g., holidays), minimum_stay. Storage: one row per listing per day. With 7 million active listings * 365 days = 2.5 billion rows. Use a database partitioned by listing_id for efficient per-listing queries. Availability check for a booking request: query all calendar entries for the listing between check-in and check-out dates. If all dates are available, the booking can proceed. Batch availability for search: checking availability for thousands of search results one-by-one is too slow. Pre-compute availability summaries: for each listing, store a bitmap or date range of available periods. Index in Elasticsearch: available_from, available_to fields per listing. Search filters listings with matching available ranges. Then verify with the detailed calendar on the booking page. Calendar sync: hosts may list on multiple platforms (Airbnb, Booking.com, VRBO). iCal export/import syncs availability across platforms. Airbnb periodically fetches the external iCal URL and updates the calendar to prevent double-bookings.
Booking Transaction
Booking flow: (1) Guest selects dates and clicks “Reserve.” (2) The booking service checks availability (atomic read with lock). (3) If available: create a booking record (status: PENDING), block the dates on the calendar (status: BOOKED), and hold the payment amount on the guest card (pre-authorization). (4) For Instant Book listings: booking is confirmed immediately. For Request to Book: the host has 24 hours to accept or decline. (5) On host acceptance (or instant book): capture the payment, send confirmation to both parties, update calendar. (6) On decline or timeout: release the calendar dates, void the payment hold. Preventing double-booking: the availability check and calendar update must be atomic. Use a database transaction: BEGIN; SELECT FROM calendar WHERE listing_id = X AND date BETWEEN check_in AND check_out AND status = available FOR UPDATE; if all dates available, UPDATE calendar SET status = booked; INSERT booking; COMMIT. The FOR UPDATE lock prevents concurrent bookings for the same dates. Cancellation: cancellation policy (flexible, moderate, strict) determines the refund amount. Cancel before check-in: refund based on policy. The calendar dates are released (status: available). A cancellation event triggers: refund processing, notification to both parties, and calendar update.
Dynamic Pricing
Airbnb Smart Pricing suggests prices to hosts based on: (1) Demand signals — search volume for the listing area and dates. High search volume (a city during a festival) suggests higher prices. (2) Comparable listings — prices of similar listings in the area (same property type, size, amenities). (3) Seasonality — historical booking patterns. Beach properties are more expensive in summer; ski lodges in winter. (4) Day of week — weekends typically command higher prices. (5) Lead time — last-minute bookings and far-future bookings may be priced differently. (6) Listing performance — occupancy rate. If a listing has low occupancy, suggest lower prices. If fully booked months ahead, suggest higher prices. The pricing model is an ML regression model trained on historical booking data: features (location, dates, amenities, demand) predict the optimal nightly price that maximizes host revenue while maintaining competitive booking rates. Hosts can accept, reject, or modify the suggested price. They can also set: base price, minimum/maximum price bounds, and custom prices for specific dates (holidays, events). The pricing engine runs daily, updating suggestions for the next 365 days per listing.
Reviews and Trust
The review system is the foundation of trust on a marketplace where strangers stay in each other homes. Dual reviews: both guest and host submit reviews within 14 days after checkout. Reviews are hidden until both submit (or the 14-day window closes). This prevents retaliation — a guest does not see the host review before writing theirs. Review data model: review_id, booking_id, reviewer_id (guest or host), reviewee_id, overall_rating (1-5), category_ratings (cleanliness, accuracy, communication, location, check-in, value for guests; cleanliness, communication, rule-following for hosts), text_review, created_at, is_public. Review display: listing pages show the average overall rating, category breakdowns, and the most recent text reviews. Reviews are sorted by: most recent, most helpful (upvotes from other users), or most relevant (ML-selected based on the viewer profile). Review fraud detection: ML models flag suspicious reviews: reviews from accounts created recently, reviews between accounts with shared IP/device, and reviews with generic or copied text. Flagged reviews are held for manual review. Superhost status: hosts with 4.8+ average rating, 90%+ response rate, 10+ stays per year, and less than 1% cancellation rate earn Superhost badge — a trust signal that increases bookings by 60%.