Find Common Free Slots Across Creators' LIVE Schedules

Last updated: November 29, 2026

Quick Overview

Each creator has a list of busy LIVE broadcast intervals sorted by start time and non-overlapping within that creator. Return the finite intervals of positive length where every creator is free, so a multi-creator LIVE battle can be scheduled.

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

0

0

0 solved


Each creator has a list of busy LIVE broadcast intervals sorted by start time and non-overlapping within that creator. Return the finite intervals of positive length where every creator is free, so a multi-creator LIVE battle can be scheduled.

TikTok LIVE supports battles and multi-guest sessions where several creators must be online together, so scheduling across calendars is a realistic onsite prompt. The interviewer is looking for a k-way merge with a heap rather than flattening and sorting everything, and for careful handling of gaps.

What the Interviewer Expects
  • Recognizes that common free time is the gaps in the union of all busy intervals
  • Uses a min-heap to merge k sorted lists in O(N log k)
  • Tracks the furthest busy end seen so far and emits gaps when the next start exceeds it
  • Excludes the unbounded time before the first and after the last busy interval
  • Handles touching intervals without emitting zero-length gaps
Key Topics to Cover
heap
k-way merge
intervals
sweep line
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
  • How would you return only gaps of at least a given duration inside a working window?
  • How would you handle creators in different time zones with daily recurring schedules?
  • What if one creator's list is not sorted or has overlaps?
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: schedules: list[list[tuple[int,int]]], each inner list sorted and non-overlapping.
  • Output: sorted list of (start, end) free gaps with start < end, bounded by busy times on both sides....
High-Level Design

Everyone is free exactly where no one is busy, which is the complement of the union of all busy intervals. Because each list is already sorted, I can merge them lazily with a min-heap keyed by start t...


Submit Your Answer
Markdown supported