Weekly Signup Cohort Retention for New LinkedIn Members
Last updated: November 29, 2026
Quick Overview
Given members with a signup date and a daily activity table, write SQL that groups members into weekly signup cohorts and reports the share active in each of their first four weeks after signup.
0
0
0 solved
Given members with a signup date and a daily activity table, write SQL that groups members into weekly signup cohorts and reports the share active in each of their first four weeks after signup.
New member activation is one of LinkedIn's most studied growth problems, because a member with few connections in week one rarely comes back. The screen checks whether you index weeks relative to each member's own signup, keep empty cohorts and avoid censoring errors.
What the Interviewer Expects
- Defines the cohort by signup week and the week number relative to signup date
- Counts each member at most once per week
- Uses the cohort size as the denominator, including members with no activity
- Bounds the activity window to avoid scanning all history
- Flags cohorts too young to have complete week four data
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 make this a rolling retention (active in week N or later)?
- How would you cut this by signup platform or country?
- What changes if activity means a feed session rather than any login?
- How would you visualize and compare cohorts?
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
members(member_id, signup_date) and daily_active(member_id, activity_date) with one row per member per active day. Week 0 is days 0 to 6 after signup, week 1 is days 7 to 13, and so on. Cohort is ...
Approach
Compute week_n = (activity_date - signup_date) / 7 per member so weeks are relative to the member, not the calendar. Deduplicate to member and week, then use conditional counts per cohort. Join from...