PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep

Quick Overview

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.

  • Medium
  • IBM
  • Coding & Algorithms
  • Software Engineer

Compute shared free time intervals

Company: IBM

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

You are given schedules for multiple employees. schedules[i] is a list of busy intervals for employee i, where each interval is half-open [start, end) in minutes from 0 to 1440 for a single day. Return all maximal half-open intervals [s, e) during which every employee is free. Requirements: ( 1) Input may contain up to 10^4 total intervals across all employees. ( 2) Intervals within an employee may be unsorted and may overlap; you must normalize as needed. ( 3) Output intervals must be sorted, non-overlapping, and within [0, 1440). Sub-questions: How would you handle schedules provided as strings like "09:30-12:00" and mixed time zones? How would you extend the solution to multiple days or to streaming updates to schedules? Discuss the time and space complexity and the data structures you would choose.

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.

Return all maximal half-open intervals in [0,1440) when every employee is free.

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

  1. Clarify edge cases before coding.
  2. Keep the return value deterministic.
Last updated: Jun 27, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,000+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Compute minimum rooms for meeting schedule - IBM (nan)
  • Reverse last two characters with space - IBM (nan)
  • Maximize palindromic strings after character swaps - IBM (medium)
  • Find minimum subarray length with k distinct integers - IBM (medium)
  • Find minimum operations to make array sorted - IBM (easy)