Practice problem · Canva · Hard

Airport Runway Scheduler

A single runway handles one operation at a time. 3 stages in Python with an AI assistant. Pro.

Stage 1 of 3: FIFO takeoffs on a single runway

A single runway handles one operation at a time. Each takeoff occupies the runway for OCCUPANCY_SEC seconds (class attribute, default 60).

Implement RunwayScheduler.schedule_takeoff(flight_id, ready_time) in runway.py.

The flight can't take off before ready_time and can't take off before the runway is free. Return the actual takeoff time as an int.

Example

sched = RunwayScheduler()
sched.schedule_takeoff("AA1", 0)     # -> 0
sched.schedule_takeoff("AA2", 10)    # -> 60   (queued behind AA1)
sched.schedule_takeoff("AA3", 200)   # -> 200  (runway free by then)

Notes

  • flight_id is an opaque string.
  • ready_time is a non-negative int.
  • Tests may set OCCUPANCY_SEC before constructing a scheduler.
  • Calls arrive in non-decreasing ready_time order.

Done when Submit goes green.

Constraints

  • Python 3.12+ standard library only
  • Time limit: 10 seconds per test
  • Editable: runway.py
  • Read-only: all tests/test_*.py files

What comes after stage 1

The next stages open once the tests for the one before them pass. Each raises the bar, the way an interviewer does in the room.

  1. Stage 2: Landings preempt queued takeoffs. Landings outrank queued takeoffs, but nothing interrupts an operation in progress.
  2. Stage 3: Weather closures and fuel emergencies. Weather closes the runway and a low-fuel flight jumps the queue; everything already scheduled has to move.

The files you get

  • Yours to edit: runway.py.
  • Read-only: tests/__init__.py.
  • Tests you can read and run: tests/test_part1_takeoffs.py. Hidden tests run on Submit.

The round: an agent in the editor

The assistant here works like the one in the interview IDE. It reads your files, runs code and proposes changes, and you accept or reject each one. It doesn't volunteer ideas, so what gets built is what you asked for. Along the way the interviewer asks about your decisions, and at the end the report says what you checked and what you accepted unread.

Frequently asked, briefly answered

Is Airport Runway Scheduler free?

It is a Pro problem. Free plan includes one complete problem, plus the first stage of several more, so you can see how a round works before you pay.

Which company asks something like this?

Canva. It is modelled on Canva's round: Mandatory AI-assisted coding round — candidate uses Copilot/Cursor/Claude on an open-ended product challenge; graded on clarifying questions, strategic AI use, and critical review of AI output.

Do I bring my own AI tool?

No. The assistant is in the editor, same as in the interview IDEs at Meta, Stripe and Amazon. What you choose at Begin is the format: an agent that proposes changes you accept or reject, an answer-only assistant that can't write code, or no assistant at all.

What does the interviewer ask?

4 questions along the way about your own code, and one at the end about the whole session. A weak answer gets one follow up. The answers go into the report, which ends with a hire or no hire verdict.

Start the problem

Sign in and the problem opens where you left it. New here? An account takes a minute to create, and the Pro plan starts at the first stage of this problem.

Start this problem → Sign in

More like it: every practice problem, how Canva runs its AI round, the AI coding interview guide.