Employee Free Time
A hard-tier problem at 73% community acceptance, tagged with Array, Line Sweep, Sorting. Reported in interviews at Airbnb and 6 others.
Employee Free Time is a hard problem that's been asked at Airbnb, Citadel, DoorDash, and five other major companies. You're given a list of employees with their work schedules and need to find the common free time slots across everyone. The catch: schedules are nested, unsorted, and can overlap in messy ways. Most candidates either blow up the time complexity trying to brute-force intervals or get tangled in edge cases. With a 72.6% acceptance rate, plenty of people solve it in practice. But in a live OA, interval merging under pressure trips you up fast. StealthCoder surfaces a working solution instantly if the pattern doesn't click.
Companies that ask "Employee Free Time"
Employee Free Time is the kind of problem that decides whether you pass. StealthCoder reads the problem on screen and surfaces a working solution in under 2 seconds. Invisible to screen share. The proctor sees nothing. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop.
Get StealthCoderThe standard approach is to flatten all intervals into a single sorted list, merge overlapping ones, then extract the gaps. The trick is recognizing that gaps between merged intervals are exactly the free time slots. Most candidates start by trying to process each employee separately, which explodes the complexity. The right move: combine everything into one timeline, sort by start time, and sweep through merging overlaps. Heap and line sweep both work here, but sorting plus a linear pass is cleaner and faster than maintaining a priority queue. The real trap is off-by-one errors in gap calculation and forgetting that you're looking for the complement of busy time, not busy time itself. StealthCoder becomes your safety net when you've drilled the pattern but your live implementation starts bleeding time.
Pattern tags
You know the problem.
Make sure you actually pass it.
Employee Free Time recycles across companies for a reason. It's hard-tier, and most candidates blank under the timer. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds. Built by an Amazon engineer who used it to pass JPMorgan's OA and system design loop. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Employee Free Time interview FAQ
Is this really a hard problem or just tedious?+
It's hard because the interval-merging trick isn't obvious, and nested data structures hide the actual input shape. The acceptance rate of 72.6% reflects that some candidates know the pattern cold and others don't. In a timed OA, not seeing the merge-then-extract strategy costs you 20-30 minutes of trial and error.
Do I need a heap to solve this or is sorting enough?+
Sorting is enough and faster. Flatten all intervals, sort by start time, sweep through merging overlaps, extract gaps. Heap adds complexity without benefit here. Some solutions use a min-heap for the sweep, but a simple linear pass after sorting is cleaner and O(n log n) either way.
Which companies actually ask this?+
Airbnb, Citadel, DoorDash, GE Healthcare, Intuit, Pinterest, and Roblox all have on record. It's popular in fintech and backend infrastructure roles where timeline and scheduling logic matter. Not every interview loop, but common enough to be worth drilling.
What's the biggest pitfall candidates hit?+
Trying to solve it per-employee instead of globally. Flattening all intervals and merging them as one list is the insight. People also mess up the gap extraction: free time is the space between merged intervals, not the intervals themselves. Off-by-one errors on boundaries kill submissions.
If I blank on the algorithm during my OA, what do I do?+
StealthCoder reads the problem and delivers a working solution in seconds, invisible to the proctor. If the merge-sweep pattern doesn't hit you immediately, you have the hedge. Practice the approach beforehand so you recognize it, but know you're covered if the OA hits and your mind goes blank.
Want the actual problem statement? View "Employee Free Time" on LeetCode →