Airflow interview questions: scheduling, DAG design and debugging
Airflow interview questions focus on how the scheduler turns a DAG file into runs: what a data interval is, when a run actually starts (which changed for cron schedules in Airflow 3), what catchup and backfill do, and how tasks pass small results through XCom. Interviewers then test whether your tasks are idempotent and safe to retry, which executor you would pick, and how you debug a DAG that is stuck or late. Answers land best when they name the setting and the failure it prevents.
By Evin JohnPublished 8 min read
Where Airflow comes up in interviews
Airflow questions appear in data engineering, analytics engineering, ML platform and some DevOps loops, usually next to SQL and a processing engine. A recruiter screen may only ask whether you have used it. The technical round goes deeper: read a DAG and spot the bug, explain why yesterday's run did not start when expected, or design the orchestration for a set of daily and hourly pipelines. Senior candidates get asked how they would run Airflow itself: the metadata database, the executor, scaling workers and keeping DAG parsing fast.
Core concepts
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is a DAG in Airflow? | Vocabulary | A Python-defined workflow: tasks plus the dependencies between them, with no cycles, along with a schedule and default arguments such as retries and owner. |
| Operator, task and task instance? | Precision | An operator is a template for a unit of work (run a query, call a script). A task is an operator placed in a DAG. A task instance is that task for one specific DAG run, with its own state and try number. |
| What are the main Airflow components? | Architecture | The scheduler decides what should run, the executor hands work to workers, a DAG processor parses DAG files, the metadata database stores state, the web UI (served by the API server in Airflow 3) shows it, and the triggerer runs deferred waits. |
| What is a sensor? | Waiting on events | An operator that waits for a condition, such as a file landing or a partition appearing. In poke mode it holds a worker slot the whole time; in reschedule mode it frees the slot between checks. |
| What is a deferrable operator? | Efficiency | One that hands its wait to the triggerer process and releases its worker slot until an async trigger fires, so thousands of waits do not occupy thousands of workers. |
| What is a hook versus a connection? | Integration | A connection stores credentials and endpoints (host, login, extras). A hook is the Python class that uses a connection to talk to a system; operators use hooks internally. |
| What is the TaskFlow API? | Modern style | Decorating plain Python functions with @dag and @task so return values pass between tasks through XCom automatically and dependencies follow from the function calls. |
| What does a trigger rule do? | Control flow | It decides when a task runs based on upstream states. The default is all_success; others include all_done for cleanup tasks, one_failed for alerts and none_failed_min_one_success after a branch. |
Scheduling, data intervals, catchup and backfill
- What is a data interval? The time range a run is responsible for. With a data-interval timetable, a daily DAG's run for 2 December covers midnight 2 December to midnight 3 December and is scheduled once that interval closes, so it starts early on 3 December. That was the default for cron schedules in Airflow 2.
- What changed about cron schedules in Airflow 3? A bare cron string such as @daily now uses a trigger timetable by default: each run is a point in time, its data interval start and end are equal, and it runs at the trigger time. Pass
CronDataIntervalTimetableor set thecreate_cron_data_intervalsoption if tasks rely on contiguous windows, and decide this before upgrading. - What is the logical date? The label of a run. Under a data-interval timetable it equals the start of the interval, which is the source of the classic confusion that a run seems to happen a day late; under a trigger timetable it is the trigger time. It replaced the older name
execution_date. - What does catchup do? When enabled, the scheduler creates a run for every interval between the start date and now that has not run yet. Turning it off creates only the most recent interval. Airflow 3 changed the default to off (
catchup_by_defaultis False), so check the version before assuming either. - How is backfill different from catchup? Backfill is a deliberate rerun of a chosen date range, usually after a bug fix or a new DAG with history to load. In Airflow 2 it was a CLI command; Airflow 3 moved backfills into the scheduler so they can also be started from the UI.
- Why should start_date be static? A dynamic value such as now() moves every time the file is parsed, so the scheduler may never see a complete interval and the DAG never runs.
- How do you express a schedule? A cron string, a preset such as @daily, a timedelta, a timetable for irregular calendars, or asset (dataset) events so a DAG runs when an upstream DAG updates the data it depends on.
- What do max_active_runs and depends_on_past control? max_active_runs caps how many runs of one DAG are in flight, which matters during catchup. depends_on_past makes a task wait until its own previous run succeeded, which keeps strictly ordered loads in order.
from datetime import datetime, timedelta
from airflow.sdk import dag, task, get_current_context, CronDataIntervalTimetable
@dag(
schedule=CronDataIntervalTimetable("0 0 * * *", timezone="UTC"), # a full-day window per run
start_date=datetime(2026, 11, 1),
catchup=False,
max_active_runs=1,
default_args={"retries": 3, "retry_delay": timedelta(minutes=5)},
tags=["orders"],
)
def orders_daily():
@task
def extract() -> str:
ctx = get_current_context()
start, end = ctx["data_interval_start"], ctx["data_interval_end"]
path = f"s3://raw/orders/dt={start:%Y-%m-%d}/"
export_orders(start, end, path) # overwrites the folder for this day
return path # only the path goes through XCom
@task
def load(path: str) -> int:
return warehouse.replace_partition("orders", path) # delete + insert for the day
@task
def check(rows: int) -> None:
if rows == 0:
raise ValueError("no orders loaded for this interval")
check(load(extract()))
orders_daily()XCom, idempotency and task design
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What is XCom and what are its limits? | Data passing | A small key-value store in the metadata database that lets tasks share values. Pushing large data bloats the database and slows the UI; pass a pointer such as a table name or object storage path, or configure a custom XCom backend. |
| What makes a task idempotent? | Safe reruns | Running it twice for the same interval leaves the same end state. Overwrite or MERGE into the interval's partition instead of appending, and derive dates from the data interval, not from today's date. |
| Why is heavy code at the top level of a DAG file a problem? | Parsing cost | DAG files are parsed repeatedly. Database calls, API requests or big imports at module level slow every parse and can make the scheduler lag. Move them inside tasks. |
| How do you share secrets with tasks? | Security | Store them in connections or a secrets backend such as a vault or a cloud secrets manager, never in the DAG file or in plain Variables that the UI shows. |
| What is dynamic task mapping? | Fan-out | Calling .expand() on a task to create one mapped instance per element of a list known at runtime, such as one task per file found, instead of generating tasks in a Python loop at parse time. |
| When would you use a branch operator? | Conditional flow | When one path should run and others be skipped, for example a full reload on the first of the month and an incremental load otherwise. Downstream joins then need a trigger rule that tolerates skipped branches. |
| What are pools and priority weights for? | Resource control | Pools cap how many tasks hit a shared resource at once, such as an API with a rate limit. Priority weight decides which queued tasks get free slots first. |
| How do Variables differ from Params? | Configuration | Variables are global key-value settings stored in the database. Params are per-DAG run inputs with defaults and validation that can be set when triggering a run manually. |
Executors, retries and running Airflow
- Which executors exist and when would you pick each? LocalExecutor runs tasks as processes on the scheduler machine and suits small installs. CeleryExecutor sends tasks to a pool of long-lived workers through a broker such as Redis or RabbitMQ. KubernetesExecutor starts a pod per task, which isolates dependencies and scales to zero at the cost of pod start time.
- How do retries work? Set retries and retry_delay (optionally exponential backoff) per task or in default_args. Each retry increases the try number. Retries help with flaky networks; they only make things worse if the task is not idempotent.
- How do you get alerted on failures? on_failure_callback on tasks or the DAG, sending to chat or a paging tool, plus monitoring of the scheduler heartbeat and of DAG runs that are late rather than failed.
- What does the metadata database hold, and why does it matter? DAG runs, task instances, XComs, connections, variables and history. It is the heart of the deployment: slow queries there slow the scheduler, so old records need cleaning with the db clean command.
- How would you deploy DAG code? Bake DAGs into the image or sync them from Git, run a CI step that imports every DAG file and fails on import errors or cycles, and keep shared code in a versioned package.
- How do you test a DAG? A DagBag import test for every file, unit tests for the Python logic inside tasks, and
dag.test()orairflow tasks testto run a single task for a given date without the scheduler. - What changed in Airflow 3? A rebuilt UI, DAG versioning, assets as the new name for datasets, backfills run by the scheduler, and tasks that talk to an API server through a task SDK instead of reaching the metadata database directly. Several deprecated parameters such as
schedule_intervalwere removed in favor ofschedule.
Airflow versus Dagster and Prefect
| Question | What it tests | What a strong answer shows |
|---|---|---|
| How does Dagster differ from Airflow? | Landscape | Dagster is built around software-defined assets: you declare the tables and files a pipeline produces, and it tracks their lineage and freshness. Airflow started task-centric and added asset scheduling later. |
| How does Prefect differ? | Landscape | Prefect turns ordinary Python functions into flows and tasks with decorators and handles dynamic workflows easily, with less emphasis on fixed schedule intervals. |
| Airflow or cron? | Judgment | Cron is enough for a couple of independent scripts. Airflow earns its overhead when you need dependencies, retries, backfills, history and visibility across many jobs. |
| Airflow or a streaming system? | Fit | Airflow is for batch and micro-batch orchestration on schedules or events. Sub-minute, continuous processing belongs in a streaming engine, with Airflow at most managing deploys or periodic compaction. |
| Is Airflow an ETL tool? | Role clarity | No. It schedules and monitors work that other systems do. Transformations should run in the warehouse, Spark or a container that a task triggers, not inside the Airflow worker for large data. |
Senior and scenario questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| A new daily DAG with start_date a month ago fired 30 runs at once. | Catchup | Catchup was on and max_active_runs was high. Pause it, mark unwanted runs, set catchup off or a later start date, and cap concurrent runs if history is actually needed. |
| Tasks sit in queued state for a long time. | Capacity | Check executor slots, pool limits, parallelism and max_active_tasks settings, worker health, and whether sensors in poke mode are holding every slot. |
| A rerun of last Tuesday doubled the rows in the target table. | Idempotency | The task appends. Change it to delete-and-insert or MERGE for the interval's partition, and make the window come from the data interval. |
| The scheduler is slow to pick up changes and the UI lags. | Platform health | Look at DAG parse times, top-level code, the number of DAG files, metadata database size and missing cleanup, and scheduler resources. |
| Design orchestration for 200 tables loaded hourly from a SaaS API with rate limits. | Design | Generate tasks from configuration, use dynamic mapping, a pool sized to the rate limit, per-table incremental state, retries with backoff, and alerting on lateness, not just failure. |
| How would you trigger a DAG when an upstream team's table is ready? | Cross-team | Asset-based scheduling if both run in the same Airflow, otherwise a deferrable sensor on a completion marker or partition, with a timeout and an alert. |
Fictional example
- Interviewer
- We deployed a new daily DAG yesterday afternoon. This morning there is no run in the UI. What happened?
- Candidate
- My first question is which Airflow version and timetable we use. With a data-interval timetable, which was the default for cron schedules before Airflow 3, a start date of the deploy day means the first interval has not finished yet, so the scheduler has nothing to run until tomorrow. I would check that before anything else. If the dates are fine, I would look at whether the DAG is paused, because new DAGs can be paused on creation depending on configuration, and whether it shows an import error at the top of the UI, which would mean the scheduler never loaded it. A dynamic start date like datetime.now() would also stop it from ever running. If it is loaded, unpaused and the interval has closed, then I would check scheduler logs and whether the run is blocked by max_active_runs. To get today's data in, I would trigger a manual run for the right interval rather than changing the start date in a hurry.
How to prepare for Airflow interview questions
- Run Airflow locallyStart it with the official Docker Compose file or the standalone command, write two DAGs, and watch the scheduler create runs. Change start_date and catchup and see what appears.
- Internalize the data intervalFor daily, hourly and weekly schedules, say which interval a run covers and when it starts, under both a data-interval timetable and Airflow 3's trigger default. Most scheduling questions turn on this.
- Write one idempotent pipelineLoad a day of data, rerun it three times and confirm the target does not change. Then break it with an append and see the duplicates.
- Practice reading DAG codeFind the bugs in short DAGs: dynamic start dates, large XComs, top-level API calls, missing trigger rules after a branch.
- Know the neighborsBe ready to say what Airflow triggers (Spark jobs, warehouse SQL) and how Dagster and Prefect approach the same problem.
Airflow sits between the engines and the tables. Spark and Hadoop interview questions covers the jobs a DAG usually launches, Snowflake interview questions covers a common place the results land, and the design a job scheduler guide walks through building a scheduler like this from scratch.
Debugging a DAG aloud is a skill of its own. Natively, an AI interview assistant for Mac and Windows, keeps a transcript of a mock orchestration round, can put a suggested answer next to yours as you speak, and reads DAG code, a scheduler log or a grid view of task states from a screenshot. Pro or the free trial adds the résumé and job description you upload to its context, and the notes and transcript of each practice run are saved for review.
Questions people ask
What are common Apache Airflow interview questions?
What a DAG, operator and task instance are, how sensors and deferrable operators wait, what a data interval is, catchup versus backfill, what XCom is for, how to make tasks idempotent, and which executor to choose.
Why does an Airflow daily run start a day late?
With a data-interval timetable, the Airflow 2 default for cron schedules, a run covers a window and starts once it ends, so the run for 2 December starts early on 3 December. In Airflow 3 a bare cron string runs at the trigger time unless you choose a data-interval timetable.
Can I pass a DataFrame between Airflow tasks with XCom?
You should not. XCom values live in the metadata database by default. Write the data to storage or a table and pass its path or name instead, or configure a custom XCom backend.
What is the difference between catchup and backfill in Airflow?
Catchup is the scheduler automatically creating runs for missed intervals since the start date. Backfill is a deliberate rerun of a date range you choose, for example after fixing a bug.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
