Skip to main content

Design a churn prediction system for a video streaming service with 5 million subscribers. Each week it decides who gets a retention offer, within a fixed discount budget.

System design · Intermediate 3

Short answer

Clarify the definition of churn, the prediction window and the offer budget. Then: features from viewing, payments and support contacts, labels built with a time cutoff, a gradient-boosted classifier with calibrated probabilities, weekly batch scoring, targeting users the offer can actually change (uplift), a holdout group with no offer, and monitoring.

Deeper answer

Start with definitions. Churn could mean cancelling, not renewing, or going inactive. Pick a window, such as churn in the next 30 days, and predict early enough to act.

Data and labels: take a snapshot date, build features only from data before it, and label whether the user churned in the window after it. Features include watch time trends, days since last session, plan type, payment failures and support tickets. A gradient-boosted classifier is a strong start. Calibrate its probabilities, because they are used with money. Scoring runs as a weekly batch job and writes a list for the campaign system.

The key trade-off is who to target. The highest-risk users may leave anyway, and some users would stay without a discount. The offer should go where it changes the outcome, which is uplift modelling, trained from a randomised experiment. Evaluate offline with precision in the top group and calibration on a time-based split. Online, keep a random holdout group that gets no offer, and compare retained revenue. At scale, the first problem is feedback: offers change behaviour, so later training data is biased.

What a strong answer covers

Answer it out loud in the mock interview about 2.5 min

Follow-ups to expect

Common mistakes

Learn it

Classification

Practice System design questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.