Skip to content
ML Academy

SQL and Python

Interview question

  • midlevel
  • 10 minsuggested time
  • 2Data analyst, Data scientist

Using flight_day(date, route, passengers, ...), write SQL for a 7-day rolling average of daily passengers per route. Then tell me what breaks if some dates are missing for a route.

Tests: Window functions with PARTITION BY / ORDER BY / frame clauses, the difference between ROWS and RANGE frames, and handling gaps in time series data.

Sign in to practise: answers are saved before model answers are shown.