Find Valid Split-Stay Listing Combinations
Given a map of listing names to their available day numbers and a requested date range [startDay, endDay], return all valid stay options including single listings available for the entire range and ordered pairs (L1, L2) where L1 covers [startDay, k] and L2 covers [k+1, endDay] for some split day k, with L1 != L2.
Asked at:
Airbnb
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Early April, 2026
Airbnb
Mid-level
You are building a feature that suggests a split stay: a guest stays in one home for the first part of a trip, then switches to a second home for the remainder. You are given: A map availability from listing name (e.g., "A", "B") to a list of available day numbers (integers). A requested date range [startDay, endDay] inclusive. Return all valid split-stay options: Single-listing stay : any listing that is available for every day in [startDay, endDay] . Two-listing split stay : any ordered pair (L1, L2) for which there exists a split day k with startDay <= k < endDay such that: L1 is available for every day in [startDay, k] , and L2 is available for every day in [k+1, endDay] . Notes / clarifications: Availability is per-day; treat it as a set (duplicates don’t matter). A listing may appear in at most one position within a split option (i.e., L1 != L2 ). Output can be in any order; avoid duplicates. Example: A = [1,2,3,6,7,10,11] B = [3,4,5,6,8,9,10,13] C = [7,8,9,10,11] Query range: [3, 11] Determine which single listings and/or two-listing split stays satisfy the rules above.
Hello Interview Premium
Your account is free and you can post anonymously if you choose.