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
Coding & Algorithms
Software Engineer
Shield AI
November 29, 2026
Software Engineer
Technical Screen
Coding & Algorithms
Medium

0

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
Heaps
Event simulation
Scheduling
Tie-breaking
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. 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 Problems
Sample 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...


Submit Your Answer
Markdown supported

Related Questions