codebaobab
Python workspace

All problemsData & Systems

Airport Runway Scheduler

Build a takeoff and landing scheduler for a regional airport from a one-page spec.

Python60 minutesData & Systems

Challenge brief

Read before you begin

Your mission · Build from a spec

Build the scheduler that sets the order and time of every takeoff and landing on the runway.

Tamarack's tower sequences the evening push on paper strips. In November, 37 departures were held more than 10 minutes, and Pinecrest Air paid $1,400 in crew overtime on four of those nights. Pinecrest adds six evening flights on January 12, and the airport authority wants a scheduler running before then.

  • Target · All public checks
  • Mode · Build from a spec
Skip to round setup

Your assignment

  1. Read docs/spec.md and plan the pieces.
  2. Build the earliest second with separation.
  3. Add the pick, the window and the closures.
  4. Handle the new requirement when it arrives.
  5. Write the plan and next steps in NOTES.md.

The problem

Sequenced on paper strips

The tower orders flights by hand from strips on a board.

Impact: 37 departures were held more than 10 minutes in November.

Separation worked out in heads

Controllers add wake gaps from memory during the busiest hour.

Impact: Two go-arounds in October when a light followed a heavy too closely.

Timing and sequencing are stubs

Every schedule fails with NotImplementedError.

Impact: The ops display cannot show a plan before January 12.

Context

Long departure holds
37
Overtime in November
$1,400
Six more flights
Jan 12

Requirements

  • Separation comes from the weight-class table.
  • No flight goes before its ready time.
  • Window measured from the earliest possible second.
  • Inside the window, landings before takeoffs.
  • Ties go by earliest second, then flight ID.
  • A closure moves a flight to its end.
  • Bad input raises ValueError naming the field.

System overview

Edit the components marked “Your work”. The other components show where your changes fit.

Flight data feedSends ready flights
Runway scheduler(Your work)Orders and times flights
Ops displayShows the runway plan
Closure noticesLists runway closures
Plan archiveKeeps past plans
Read the connections
  • Flight data feed → Runway scheduler: flights
  • Closure notices → Runway scheduler: closures
  • Runway scheduler → Ops display: runway plan
  • Runway scheduler → Plan archive: plan
  • Flight data feed: Sends each flight with its kind, weight class and ready second.
  • Runway scheduler: schedule(config, flights) in runway/scheduler.py; RunwayTiming applies operating rules; RunwayScheduler chooses which flight goes next.
  • Ops display: Shows the tower the order and second for every flight.
  • Closure notices: Runway inspections and closures, from the airfield operations log.
  • Plan archive: Every plan the scheduler produced, kept 2 years for incident reviews.

Details

Full requirements

Functional

  1. schedule(config, flights) returns one entry {flight, runway, time} per flight, in the order the flights use the runway. Tamarack has one runway, numbered 1. Time is whole seconds from the start of the plan.
  2. Separation: after a flight uses the runway, the next one waits a number of seconds set by the two weight classes, because the wake of a heavy aircraft can roll a light one. The table is in docs/spec.md: a light behind a heavy waits 180 seconds. No flight goes before its ready time.
  3. Each step, the scheduler works out the earliest second every waiting flight could go. Flights within window seconds of the smallest one are candidates; a landing goes before a takeoff, because an aircraft in the air burns fuel while it waits; then the earlier second; then the flight ID.
  4. Closures: no flight uses the runway from start up to, but not including, end. A flight whose earliest second falls in a closure moves to its end, and closures that touch act as one.
  5. Bad input raises ValueError naming the field: window, closure, flight, kind, weight, ready; a flight ID listed twice raises ValueError mentioning duplicate.

Non-functional

  • Scale: about 140 operations a day and up to 30 in the busiest hour after January 12. A plan for a whole day must come back in under a second.
  • Determinism: the same flights and config always give the same plan, so the archive can replay any evening for an incident review.
  • Safety: a plan that breaks separation is never acceptable. A plan that holds a flight longer than needed costs fuel and crew time, about $25 a minute for a Pinecrest regional jet.
  • Recalculation: the ops display asks for a new plan every time a flight becomes ready, about every 2 minutes at peak.

