Ninety Day Repeat Rate of Fans Acquired in a Championship Wave
Last updated: November 29, 2026
Quick Overview
Write SQL that labels each customer by whether their first valid order came within 14 days after their team won a championship, then compares the 90-day repeat purchase rate of that championship-wave cohort against everyone else.
Fanatics
November 29, 20260
0
0 solved
Write SQL that labels each customer by whether their first valid order came within 14 days after their team won a championship, then compares the 90-day repeat purchase rate of that championship-wave cohort against everyone else.
Fanatics acquires huge numbers of first-time buyers when a team wins a title, and marketing wants to know whether those fans stick around or are one-and-done. The screen checks first-event logic, correlated conditions against a dimension table, and a fair observation window.
What the Interviewer Expects
- Find each customer's first non-cancelled order deterministically
- Join the first order to championships on team and a date window
- Only include customers with a full 90 days of follow-up
- Count repeat customers, not repeat orders
- Explain why the comparison is descriptive, not causal
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 control for league and season so the baseline is comparable?
- How would you extend this to count purchases across Fanatics Live and collectibles?
- What would a survival curve show that a single 90-day rate hides?
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
orders(order_id, customer_id, order_ts, team_id, status) where team_id is the primary team on the order, and championships(team_id, league, won_on). Valid means not cancelled. Repeat means any l...
Approach
- Rank valid orders per customer to get the first. 2) Tag the cohort with an
EXISTSagainst championships where the first order falls in[won_on, won_on + 14 days)for the same team. 3) Keep cust...