FastPrepEmployee Free Time
Problems/Employee Free Time

Employee Free Time

Zillow logoZillow● MediumINTERNPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: Reported at Zillow by a candidate for an SDE intern role (Summer 2023, United States) who interviewed in October 2022 and got an offer. The candidate reached the company through a campus career event and had two rounds: a first round of one hour and a second round of two hours with two questions. This task was the second question of round 2: from the busy times of each employee on one day, find when all of them are free at once.

The report numbers the two rounds but does not say what kind of interview they were, so we list it under phone screens, our default when the kind of round is not given.

Our choices: the function employeeFreeTime gets schedule, one list of [start, end] busy slots per employee; times are minutes after midnight, and the day runs from 0 to 1440. Slots may come in any order and may overlap or touch; a slot covers the time from its start up to its end, so touching slots leave no gap. The report asks for one moment that suits all of them; we return every such stretch of the day in time order, each as long as possible, including the stretches before the first busy slot and after the last one, and an empty list when there is none. The limits (up to 50 employees, up to 50 slots each) are ours as well.

Our version is about 85% the same as the reported question.

A team wants to know when every employee is free on the same day. Every time is a number of minutes after midnight, and the day runs from minute 0 to minute 1440 (the next midnight).

You are given schedule, where schedule[i] lists the busy slots of employee i. A slot [start, end] means the employee is busy from minute start up to minute end. One employee's slots can come in any order, and they may overlap or touch.

Return every stretch of the day when no employee is busy, as a list of [start, end] pairs sorted by start. Each stretch must be as long as possible and have positive length, so a slot that ends at minute t and a slot that starts at minute t leave no free time between them. If there is no minute when everyone is free, return an empty list.

Function

employeeFreeTime(schedule: int[][][]) → int[][]

Examples

Example 1

schedule = [[[540,600],[660,720],[900,960]],[[570,690],[930,1020],[1020,1050]]]return = [[0,540],[720,900],[1050,1440]]

Nobody is busy before minute 540, so [0,540] is free. From 540 to 720 someone is always busy: employee 0's slot [540,600] overlaps employee 1's slot [570,690], which overlaps employee 0's slot [660,720]. Everyone is free from 720 to 900. From 900 to 1050 someone is busy again, and employee 1's slots [930,1020] and [1020,1050] touch, so no free time lies between them. After minute 1050 everyone is free until 1440.

Example 2

schedule = [[[0,300],[1200,1440]],[[240,1260]]]return = []

Employee 0 is busy from 0 to 300 and from 1200 to 1440, and employee 1 is busy from 240 to 1260, which covers the gap between them. Someone is busy at every minute of the day, so the answer is empty.

Example 3

schedule = [[[600,660]],[],[[480,540],[500,520]]]return = [[0,480],[540,600],[660,1440]]

Employee 1 has no busy slots, so they never block a free stretch. Employee 2's slot [500,520] lies inside their own slot [480,540]. The busy times are 480 to 540 and 600 to 660, so the free stretches are [0,480], [540,600] and [660,1440].

Constraints

  • 1 <= schedule.length <= 50
  • 0 <= schedule[i].length <= 50
  • schedule[i][j].length == 2
  • 0 <= schedule[i][j][0] < schedule[i][j][1] <= 1440

More Zillow Phone Screen questions

  • Valid ParenthesesPHONE SCREEN · ONSITE INTERVIEW · Seen Jul 2025
  • Time Based Key-Value StorePHONE SCREEN · Seen Feb 2024
  • Filter Formatted Records by CriteriaPHONE SCREEN · Seen Sep 2023
  • Build a Hash TablePHONE SCREEN · ONSITE INTERVIEW · Seen Feb 2023
  • Jump GamePHONE SCREEN · Seen Dec 2022
  • Reversible Run-Length EncodingPHONE SCREEN · Seen Nov 2022
  • Spiral MatrixPHONE SCREEN · ONSITE INTERVIEW · Seen Nov 2022
  • Two Sum: All PairsPHONE SCREEN · Seen Nov 2022
  • First Unique Character in a StringPHONE SCREEN · Seen Oct 2022
  • K-th Smallest Number in a StreamPHONE SCREEN · Seen Oct 2022

Similar questions at other companies

  • Merge IntervalsApple · OA · PHONE SCREEN · ONSITE INTERVIEWApple interview questions
  • Merge Overlapping IntervalsAtlassian · PHONE SCREEN · ONSITE INTERVIEWAtlassian interview questions
  • Peak Chat Load Across AgentsCresta · PHONE SCREENCresta interview questions
  • Meeting Rooms IIeBay · PHONE SCREENeBay interview questions
  • Meeting Rooms IIByteDance · PHONE SCREENByteDance interview questions
  • Majority Labels over Audio IntervalsNooks · PHONE SCREEN
  • Meeting Rooms IIUber · PHONE SCREENUber interview questions
  • Merge IntervalsGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
  • Merge Overlapping IntervalsFurtherAI · PHONE SCREEN
  • Peak Resource Usage Across Weighted IntervalsTekion · PHONE SCREENTekion interview questions
All Zillow interview questionsSee Zillow hiring insights
Saved
class Solution {
    public int[][] employeeFreeTime(int[][][] schedule) {
        // Write your code here.
    }
}
Checking account…