Earliest Launch Slot Between Overlapping Airspace Closures
Last updated: November 29, 2026
Quick Overview
A launch site receives a list of airspace closure windows that may overlap and arrive unsorted. Given the current time, a required uninterrupted flight duration and a planning horizon, return the earliest launch time that fits entirely between closures, or None if no slot exists.
Zipline
November 29, 20260
0
0 solved
A launch site receives a list of airspace closure windows that may overlap and arrive unsorted. Given the current time, a required uninterrupted flight duration and a planning horizon, return the earliest launch time that fits entirely between closures, or None if no slot exists.
Zipline flights depend on temporary flight restrictions, weather holds and coordination with other airspace users. This interval question checks that you can merge overlapping windows on the fly and reason carefully about half-open intervals and the boundary at the current time.
What the Interviewer Expects
- Clarify whether windows are half-open [start, end)
- Sort and sweep, merging overlaps implicitly
- Handle a closure that is already in progress at `now`
- Respect the horizon on the final gap
- Test with touching and nested windows
Key Topics to Cover
How to Approach This
- Clarify input constraints and edge cases before writing code.
- Walk through your approach verbally and confirm with the interviewer before coding.
- Start with a brute force solution, then optimize. Mention time and space complexity.
- Test your solution with examples, including edge cases like empty input or duplicates.
- Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
- How would you answer many queries for different durations efficiently?
- Closures now arrive in a stream; what structure keeps queries fast?
- How would you return the k earliest launch slots for a batch of orders?
- What if each aircraft class is affected by a different subset of closures?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Closures are half-open [s, e). A launch at t is valid if [t, t+duration) overlaps no closure, t >= now, and t + duration <= horizon. Inputs are unsorted and may overlap or nest....
High-Level Design
Drop closures that ended before now, sort by start, and walk a cursor t that is always the earliest time not covered by a closure seen so far. For each closure, if the gap from t to its start fits...