Build a Monthly Prime Signup Cohort Retention Matrix
Last updated: November 29, 2026
Quick Overview
Group Prime members by the month they first signed up and compute, for each of the next twelve months, the share of each cohort that had a paid Prime billing in that month.
Amazon
November 29, 20260
0
0 solved
Group Prime members by the month they first signed up and compute, for each of the next twelve months, the share of each cohort that had a paid Prime billing in that month.
A core retention question for Amazon subscription businesses such as Prime, where cohort curves feed lifetime value and pricing decisions. The interviewer checks cohort definition, month offset arithmetic, a correct denominator, and how you present the matrix.
What the Interviewer Expects
- Define the cohort by the first signup month, even for members who churned and rejoined
- Count retention from paid billing events, not from signup rows
- Compute month offset with date arithmetic, not by subtracting month numbers
- Use the full cohort size as the denominator, including members never seen again
- Pivot to a readable matrix and explain the right-censored triangle
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 separate free trial members from members who paid in month zero?
- How would you show reactivations separately from continuous retention?
- How would you compare cohorts acquired through Prime Day promotions?
- How do you avoid counting future cells for young cohorts as zero?
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
Tables:
prime_memberships(customer_id, signup_date): one row per signup, so a customer who rejoined appears twice.prime_billing(customer_id, billed_month, status): one row per monthly charge,...
Approach
cohort: first signup month per customer.activity: distinct customer and month pairs with a PAID charge.- Join and compute
month_kas the month difference. - Count distinct retained cus...