Requirements
A drone delivery platform dispatches autonomous drones to deliver packages from warehouses or stores to customer addresses. Core challenges: fleet management (track and command hundreds of drones simultaneously), route planning (find optimal paths avoiding obstacles, restricted airspace, and weather), real-time telemetry (monitor battery, position, and payload status), and safety (detect and respond to failures mid-flight). This is a frontier system design question asked at Amazon (Prime Air), Alphabet (Wing), and Zipline. It combines IoT, real-time systems, geospatial algorithms, and safety-critical design.
Drone Fleet Management
Drone state: each drone has a state machine: IDLE (at base), LOADING (package being loaded), FLYING_TO_CUSTOMER, HOVERING (at delivery point), RETURNING, CHARGING, MAINTENANCE. State transitions are triggered by commands (dispatch, return) or autonomous events (low battery, delivery confirmed). Fleet controller: a centralized service tracks all drones. Each drone sends a heartbeat every 2 seconds: {drone_id, lat, lng, altitude, speed, heading, battery_pct, payload_status, current_state}. Data path: drone → cellular/5G → MQTT broker → fleet controller → Redis (drone state cache) + TimescaleDB (telemetry history). Redis: HSET drone:{id} lat {lat} lng {lng} battery {pct} state {state} ts {ts}. TTL 10 seconds — stale if no heartbeat. Lost heartbeat: if TTL expires, enter COMMUNICATION_LOST state. Ground control is notified. Drone has autonomous fail-safe: if telemetry link is lost for > 30 seconds, return to base or land at nearest safe point. Fleet visibility: geospatial index (Redis GEOADD) for all active drones. Enables proximity queries: “are any drones within 500m of this restricted zone?” O(log N) query.
Route Planning
A drone must fly from the warehouse to the delivery address avoiding: restricted airspace (airports, military zones, government buildings), dynamic no-fly zones (temporary: emergency response areas, VIP movements), terrain (buildings, towers, trees — stored as 3D obstacle map), weather (wind > 25 mph or precipitation grounds drones). Route planning algorithm: precompute a 3D grid of the service area (cells of ~10m × 10m × 10m). Mark cells occupied by obstacles or restricted zones. Run A* search on the 3D grid from start to destination. Cost function: minimize distance weighted by energy consumption (headwind adds energy cost). Alternate routes: compute top 3 routes; use the second if the primary is blocked en route. Dynamic re-routing: if a new obstacle appears mid-flight (drone reports obstacle via onboard sensors, or a new NOTAM is issued), the flight controller dispatches a new route to the drone. Corridor approach: rather than full 3D grid, define flight corridors at specific altitudes (60m AGL for drones, different from manned aircraft altitudes). Simplifies routing while maintaining separation from other aircraft. Time to compute: A* on a 10km × 10km × 200m service volume at 10m resolution = 10^7 cells. With a good heuristic, A* explores only ~0.1% of cells. Sub-second route computation.
Delivery Execution and Verification
Delivery flow: (1) Customer places order. System validates delivery address is in service area and drone can reach it on current battery. (2) Package loaded into drone pod at warehouse. Barcode scanner confirms correct package. Pod weight recorded (input to flight planning). (3) Drone dispatched. Route sent to drone autopilot. (4) Drone arrives at delivery address. Hover at 10m altitude. Lower package via winch to ground. (5) Onboard camera + computer vision confirms package on ground and detached from winch. (6) Drone returns to base. Delivery confirmation: three signals confirm delivery: (a) package sensor on the winch hook detects detachment, (b) computer vision model confirms package on ground, (c) customer receives push notification and confirms receipt via app (optional). Any two of three suffice for confirmation. Missed delivery: if the delivery zone is unsafe (person or animal underneath the hover zone), the drone waits up to 3 minutes, then returns to the warehouse. Customer is notified and re-delivery is scheduled. Proof of delivery: photo from onboard camera sent to customer and logged.
Safety and Regulatory Compliance
Fail-safes: low battery (< 20%): abort delivery, return to nearest charging base. Obstacle detection: onboard LiDAR and camera detect unexpected obstacles; drone maneuvers or hovers and reports. Motor failure: switch to emergency landing mode. Communication loss: autonomous return-to-home. Geofencing: onboard geofence module (independent from cloud) prevents the drone from entering restricted zones even if telemetry link is lost. UTM (Unmanned Traffic Management): regulatory requirement in most countries. Drones must file a flight plan with the UTM system (FAA DroneZone in the US, U-Space in Europe) before takeoff. The UTM system manages separation between drones and issues dynamic airspace alerts. NOTAM integration: parse aviation NOTAMs (Notices to Airmen) in real time; update the no-fly zone map when new NOTAMs are issued. ADS-B receiver: onboard receiver detects manned aircraft broadcasting their position and altitude. Fleet controller calculates conflict trajectories and issues avoidance maneuvers.
{“@context”:”https://schema.org”,”@type”:”FAQPage”,”mainEntity”:[{“@type”:”Question”,”name”:”How does 3D A* route planning work for drone delivery?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”The service area is discretized into a 3D grid (e.g., 10m cells). Cells are marked as obstacles (buildings, towers) or restricted (no-fly zones). A* searches from the warehouse to the delivery address using a cost function that combines distance and energy cost (headwind increases energy consumption). With a good heuristic (Euclidean distance to goal), A* explores only a small fraction of the search space, returning a route in sub-second time even for 10km x 10km service areas.”}},{“@type”:”Question”,”name”:”How does a drone handle communication loss mid-flight?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”The drone autopilot runs a fail-safe timer: if no telemetry acknowledgment is received for 30 seconds, trigger the return-to-home procedure autonomously. The drone also has an onboard geofence module (independent of cloud connectivity) that prevents entering restricted zones even without a network connection. Critical safety decisions are made onboard — the cloud connection is for monitoring and commands, not for basic flight control.”}},{“@type”:”Question”,”name”:”How is delivery confirmed without a human signature?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Three independent signals confirm delivery: (1) the payload sensor on the winch hook detects detachment when the package hits the ground, (2) the onboard camera captures an image processed by a computer vision model to confirm the package is on the ground and the hook is clear, (3) the customer confirms in the app. Any two of three signals suffice to mark the delivery as CONFIRMED. This redundancy prevents false confirmations from any single sensor failure.”}},{“@type”:”Question”,”name”:”How do you prevent drone-to-drone collisions in a dense fleet?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”Corridor-based separation: assign drones to specific altitude bands (e.g., outbound at 60m AGL, return at 80m AGL). Flight corridors at fixed altitudes prevent vertical conflicts between outbound and returning drones. Dynamic deconfliction: the fleet controller monitors all active drone positions and routes. If two routes are predicted to converge within 100m in the next 30 seconds, one drone is instructed to adjust altitude or speed. ADS-B receivers onboard detect manned aircraft and trigger avoidance maneuvers.”}},{“@type”:”Question”,”name”:”What is UTM (Unmanned Traffic Management) and why is it required?”,”acceptedAnswer”:{“@type”:”Answer”,”text”:”UTM is an air traffic management system for drones, analogous to ATC for manned aircraft. Regulatory bodies (FAA in the US, EASA in Europe) require drones operating beyond visual line of sight (BVLOS) to register their flights with a UTM provider. UTM coordinates airspace access, issues dynamic airspace restrictions (e.g., clear area for emergency aircraft), and tracks all registered drones for accountability. A commercial delivery drone must file a flight plan and receive authorization before each flight.”}}]}
See also: Uber Interview Prep
See also: DoorDash Interview Prep
See also: Lyft Interview Prep