Design API for split-stay combinations
Company: Airbnb
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Technical Screen
Design an HTTP API endpoint that, given a date range and a set of listings with their available day numbers, returns all valid two-listing split-stay combinations as defined above. Specify request and response schemas, query parameters (e.g., start_day, end_day, max_results, sort_by), pagination, idempotency, and how to represent multiple valid split days per pair. Describe ranking and deduplication, caching, and rate limiting. Explain how the service achieves low latency at scale (e.g., precomputed prefix/suffix coverage, interval indexes) and handles edge cases such as time zones, minimum stays, cleaning-day gaps, and overlapping availability. Provide example success and error payloads.
Quick Answer: This question evaluates HTTP API design and scalable search service competencies for split‑stay combinations, including data and schema modeling, pagination, idempotency, ranking and deduplication, caching, low‑latency indexing, and correct handling of availability windows.