Find Shared Free Meeting Slots Across Apple Park Calendars

Last updated: November 29, 2026

Quick Overview

Given each attendee's busy intervals for a day and a working-hours window, return every free slot of at least d minutes during which all attendees are available.

Apple
Coding & Algorithms
Software Engineer
Apple
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

0

0 solved


Given each attendee's busy intervals for a day and a working-hours window, return every free slot of at least d minutes during which all attendees are available.

Calendar and productivity apps are core Apple software, and interviewers like scheduling problems because they hide many off-by-one traps. They check that you flatten and merge all busy time before computing gaps, and that you clip results to working hours.

What the Interviewer Expects
  • Flatten everyone's busy intervals into one list
  • Merge overlapping busy intervals after sorting
  • Compute gaps between merged intervals within working hours
  • Filter gaps by minimum duration
  • Discuss a heap-based k-way merge alternative
Key Topics to Cover
intervals
sweep line
merging
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
  • Each attendee's list is already sorted; merge them with a heap instead of a global sort.
  • Some attendees are optional; find slots that maximize optional attendance.
  • Attendees are in different time zones with different working hours.
  • Return only the earliest slot and stop early.
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

Input: calendars, a list of lists of [start, end) minute pairs; work = (ws, we); d minimum length. Output: sorted list of [start, end) free slots inside [ws, we) of length at least d. If...

High-Level Design

Concatenate all busy intervals and sort by start. Sweep with a cursor t = ws. For each busy interval in order, if its start is after t, the gap [t, min(start, we)) is free for everyone; then adv...


Submit Your Answer
Markdown supported