Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started
Airflow DAG and SQL
00:00
5 left

Airflow DAG and SQL

HardSQL · PostgreSQL

Problem

Describe how you would build an Airflow DAG to run SQL transformations, including how you would schedule and validate the results.

Explain the task dependencies, scheduling approach, retry and failure behavior, idempotency strategy, and SQL checks used to verify the transformed data.

Output

  1. Produce one row per order date and customer country for qualifying orders.
  2. Return order_date, country, order_count, and gross_revenue.
  3. Include delivered and shipped orders, map missing countries to Unknown, and order by date and country.

Schema

raw_orders
ColumnTypeDescription
order_idPKINTUnique order identifier
order_dateDATEDate on which the order was placed
customer_idINTCustomer associated with the order
statusVARCHAR(20)Current order status
amountDECIMAL(10,2)Order monetary amount
customers
ColumnTypeDescription
customer_idPKINTUnique customer identifier
countryVARCHAR(50)Customer country
Tablesraw_orderscustomers
Interviewer

Your question is Airflow DAG and SQL. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.