← Airbnb Interview Insights

Airbnb·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Airbnb SWE interview with a classic scheduling DP problem. Not the hardest problem out there but the binary search optimization is the kind of thing that separates a clean solution from a mediocre one.

Questions Asked (1)

Q1

Given a list of jobs each with a start time, end time, and profit value, find the maximum profit you can earn by scheduling non-overlapping jobs. Jobs that share an endpoint are not considered overlapping.

Algorithms & Data Structures
Author's notes

The core idea clicked pretty fast: sort by end time, then build up a DP where each entry is either skip the current job or take it plus whatever the best non-conflicting prefix gives you.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Sort the jobs by end time, then use dynamic programming where dp[i] represents the maximum profit using the first i jobs. For each job i, find the latest non-overlapping job j (using binary search on end times) and compute dp[i] = max(dp[i-1], profit[i] + dp[j]).

Pro tip: Clarify the non-overlap condition: jobs sharing an endpoint are allowed, so when finding the latest non-overlapping job, use end_time <= start_time (not <). This subtlety often trips up candidates.

1. Clarify and Sort

Confirm the non-overlap rule (shared endpoints allowed) and sort jobs by end time. This ordering ensures that when considering a job, all compatible jobs appear earlier.

2. Define DP State

Define dp[i] as the maximum profit achievable using the first i jobs (sorted by end time). The answer will be dp[n].

3. Find Latest Compatible Job

For each job i, use binary search on the sorted end times to find the largest index j < i such that end_time[j] <= start_time[i]. This gives the latest job that doesn't overlap with job i.

4. Recurrence and Compute

Compute dp[i] = max(dp[i-1], profit[i] + dp[j]). Iterate i from 1 to n, filling the DP table.

5. Return and Analyze Complexity

Return dp[n]. Explain that sorting takes O(n log n) and the DP with binary search takes O(n log n) time, with O(n) space.

Key Points to Mention

  • Sorting jobs by end time to enable efficient DP and binary search.
  • DP state definition: dp[i] = max profit using first i jobs.
  • Binary search to find the latest non-overlapping job (using end_time <= start_time).
  • Recurrence relation: dp[i] = max(dp[i-1], profit[i] + dp[j]).
  • Time and space complexity: O(n log n) time, O(n) space.
  • Handling edge cases: empty list, single job, jobs with equal start/end times.

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