You have a list of meetings in your calendar with a start and end time. You are very busy, so meetings can overlap.
You also have one “Do Not Schedule”(DNS) interval during which you don’t attend any meeting.
Any meeting schedule that overlaps with a DNS slot is automatically cut such that it does not overlap with the DNS slot anymore.
Return a list of non-overlapping time intervals when you are in a meeting.
Example diagram:
Meeting | ---- ------------- ---
| ---- -------- --
DNS: XXXX
---------------------------------------> t
RES: | ----- XXXX ----- --- --
Sample input (for simplicity, all intervals include the left point and exclude the right point):
Meetings: [(1, 7), (5, 10), (12, 30), (22, 30), (40, 50), (60, 70)]
DNS: (18, 25)
Sample output:
[(1, 10), (12, 18), (25, 30), (40, 50), (60, 70)]
Part 2
Now you have more than one DNS slot.
If DNS slots overlap, they are merged into one DNS slot; everything else works the same.
Return one list of non-overlapping time intervals when you’re busy with meetings,
and another list for the merged DNS intervals.
Sample input:
Meetings: [(1, 7), (5, 10), (12, 30), (22, 30), (40, 50), (60, 70)]
DNS: [(18, 25), (20, 28), (65, 75)]
Sample output:
Meetings: [(1, 10), (12, 18), (28, 30), (40, 50), (60, 65)]
DNS: [(18, 28), (65, 75)]
- You’re given meeting intervals and one or more DNS intervals.
- Any meeting time that overlaps a DNS interval must be trimmed to remove the overlapping part.
- If multiple DNS intervals exist, merge them first.
- Output two merged lists:
- non-overlapping meeting intervals after trimming
- merged DNS intervals
Key idea:
Merge → subtract DNS from each meeting → merge results.
The VOprep team has long accompanied candidates through various major company OAs and VOs, including OpenAI, Google, Amazon, Citadel, SIG, providing real-time voice assistance, remote practice, and interview pacing reminders to help you stay smooth during critical moments. If you are preparing for Stripe or similar engineering-focused companies, you can check out our customized support plans—from coding interviews to system design, we offer full guidance to help you succeed.