Dispatch Search Sorties to Drones With Recharge Downtime
Last updated: November 29, 2026
Quick Overview
A launch site has n identical drones. Search sorties arrive with a release time and a flight duration; each sortie goes to the lowest-numbered idle drone, or if none is idle, to whichever drone becomes ready first, and every drone needs a fixed recharge time after landing. Return the drone, start and finish time for every sortie.
Shield AI
November 29, 20260
0
0 solved
A launch site has n identical drones. Search sorties arrive with a release time and a flight duration; each sortie goes to the lowest-numbered idle drone, or if none is idle, to whichever drone becomes ready first, and every drone needs a fixed recharge time after landing. Return the drone, start and finish time for every sortie.
Shield AI's multi-aircraft operations, such as rotating V-BATs to keep continuous coverage over an area, raise scheduling questions like who launches next and when. The interviewer checks event-driven simulation with two heaps, exact tie-breaking, and whether you notice that recharge changes when a drone becomes available, not when its sortie ends.
What the Interviewer Expects
- Sorts sorties by release time with a stable tie break
- Uses one heap of idle drone ids and one heap of (ready time, id)
- Moves every drone ready by the release time into the idle heap before choosing
- Delays the start when no drone is idle
- Returns results in the original input order
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 compute the minimum number of drones needed so no sortie waits?
- Sorties now have priority levels. What changes?
- Drones have different endurance and a sortie needs a drone with enough battery. How do you pick?
- How would you keep a target coverage level of k drones airborne at all times?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice DSA ProblemsSample Answer
Requirements
Input: n, a list of (release, flight) pairs, and recharge. A drone that finishes at time f is ready again at f + recharge. Rules: if any drone is ready at the release time, use the smallest id...
High-Level Design
Two min-heaps. idle holds ids of drones ready now. busy holds (ready_time, id). For each sortie, first move every busy drone with ready_time <= release into idle. If idle is non-empty, sta...