Find Common Free Meeting Slots Across Attendee Calendars
Last updated: November 29, 2026
Quick Overview
Given each attendee's busy intervals in minutes for one day, the working window, and a minimum meeting length, return every interval in which all attendees are free and which is at least the minimum length.
Zoho
November 29, 20260
0
0 solved
Given each attendee's busy intervals in minutes for one day, the working window, and a minimum meeting length, return every interval in which all attendees are free and which is at least the minimum length.
Zoho Calendar and the meeting scheduler in Zoho Cliq and Bookings both need to suggest times that work for everyone. The interviewer checks interval merging, clipping to working hours, and clean handling of overlaps and touching meetings.
What the Interviewer Expects
- Flatten all busy intervals and sort by start
- Sweep with a cursor that tracks the end of busy time so far
- Clip intervals to the working window
- Emit gaps of at least the minimum length, including the final gap
- Explain complexity in terms of total intervals
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
- How would you handle attendees in different time zones with different working hours?
- What if some attendees are optional and you want the slot that maximizes attendance?
- How would you do this with a heap if each calendar is already sorted?
- How would you return only the first k suggested slots quickly over a whole week?
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: calendars as lists of (start, end) minute offsets, day_start, day_end, min_len >= 1. Intervals may overlap or touch. Output: sorted free intervals common to all attendees....
High-Level Design
Free for everyone means not busy for anyone, so the union of all busy intervals is what matters. Sort everything, sweep with cursor = earliest time that is not yet known to be busy. Any gap between ...