DashPass Paid Subscriber Monthly Cohort Retention Table

Last updated: November 29, 2026

Quick Overview

Using a table of DashPass billing charges, build a cohort table showing, for each month of first paid charge, the share of subscribers who paid again in each of the following six months.

DoorDash
Data Manipulation (SQL/Python)
Data Scientist
DoorDash
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Using a table of DashPass billing charges, build a cohort table showing, for each month of first paid charge, the share of subscribers who paid again in each of the following six months.

DashPass is DoorDash's subscription and its retention drives lifetime value, so cohort tables come up often in DS onsites for the consumer and subscription teams. The interviewer looks for a correct cohort definition (first paid month, not trial start), month arithmetic, and honest handling of months that have not happened yet.

What the Interviewer Expects
  • Exclude free trial and failed charges from the cohort definition
  • Compute month offsets correctly across year boundaries
  • Build a cohort by offset grid so months with zero retained still appear
  • Cut off offsets whose month is not complete yet
  • Distinguish this paid-month retention from 'had an active subscription' retention
Key Topics to Cover
cohort analysis
retention
date arithmetic
generate_series
subscriptions
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 change the definition to count a user as retained if they were active at any point in month k, including paused months?
  • How would you compare retention for users who joined through a free trial versus a direct paid signup?
  • Users who churn and resubscribe show up as retained at month 5. Is that what the business wants?
  • How would you turn this into a single 'month-3 retention' metric trended over time?
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

Assume dashpass_charges(user_id, charged_at, amount_usd, status) with one row per billing attempt. Trial months create $0 rows and card failures create status = 'failed' rows; neither counts as pa...

Approach
  1. Collapse to distinct user by pay month. 2) Cohort month is each user's first pay month. 3) Month offset is the difference in year times 12 plus the difference in month. 4) Build a grid of cohort by...

Submit Your Answer
Markdown supported