Skip to content
ML Academy

SQL and Python

Interview question

  • seniorlevel
  • 12 minsuggested time
  • 3Data analyst, Data scientist, ML engineer

You are building a training table for a churn model: one row per customer per monthly cutoff, with features such as loyalty tier and number of bookings in the previous 90 days. The customer table stores the current tier only, and bookings can be cancelled later. How do you write the SQL so the features are point-in-time correct?

Tests: Point-in-time feature construction: as-of joins against history tables, event time vs processing time, and avoiding leakage from later updates.

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