Find Common Free Slots Across Outlook Attendee Calendars
Last updated: November 29, 2026
Quick Overview
Given each attendee's busy blocks for a day as [start, end) minute intervals, return every free window inside working hours that is at least a requested meeting length and works for all attendees.
Microsoft
November 29, 20260
0
0 solved
Given each attendee's busy blocks for a day as [start, end) minute intervals, return every free window inside working hours that is at least a requested meeting length and works for all attendees.
This is the kind of interval problem Microsoft interviewers like because it maps directly onto Outlook's Scheduling Assistant. They check whether you merge overlapping intervals correctly across many calendars, respect working-hour bounds, and talk through clipping rather than special-casing every scenario.
What the Interviewer Expects
- Clarifies interval semantics (half-open, minutes since midnight) and working-hour bounds
- Flattens all attendees' busy blocks and sorts once rather than pairwise merging
- Tracks a running cursor of the latest busy end to handle nested and overlapping blocks
- Clips gaps to the working day and filters by minimum duration
- States O(N log N) complexity and discusses the k-way merge alternative
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
- Each calendar is already sorted: how would you avoid the full sort?
- How would you return only the first slot after a given time, as the UI does?
- Some attendees are optional: how would you rank slots by how many optional people are free?
- How do time zones and all-day events change the input handling?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input is a list of calendars, each a list of [start, end) busy blocks in minutes, plus working hours day_start..day_end and a meeting duration. Output is the list of free windows (maximal gaps) ...
High-Level Design
A window is free for everyone exactly when it is outside the union of all busy blocks. So I do not need per-attendee logic at all: flatten every block into one list, sort by start, and sweep. A `curso...