Out of scope

  • Taxi routes, gates and the time to roll out after landing. A flight uses the runway at one second.
  • Wind, runway direction and weather minimums.
  • Changing a plan once a flight has used the runway; each call plans from scratch.
  • The ops display and the archive store.
Data model

Config

FieldTypeNotes
windowinteger >= 0Seconds a landing may be ahead of the earliest flight and still go first. Tamarack: 60.
closures{start, end}[]Optional. No flight from start up to, not including, end.

Flight

FieldTypeNotes
flightnon-empty stringCall sign, for example "PA412".
kind"landing" | "takeoff"
weight"light" | "medium" | "heavy"Wake class.
readyinteger >= 0First second it can use the runway.

Plan entry

FieldTypeNotes
flightstring
runwayintegerAlways 1 at Tamarack today.
timeintegerThe second the flight uses the runway.
Files you are given · 5
  • config/tamarack.yaml The runway settings: one runway, a 60-second landing window, the separation table and the evening inspection.
    # Tamarack Regional Airport, runway settings (in force since 2026-06-01).
    runways: 1
    clock_origin: "17:00"        # second 0 of the evening plan
    landing_window_seconds: 60
    separation_seconds:          # leader -> follower
      light:  {light: 60,  medium: 60,  heavy: 60}
      medium: {light: 120, medium: 60,  heavy: 60}
      heavy:  {light: 180, medium: 120, heavy: 90}
    evening_inspection: {start: "17:30", end: "17:35"}
  • samples/evening-push.json Nine flights from a simulated evening schedule, with the 17:30 inspection as a closure. Arguments for Preview.
    [
      {
        "window": 60,
        "closures": [
          {
            "start": 1800,
            "end": 2100
          }
        ]
      },
      [
        {
          "flight": "PA412",
          "kind": "takeoff",
          "weight": "medium",
          "ready": 0
        },
        {
          "flight": "PA518",
          "kind": "landing",
          "weight": "medium",
          "ready": 40
        },
        {
          "flight": "NX88",
          "kind": "takeoff",
          "weight": "light",
          "ready": 60
        },
        {
          "flight": "CF7031",
          "kind": "landing",
          "weight": "heavy",
          "ready": 300
        },
        {
          "flight": "PA420",
          "kind": "takeoff",
          "weight": "medium",
          "ready": 330
        },
        {
          "flight": "N512TC",
          "kind": "landing",
          "weight": "light",
          "ready": 400
        },
        {
          "flight": "PA431",
          "kind": "takeoff",
          "weight": "medium",
          "ready": 1750
        },
        {
          "flight": "PA530",
          "kind": "landing",
          "weight": "medium",
          "ready": 1900
        },
        {
          "flight": "CF7032",
          "kind": "takeoff",
          "weight": "heavy",
          "ready": 2040
        }
      ]
    ]
  • samples/evening-push-expected.json What the spec says that evening returns. N512TC lands at the very end of the window, ahead of PA420.
    [
      {"flight": "PA518", "runway": 1, "time": 40},
      {"flight": "PA412", "runway": 1, "time": 100},
      {"flight": "NX88", "runway": 1, "time": 220},
      {"flight": "CF7031", "runway": 1, "time": 300},
      {"flight": "N512TC", "runway": 1, "time": 480},
      {"flight": "PA420", "runway": 1, "time": 540},
      {"flight": "PA431", "runway": 1, "time": 1750},
      {"flight": "PA530", "runway": 1, "time": 2100},
      {"flight": "CF7032", "runway": 1, "time": 2160}
    ]
  • logs/tower-strips-2026-11-18.log One evening sequenced by hand, with a 5-minute and a 12-minute departure hold.
    2026-11-18T17:04:10-06:00 strip PA412 takeoff medium hold_line
    2026-11-18T17:05:02-06:00 strip CF7031 landing heavy final
    2026-11-18T17:05:40-06:00 clear CF7031 land
    2026-11-18T17:06:15-06:00 strip N512TC landing light final
    2026-11-18T17:06:30-06:00 clear N512TC land note="2 min behind heavy, extended downwind"
    2026-11-18T17:09:05-06:00 clear PA412 takeoff held_minutes=5
    2026-11-18T17:30:00-06:00 closure runway inspection until 17:35
    2026-11-18T17:41:20-06:00 clear PA431 takeoff held_minutes=12
  • metrics/departure-holds-2026-11.csv Departures held more than 10 minutes each week in November, with the overtime they cost.
    week,departures,held_over_10_min,go_arounds,overtime_usd
    2026-11-02,412,7,0,0
    2026-11-09,418,9,0,350
    2026-11-16,421,11,0,700
    2026-11-23,409,10,0,350
