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
November 29, 20260
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
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- 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 ProblemsSample 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: ...