Monthly Cohort Retention for QuickBooks Online Paying Subscribers
Last updated: November 29, 2026
Quick Overview
Using a payments table of subscription charges, write SQL that groups companies by the month of their first successful payment and reports, for each cohort and each month offset, how many companies paid and what share of the cohort that is.
Intuit
November 29, 20260
0
0 solved
Using a payments table of subscription charges, write SQL that groups companies by the month of their first successful payment and reports, for each cohort and each month offset, how many companies paid and what share of the cohort that is.
QuickBooks Online is a subscription business, so paid retention by cohort is a metric Intuit analysts and data scientists build constantly. The interviewer looks for correct cohort assignment, month arithmetic that crosses year boundaries, and a denominator taken from the full cohort rather than survivors.
What the Interviewer Expects
- Define the cohort as the first successful payment month, excluding failed or refunded charges
- Compute month offsets that work across year boundaries
- Count distinct companies so multiple charges in a month count once
- Use the cohort size as the denominator
- Mention right-censoring for recent cohorts
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 revenue retention (net dollar retention) instead of logo retention?
- A company pauses for two months and returns. How does that show up and is it what the business wants?
- How would you separate retention by plan tier (Simple Start, Essentials, Plus, Advanced)?
- How would you present this to leadership to compare the latest pricing change?
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
payments(company_id, paid_at timestamp, amount_cents, status) with status in (succeeded, failed, refunded). I treat a company as retained in a month if it has at least one succeeded charge tha...
Approach
- Filter to succeeded charges and truncate to month.
- Cohort month per company with
MIN. - Month offset:
(year diff) * 12 + (month diff), which is safe across December to January. - Count dis...