← Airbnb Interview Insights

Airbnb·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Apr 2026

Summary

Airbnb coding interview for a software engineer role. One algorithmic problem, classic unbounded knapsack flavor dressed up in a travel theme. Clean enough problem but the variant trips you up if you haven't seen it before.

Questions Asked (1)

Q1

Given a layover duration and a list of experiences each with a specific duration, determine if you can select experiences (repeating any as needed) so their total duration exactly equals the layover. Return a valid booking if one exists.

Algorithms & Data Structures
Author's notes

I recognized the coin change shape pretty quickly, which helped.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize this as the unbounded knapsack/coin change problem where order doesn't matter and repetition is allowed. Use dynamic programming to determine if the target sum is reachable, then backtrack to construct a valid combination. Discuss time and space complexity and potential optimizations.

Pro tip: Clarify with the interviewer whether you need to return any valid combination or all combinations, and whether the order of experiences matters. This shows attention to detail and avoids over-engineering.

1. Clarify requirements and edge cases

Ask about input constraints, whether experiences can be repeated, if order matters, and what to return if no combination exists. Confirm the expected output format.

2. Identify problem type and choose algorithm

Recognize this as a variation of the coin change problem (unbounded knapsack). Decide between DP, BFS, or recursive backtracking with memoization based on constraints.

3. Design DP solution

Create a boolean DP array where dp[i] indicates if sum i is reachable. Iterate through sums and experiences to fill the array. For reconstruction, store the last experience used to reach each sum.

4. Reconstruct and return a valid booking

If dp[layover] is true, backtrack from layover using the stored choices to build the list of experiences. Return the list; otherwise return null or an empty list.

5. Analyze complexity and discuss optimizations

State time complexity O(n * m) where n is layover and m is number of experiences, and space O(n). Mention potential optimizations like using BFS for shortest combination or pruning.

Key Points to Mention

  • This is the unbounded knapsack/coin change problem where repetition is allowed.
  • Dynamic programming with a boolean array to track reachable sums.
  • Backtracking or parent pointers to reconstruct the actual combination.
  • Time complexity O(n * m) and space complexity O(n).
  • Edge cases: zero layover, no possible combination, negative durations (if allowed).
  • Alternative approaches: BFS for shortest path or recursive memoization.

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