Home › Interview Questions › What would you include in an Airflow DAG, and what…

What would you include in an Airflow DAG, and what would you avoid adding?

🟡 Medium Conceptual Mid level
1Times asked
Oct 2026Last seen
Oct 2026First seen

💡 Model Answer

In an Airflow DAG you should include the core elements that define a reproducible, maintainable workflow: a unique dag_id, a sensible schedule_interval, start_date, and catchup flag; default_args that set retries, retry_delay, email_on_failure, and owner; a clear list of tasks (operators) with explicit dependencies (set_upstream/set_downstream or bitshift operators); tags and documentation for discoverability; and optional sensors or triggers for event‑driven execution. You should also add logging, XComs for lightweight data passing, and a clear error‑handling strategy. What to avoid: embedding heavy business logic inside a PythonOperator; hard‑coding credentials or secrets in the DAG file; using long‑running tasks that block the scheduler; creating too many parallel tasks that exceed the cluster’s capacity; using global variables that break idempotence; and adding non‑deterministic or non‑idempotent operators. Keeping the DAG declarative, lightweight, and idempotent ensures it remains maintainable and scalable.

This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.

🎤 Get questions like this answered in real-time

Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.

Get Assisting AI — Starts at ₹500