Maximize Booked Tours Across Agents With Skill Requirements

Last updated: November 29, 2026

Quick Overview

Each tour request lists acceptable time slots and required agent skills (for example Spanish speaking or affordable housing certified); each agent has available slots and a skill set and can give one tour per slot. Assign the maximum number of requests to (agent, slot) pairs.

EliseAI
Coding & Algorithms
Software Engineer
EliseAI
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


Each tour request lists acceptable time slots and required agent skills (for example Spanish speaking or affordable housing certified); each agent has available slots and a skill set and can give one tour per slot. Assign the maximum number of requests to (agent, slot) pairs.

A centralized leasing team covers many properties, and the AI assistant has to fill agent calendars as fully as possible when demand spikes on weekends. A greedy first-fit leaves tours unbooked, so the interviewer wants you to recognize maximum bipartite matching and justify it.

What the Interviewer Expects
  • Show a counterexample where greedy assignment fails
  • Model requests vs (agent, slot) nodes as a bipartite graph
  • Implement augmenting paths (Kuhn's algorithm) correctly
  • State complexity and when Hopcroft-Karp is worth it
  • Discuss adding preferences as a weighted matching
Key Topics to Cover
bipartite matching
augmenting paths
greedy counterexample
scheduling
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
  • Prospects rank slots: how do you maximize bookings first and then preference?
  • Requests arrive one at a time and existing bookings should rarely move: what do you do?
  • How would you scale to 50k requests across 2k agents?
  • Agents need travel time between properties: does this stay a matching problem?
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

Maximize the count of booked requests. A request can use agent a at slot s only if s is acceptable to the request, a is free at s, and the agent's skills cover the request's needs. Each (agent, slot) ...

High-Level Design

Greedy fails: agents kim (10, 11, Spanish) and lee (10). If r3 (10 or 11) takes kim at 10 first, then r2 (10, needs Spanish) cannot book. Matching fixes this by re-routing earlier choices. Left side: ...


Submit Your Answer
Markdown supported

Related Questions