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
November 29, 20260
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
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- 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 ProblemsSample Answer
Clarify the Data
activity(user_id, ds), one or more rows per active day.
Definitions for month m:
- New: active in
m, andmis the first active month. - Retained: active in
mandm - 1. - **Resurr...
Approach
LAG over only active months would compare to the previous active month, so a gap disappears. Instead:
- Distinct
(user_id, month). - Each user's first month.
- Grid: user x every month from f...