Skip to main content

ML System Design: Customer LTV, Survival Modeling, and Uplift for Treatment Targeting

Design a production customer lifetime value (CLV) system for subscription and marketplace businesses — from probabilistic churn (BG/NBD, Gamma-Gamma spend), survival curves with censoring, to uplift modeling for CRM campaigns. Covers why naive regression on historical LTV leaks future information, how Shopify-style merchants use CLV for acquisition bids, and evaluation with calibrated dollar errors plus policy simulation.

55 min read 8 sections 6 interview questions
Customer Lifetime ValueBG NBD ModelGamma Gamma ModelSurvival AnalysisCensoringUplift ModelingCausal ForestCRM TargetingCalibrationShopifyProbabilistic CLVCohort Revenue

Why CLV Is a Systems Problem, Not a Regression Exercise

CLV is the discounted expected future cash contribution of a customer. Interviewers fail candidates who regress historical realized revenue as the label — that leaks the future into features unless you snapshot at cohort time.

Production CLV powers bid caps in paid acquisition, CRM send limits, and credit lines — each needs calibrated dollars, uncertainty, and freshness under right-censoring (young customers have unknown horizons).

IMPORTANT

Depth Ladder

Mid-level: Churn classifier × ARPU heuristic.

Senior: Buy Till You Die family (BG/NBD repeat purchases, Gamma-Gamma monetary), Cox baseline for subscription tenures, calibration curves.

Staff: Policy evaluation — uplift for treatment; multi-touch acquisition credit interaction; fair lending constraints when CLV affects pricing.

Clarifying Questions

01

Business model

Subscription vs transactional vs hybrid — model choice differs.

02

Definition of churn

Contract cancel vs 90d inactivity — changes survival labels.

03

Horizon

12-month vs 5-year CLV — discount rate and uncertainty explode.

04

Action use-case

Bidding, email frequency, credit — each needs different calibration.

05

Cold start

New users with one session — hierarchical partial pooling.

Probabilistic Models — BG/NBD and Gamma–Gamma Intuition

BG/NBD models repeat purchase counts while alive using latent dropout process — handles non-contractual churn where "churn" is unobserved directly.

Gamma–Gamma models spend per transaction heterogeneity — combine with BG/NBD for expected monetary value per period.

These beat raw RFM regression on sparse histories because they encode generative assumptions — interviewers at retail DS teams still expect these names.

CLV Platform — Offline Fit to Online Scoring

Rendering diagram...

Model Families — When to Use Which

FamilyData needsStrengthRisk
Heuristic ARPU × E[life]LowExplainableBiased with censoring
BG/NBD + GammaRepeat purchasesProbabilistic, sparse friendlyAssumption mismatch
Cox / survival NNContract churnHandles censoringPH assumption or black box
Global DNN on sequencesRich event logsFlexibleLeakage if labels wrong
Production pathProbabilistic baseline DNN residual on topBest of bothTwo-stage complexity
⚠ WARNING

Label Leakage

Using lifetime revenue to date as label for all users includes post-snapshot purchases in features if you are not careful — point-in-time joins are mandatory.

TIP

Interview Closer

"I'd start from churn plus spend generative models for interpretability, add hierarchical pooling for cold start, calibrate dollars on a holdout cohort, and only then layer uplift for CRM — CLV without calibration is worse than no score for bidding."

Interview Questions

Click to reveal answers