Maximize Host Payout From Overlapping Booking Requests

Last updated: November 29, 2026

Quick Overview

A host with one listing receives several pending booking requests, each with check-in, check-out (exclusive), and payout. Choose a set of non-overlapping requests that maximizes total payout and return both the payout and the chosen requests.

Airbnb
Coding & Algorithms
Software Engineer
Airbnb
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Medium

0

0

0 solved


A host with one listing receives several pending booking requests, each with check-in, check-out (exclusive), and payout. Choose a set of non-overlapping requests that maximizes total payout and return both the payout and the chosen requests.

Hosts who do not use Instant Book review requests manually, and a tool that suggests the best combination is a natural Airbnb feature. The interviewer is looking for weighted interval scheduling: sorting by end, a DP over prefixes, binary search for the last compatible request, and reconstruction of the answer.

What the Interviewer Expects
  • Explain why greedy by payout or by earliest end fails
  • Sort by check-out and define dp over prefixes
  • Use binary search to find the last compatible request
  • Treat back-to-back stays (checkout day equals check-in day) as compatible
  • Reconstruct the chosen set, not just the value
Key Topics to Cover
dynamic programming
weighted interval scheduling
binary search
reconstruction
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • How would you handle a required cleaning gap of one night between stays?
  • What if the listing has two identical units, so up to two stays can overlap?
  • How would you incorporate a guest rating so low-rated requests carry a penalty?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements

Requests are (check_in, check_out, payout) with integer days and check_out exclusive, so (1,4) and (4,7) do not conflict. Return (max_payout, list of chosen requests in date order). Empty input return...

High-Level Design

Greedy fails: picking the biggest payout first can block two medium requests worth more together, and earliest-end-first ignores payout entirely. Sort by check-out. Let dp[i] be the best payout using ...


Submit Your Answer
Markdown supported