0Pricing
SQL Interview Prep · Lesson

Day-N and Rolling Retention

The difference between classic, rolling, and bounded retention definitions.

Why Retention Has Multiple Definitions

An interviewer will rarely just say "compute retention". The sharp follow-up is: which retention? The same data yields very different numbers depending on the definition.

The three you must know: Day-N (classic) retention, rolling (unbounded) retention, and bounded-window retention. Knowing the difference, and asking which one the business wants, is itself the skill being tested.

Day-N (Classic) Retention

Day-N retention asks: was the user active on exactly day N after their first action? Day-1, Day-7, and Day-30 are the canonical mobile-app metrics.

The key word is exactly. A user active on day 6 and day 8 but not day 7 is not Day-7 retained under the classic definition. This precision is what makes the count strict and the curve jagged.

All lessons in this course

  1. Defining a Cohort by First Action
  2. Building a Retention Matrix
  3. Day-N and Rolling Retention
  4. Churn and Resurrection Queries
← Back to SQL Interview Prep