PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/System Design/Airbnb

Design split-stay combinations API

Last updated: Mar 29, 2026

Quick Overview

The question evaluates API and system design competence, including data modeling for availability intervals, request/response schema design, deterministic pagination and ordering, deduplication of unordered listing pairs, validation/error handling, and performance considerations such as indexing, precomputation, caching, and SLAs.

  • hard
  • Airbnb
  • System Design
  • Software Engineer

Design split-stay combinations API

Company: Airbnb

Role: Software Engineer

Category: System Design

Difficulty: hard

Interview Round: Technical Screen

Design an HTTP API endpoint that, given a date range [S, E] and a collection of listings with availability as arrays of day numbers, returns all two-listing split-stay combinations that together cover the entire range with consecutive subsegments (first listing covers S..T, second covers T+1..E for some T). Define the request and response schemas (including how listings are identified), pagination and result ordering, deduplication of unordered pairs, validation and error handling, and filters (e.g., minimum stay lengths). Discuss performance targets and system concerns such as indexing/precomputing maximal consecutive intervals, query flow, caching, consistency model, idempotency, rate limiting, and SLAs. Include how the endpoint would produce [["B","C"]] for the sample data A:[1,2,3,6,7,10,11], B:[3,4,5,6,8,9,10,13], C:[7,8,9,10,11] with date range [3,11].

Quick Answer: The question evaluates API and system design competence, including data modeling for availability intervals, request/response schema design, deterministic pagination and ordering, deduplication of unordered listing pairs, validation/error handling, and performance considerations such as indexing, precomputation, caching, and SLAs.

Related Interview Questions

  • Design a Scalable Job Scheduler - Airbnb
  • Design a Rental Marketplace Backend - Airbnb (hard)
  • Design a booking system - Airbnb (medium)
  • Design a group chat system - Airbnb (medium)
  • Design a real-time chat system with hot groups - Airbnb (hard)
Airbnb logo
Airbnb
Sep 6, 2025, 12:00 AM
Software Engineer
Technical Screen
System Design
8
0

Design an HTTP API for Two-Listing Split-Stay Search

Context

You are designing search for a travel marketplace that supports split stays across two listings. Inventory is represented per listing as an array of day numbers (integers) indicating available nights. Given a target date range [S, E] (inclusive, in day numbers), return all two-listing combinations that can cover the range with consecutive subsegments: the first listing covers S..T and the second covers T+1..E for some split point T where both subsegments are non-empty.

Assume day numbers correspond to UTC-normalized yyyy-mm-dd dates mapped to an integer day index (e.g., days since epoch). If you prefer ISO dates in the API, define the mapping internally.

Requirements

Design a single HTTP API endpoint that:

  1. Request/response schemas
  • Define how listings are identified.
  • Include parameters for date range [S, E].
  • Include optional filters (e.g., minimum stay lengths per segment, distinct listings only).
  • Define the response format that returns split-stay combinations and optionally details about valid split points.
  1. Pagination and ordering
  • Define deterministic ordering of results.
  • Define pagination (limit and cursor/offset) and stability guarantees.
  1. Deduplication
  • Ensure unordered pairs are deduplicated when multiple split points T produce the same two listings. Return each unordered pair at most once, with an optional list of split points.
  1. Validation and error handling
  • Specify parameter validation rules and error responses.
  1. Performance and system design
  • Define performance targets (latency, throughput, scale limits) and SLAs.
  • Discuss indexing/precomputing maximal consecutive intervals and how they are queried.
  • Outline the query flow and algorithm to find valid pairs.
  • Discuss caching, consistency model, idempotency, rate limiting, and observability.
  1. Sample correctness
  • Show how the endpoint would produce [["B","C"]] for:
    • A: [1,2,3,6,7,10,11]
    • B: [3,4,5,6,8,9,10,13]
    • C: [7,8,9,10,11]
    • date range [3,11]

State any minimal assumptions you need. Keep the spec precise and implementable.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More System Design•More Airbnb•More Software Engineer•Airbnb Software Engineer•Airbnb System Design•Software Engineer System Design
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.