← Airbnb Interview Insights

Airbnb·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
May 2026

Summary

Airbnb coding screen with a pretty involved availability-matching problem. The problem was framed around their actual product (split stays), which was a nice touch, but the logic had enough edge cases to keep you on your toes for a while.

Questions Asked (1)

Q1

Given a map of listing names to their available day numbers and a requested date range, return all valid stay options: any single listing available for the entire range, and any ordered pair of distinct listings where the first covers the start through some split day and the second covers the rest through the end.

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

The single-listing case is easy enough, just check if the listing's availability set is a superset of every day in the range.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Clarify the problem constraints and edge cases, then propose an efficient algorithm using hash maps and interval coverage. Discuss trade-offs between preprocessing and on-the-fly computation, and analyze time/space complexity.

Pro tip: Mention that you would preprocess each listing's available days into sorted intervals to enable O(log n) range queries, and handle the split by checking for a day where the first listing's coverage ends and the second begins.

1. Clarify Requirements

Confirm the definition of 'available day numbers' (e.g., discrete days), whether the range is inclusive, and if listings can have gaps. Ask about input size and performance expectations.

2. Preprocess Listings

For each listing, convert its available days into sorted intervals of consecutive days. This allows efficient checks for covering a subrange.

3. Find Single-Listing Stays

For each listing, check if its intervals cover the entire requested range. If so, add it as a valid single stay.

4. Find Two-Listing Stays

For each possible split day within the range, check if there exists a listing covering [start, split] and a different listing covering [split+1, end]. Use interval queries to do this efficiently.

5. Analyze Complexity and Optimize

Discuss time and space complexity of the approach. Consider optimizations like early termination or indexing listings by coverage to reduce redundant checks.

Key Points to Mention

  • Handling edge cases: empty range, no available listings, overlapping intervals, and listings with gaps.
  • Efficient interval representation and querying (e.g., using binary search on sorted intervals).
  • Avoiding duplicate pairs and ensuring distinct listings.
  • Time complexity: O(N log N + M log N) where N is number of listings and M is range length, or better with preprocessing.
  • Space complexity: O(N) for storing intervals.
  • Trade-offs between preprocessing all listings versus on-demand checks, and how to scale for large datasets.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.