Design an Airport Runway Task Scheduler
Queue flight-operation tasks, dispatch them across two exclusive runway resources, and recover uncertain assignments without double dispatch.
Problem statement
For this exercise, assume an abstract airport scheduler treats each flight operation as one non-preemptible task and each of two independent runways as one worker.
A controller accepts requests, queues them in server-recorded FIFO order, assigns the oldest eligible task whenever a healthy runway is idle, and records completion before releasing that runway. All tasks are eligible for either runway.
The task duration includes its full required occupancy interval; this exercise does not define real air-traffic separation or clearance procedures.
Each request has a stable task ID. A task may have only one active assignment, and a runway may have only one assigned or running task. A repeated request or start command must recover the same outcome. A timeout or missing heartbeat is not proof that an operation never started or that a runway is clear.
Uncertain assignments keep their resources unavailable until matching authoritative terminal evidence establishes safe release. If an operation never started, release also requires a durable executor acknowledgement that the retired assignment cannot start later. A momentary not-found status alone is not that proof.
Queued work may be cancelled, but running operations are not preempted.
For this exercise, use one airport with two runway executors and a durable software coordination service. Show queue and runway status, overload rejection and recovery progress. Measure efficiency by avoiding idle healthy runways when eligible work is waiting, while preserving FIFO and exclusive assignments.
Do not claim that a software lease can establish physical clearance. Emergency priority classes, weather compatibility, gates, multi-airport routing and optimal prediction of actual flight duration are outside scope.
What to build
- Accept or recover a flight-operation task, return its status, and cancel it only while it is still queued.
- Assign queued tasks in FIFO order to either idle healthy runway, with at most one active assignment per task and runway.
- Record executor progress and terminal completion, release resources safely, and expose uncertain or failed coordination without automatically dispatching conflicting work.
At scale
- For this exercise, assume 1,000 task requests per day, bursts of 100 submissions per minute and occupancy durations between one and five minutes. Bursts may queue; this is an abstract software workload, not a real airport capacity claim.
- For this exercise, bound the queue at 1,000 pending tasks. Reject additional new requests explicitly while preserving accepted tasks and idempotent status recovery.
- For this exercise, target dispatch within one second at p95 when a healthy eligible runway is already idle, and status reads within 200 ms at p95. Do not promise a fixed total wait when both runways are occupied.
- For this exercise, acknowledged tasks and assignments survive one coordinator process failure. Detect missing executor progress and alert within 30 seconds, but never release an uncertain runway solely because that timer expired.