Compute shared free time intervals
Company: IBM
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: Medium
Interview Round: Technical Screen
Quick Answer: This question evaluates skills in interval manipulation, schedule normalization, time parsing and time-zone handling, and scalable algorithm and data-structure selection for processing large sets of temporal intervals.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ([[[60,120]], [[30,90],[150,180]]],)
Expected Output: [[0, 30], [120, 150], [180, 1440]]
Explanation: Complement of merged busy intervals.
Input: ([[], []],)
Expected Output: [[0, 1440]]
Explanation: Everyone free all day.
Input: ([[[0,1440]]],)
Expected Output: []
Explanation: No free time.
Hints
- Clarify edge cases before coding.
- Keep the return value deterministic.