๐งฌ The Question That Built Billion-Dollar Companies.
Airbnb. Duolingo. Notion. Every product leader at every growth company obsesses over one number above all others: Day-30 retention.
You have been hired as the first data scientist at a fast-growing SaaS startup. The investors are asking hard questions in the board meeting happening right now, upstairs. Your founder rushes down and hands you a laptop. The question on the slide deck is:
'Of the users who signed up in January 2024, what percentage were still active 30 days later?'
This is cohort retention analysis โ the technique that separates product analytics from basic reporting. It requires matching each user's signup date to their subsequent activity, calculating the gap, and computing a survival rate.
Your task: Find all users who signed up in January 2024. For each, determine if they had any activity (a login) within 30 days of signup. Return the cohort_month, total_users, retained_users, and retention_rate as a percentage rounded to 1 decimal place.
users Table:
| Column Name | Type |
|---|---|
| user_id | integer |
| name | text |
| signup_date | text |
logins Table:
| Column Name | Type |
|---|---|
| login_id | integer |
| user_id | integer |
| login_date | text |
Expected Outcome (Illustrative Sample):
| cohort_month | total_users | retained_users | retention_rate |
|---|---|---|---|
| 2024-01 | 6 | 5 | 83.3 |
The board meeting ends in 20 minutes. The slide is blank. Go.