Google VO Interview Question: Meeting Scheduler with Timeout, Time Interval Log Sorting

18 Views
No Comments

Given k calendars, a meeting duration, and bounds, return a list of possible time slots where the meeting can be scheduled.

Input timeout: 3

Input log:

ID | Timestamp | Event Type
1  | 0         | Start
2  | 1         | Start
1  | 2         | End
3  | 6         | Start
2  | 7         | End
3  | 8         | End

This problem is a time-line scheduling task: given multiple calendar logs and a required meeting duration, find all free intervals where the meeting can fit. A typical solution sorts events by timestamp and uses a sweep-line counter to track how many meetings are currently active. Whenever the active count drops to zero, you have an available gap; if the gap length is at least the timeout, it becomes a valid answer. The key details are handling event ordering at the same timestamp and merging overlapping busy intervals correctly.

END
 0