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.
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.
Design a single HTTP API endpoint that:
State any minimal assumptions you need. Keep the spec precise and implementable.
Login required