Tickets · 4
  • TASK-201 Read docs/spec.md and plan the pieces Reported by Imani (airfield systems)

    Expected NOTES.md lists what the scheduler keeps between steps and the order you will build the pieces in.

    Actual The config and flight checks work, but nothing says how a step picks the next flight, and the timing and sequencing code is a stub.

  • TASK-202 Core: the earliest second for a flight, with separation Reported by Imani (airfield systems)

    Expected The heavy goes at 0 and the light at 180.

    Actual Every schedule fails with NotImplementedError: "Implement RunwayScheduler.plan using the request contract".

  • TASK-203 Then the pick, then the window, then the closures Reported by Walt (tower supervisor)

    Expected Every entry matches the expected file. With N512TC ready at 461 it still lands at 480, ahead of PA420.

    Actual Until earliest and plan are built, every schedule fails with NotImplementedError from runway/services/.

  • TASK-204 Write down anything you chose to leave out or would do next Reported by Rena (airport operations)

    Expected A short list of what the scheduler does not handle yet and what you would build next, with a reason for each.

    Actual NOTES.md has no entry.

What you hand in
  • Every public check passing, including the new requirement when it arrives.
  • NOTES.md: the pieces you split the spec into, the order you built them in, and what you left out or would do next.
  • Your answer to the interviewer's follow-up and the debrief questions.
How the work is judged
Breaking down the work
Splits the spec into the earliest second, the pick, the window and the closures, and builds them in that order with the checks run after each.
Directing the assistant
Hands the assistant one function at a time with the rule from the spec, the separation table and a worked example.
Checking the work
Works small flight lists by hand first, checks the evening push against its expected file, and tries a landing one second inside and outside the window.
Judging the assistant
Rejects a plan sorted once by ready time, a window measured from the ready time, or closures checked in list order.
Correct result
All checks pass, including the window edge, separation that ends inside a closure, touching closures and the follow-up emergency landing.
Explaining the work
Explains the step loop in a few sentences a tower supervisor could follow, and names what was left out.
Trade-offs to discuss
  • Landings first inside a window versus strict first come, first served, and who waits longer under each.
  • Recomputing every flight's earliest second each step versus keeping a priority queue, at 140 flights a day.
  • A fixed window versus one that grows with how long a takeoff has been held.
  • Planning from scratch on every call versus keeping the plan and adjusting it.
How you are graded
  • Decomposition 25%
  • Prompting the assistant 15%
  • Verification 20%
  • Judgment about AI output 10%
  • Correctness 20%
  • Communication 10%

Scores use evidence from your session. A short or incomplete session may not provide enough evidence for every skill. See a sample scorecard

Interview guidance

Build a scheduler for an airport runway. Landings and takeoffs share one runway, each flight has a weight class and a ready time, and the spacing between two flights depends on their classes. The spec is one page. Start with a working core and grow it. Use the AI assistant however you like, and tell me your plan before you ask it for code.

  • AI is allowed and expected: your own Claude, OpenAI or Gemini key, or the free in-browser model.
  • You are graded on how you drive and check the AI, not on how much you prompt.
  • Run the checks; read what fails.
  • A new requirement will arrive partway through.
  • Too little AI use is reported as “not enough to grade”, never as a fail.
Debrief · 8 questions
  • What did you delegate to the AI, and why?
  • Name one AI suggestion you rejected or changed, and why.
  • Choose one block the AI helped write. Explain what each line does and which test verifies it.
  • What is still risky, and what would you test or ship next?
  • How did you split the spec, and which piece did you get passing first?
  • What did you decide yourself before asking the assistant for code?
  • Which edge case did you test that the assistant's first version got wrong?
  • What did you leave out, and what would you build next?