Code Room
CodingMediumcod-g1470
Subject IntervalsLevel Entry–Mid~14 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

A conference room's bookings for one day are [start, end] pairs occupying half-open spans [start, end) — unsorted, possibly overlapping, and all inside the building's open hours [open_time, close_time]. Return the room's free windows within open hours as [start, end] pairs sorted by start, skipping zero-length windows. Example: bookings [[9,10],[12,13]] with hours 8 to 18 give [[8,9],[10,12],[13,18]].

Implement
free_windows(meetings: list[list[int]], open_time: int, close_time: int) → list[list[int]]
Examples
in[[[9,10],[12,13]],8,18]out[[8,9],[10,12],[13,18]]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.