Meeting Scheduler
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Two people each have a list of free time slots, slots1 and slots2. A slot [start, end] means the person is free from start to end. Slots belonging to the same person never overlap, but a list may be in any order.
Find the earliest time window of exactly duration that fits inside a free slot of both people. Return it as [start, start + duration]. A window fits a slot when slotStart <= start and start + duration <= slotEnd. If no such window exists, return an empty array.
Examples
Constraints
- 1 <= slots1.length, slots2.length <= 10^4
- slots[i].length == 2 and 0 <= slots[i][0] < slots[i][1] <= 10^9
- Slots of one person do not overlap
- 1 <= duration <= 10^6
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.