Monthly Growth Accounting: New, Retained, Resurrected and Churned Users

Last updated: November 29, 2026

Quick Overview

From a daily activity table, compute for each month the number of new, retained, resurrected and churned users, and verify that new plus retained plus resurrected equals monthly active users.

TikTok
Data Manipulation (SQL/Python)
Data Scientist
TikTok
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Hard

0

0

0 solved


From a daily activity table, compute for each month the number of new, retained, resurrected and churned users, and verify that new plus retained plus resurrected equals monthly active users.

Growth accounting is a standard lens for TikTok's user growth reviews, because flat MAU can hide heavy churn offset by resurrection from re-engagement campaigns. The interviewer checks that you build a user-by-month grid so inactive months exist as rows, label transitions with LAG, and validate the identity.

What the Interviewer Expects
  • Collapse activity to distinct user-months
  • Build a grid of every month from each user's first month so inactivity is explicit
  • Label states with LAG on the activity flag
  • Check the identity MAU = new + retained + resurrected
  • Discuss grid size and how to avoid materializing it at scale
Key Topics to Cover
growth accounting
LAG
user-month grid
resurrection
quick ratio
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you compute the quick ratio and what does a value below 1 mean?
  • How would you do this weekly and why are weekly numbers noisier?
  • How would you avoid a full user-by-month grid for hundreds of millions of users?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

activity(user_id, ds), one or more rows per active day.

Definitions for month m:

  • New: active in m, and m is the first active month.
  • Retained: active in m and m - 1.
  • **Resurr...
Approach

LAG over only active months would compare to the previous active month, so a gap disappears. Instead:

  1. Distinct (user_id, month).
  2. Each user's first month.
  3. Grid: user x every month from f...

Submit Your Answer
Markdown supported