Skip to content
ML Academy

Analyticsdraft — in review

Interview question

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

Your customer dimension is a Type 2 slowly changing table customer_scd(customer_id, tier, valid_from, valid_to) with valid_to exclusive and 9999-12-31 for the current row. An analyst reports average booking revenue by loyalty tier by joining bookings to the dimension on customer_id and filtering to the current row. A colleague says the numbers are misleading. Who is right, and how should the query look?

Tests: Point-in-time (as-of) joins on slowly changing dimensions, interval boundary conventions, handling unmatched rows, and spotting fan-out from overlapping intervals.

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