Survival Analysis And Time-To-Event Modeling
Asked of: Data Scientist
Last updated
What's being tested
Interviewers are probing whether you can translate a marketplace behavior, like riders abandoning after waiting too long, into a rigorous time-to-event problem rather than a simple binary classification or average-duration analysis. Uber cares because wait time, matching quality, cancellation, and price interact dynamically: a rider who has not yet abandoned after 2 minutes is a different risk population than one observed at request time. A strong Data Scientist should define the event, risk set, censoring mechanism, covariates, and evaluation metric, then connect model outputs to product or marketplace decisions. You are also expected to explain survival outputs in business language: “hazard increased 20% after ETA crossed 8 minutes” is more actionable than “model coefficient is positive.”
Core knowledge
-
Survival function is , the probability a rider has not abandoned by time . Cumulative distribution is , useful for statements like “15% of riders abandon within 3 minutes of seeing a long ETA.”
-
Hazard function is . For Uber, this is the instantaneous abandonment risk among riders still waiting, not the unconditional abandonment probability.
-
Right censoring occurs when the event is not observed before observation ends. A rider who gets matched, completes request, closes the app without known intent, or is still waiting at log cutoff may be censored depending on the business definition.
-
Competing risks matter when multiple terminal outcomes prevent abandonment: match accepted, rider cancels, driver cancels, request expires, or trip starts. Treating every non-abandonment as ordinary censoring can bias results if those outcomes are related to abandonment risk.
-
Left truncation, or delayed entry, happens when riders enter observation only after some elapsed wait time, such as sessions first logged after queue entry or only requests visible after a dispatch state. Use risk sets conditional on surviving until entry time.
-
Kaplan-Meier estimator estimates nonparametrically: where events occur among at risk. It is ideal for cohort curves by city, ETA bucket, surge bucket, or product surface.
-
Cox proportional hazards model estimates covariate effects without specifying baseline hazard: A hazard ratio of means 25% higher instantaneous event risk, assuming proportional hazards.
-
Proportional hazards assumption should be checked with Schoenfeld residuals, log-minus-log curves, or time interactions. If ETA matters strongly only after 5 minutes, include
ETA × time_bucketor use a discrete-time hazard model. -
Time-varying covariates are central in Uber settings: displayed ETA, surge multiplier, driver supply nearby, app foreground status, queue position, and price estimate can change during waiting. Encode intervals as start-stop rows:
(rider_id, t_start, t_end, event, covariates). -
Discrete-time survival is often practical when events are logged in seconds or minutes. Model with
logistic regression,XGBoost, or calibrated classifiers over person-period rows; works well at large scale and handles nonlinear effects. -
Model evaluation should include concordance index, time-dependent
AUC, calibration by time horizon, and business lift curves. For intervention design, also report predicted abandonment probability by 1, 3, and 5 minutes, not just global discrimination. -
Market balance metrics can use survival outputs as components: wait-time abandonment hazard, probability of match within 2 minutes, price-adjusted conversion, cancellation risk, and fulfilled-trip probability. Composite indexes should normalize by market mix and avoid double-counting correlated signals.
Worked example
For Model waiting-time abandonment via survival, start by clarifying the event: “Does abandonment mean explicit rider cancellation, app exit before match, no driver accepted within timeout, or any failure before trip start?” Then declare the time origin, usually when the rider submits a request or sees the initial ETA, and define terminal states such as match, cancellation, trip start, and observation cutoff. A strong answer would organize around four pillars: event definition and censoring, exploratory survival curves, model specification, and product interpretation.
First, propose Kaplan-Meier curves by initial ETA bucket, city, time of day, and surge status to show whether abandonment risk accelerates after specific thresholds. Second, specify a Cox or discrete-time hazard model with time-varying covariates like current ETA, elapsed wait, price multiplier, driver supply, and rider history. Third, explain that right-censored riders remain informative up to their last observed time and should not be dropped. Fourth, translate outputs into actions: if hazard spikes when displayed ETA moves from 6 to 8 minutes, Uber might test better ETA messaging, incentives for nearby drivers, or earlier re-routing.
One tradeoff to flag explicitly: a Cox model is interpretable through hazard ratios, but a discrete-time XGBoost hazard can capture nonlinearities and interactions at the cost of explainability and calibration work. Close by saying that, with more time, you would test proportional hazards, perform calibration by market, and evaluate whether interventions based on the model improve cancellation, conversion, and completed trips in an experiment.
A second angle
For Define market-only rider experience metrics, the same survival logic becomes a metric-design tool rather than a standalone model. Instead of asking “when does a rider abandon?”, you define marketplace health metrics that isolate supply-demand balance: probability of getting matched within 2 minutes, survival curve of remaining unmatched, abandonment hazard after ETA changes, and cancellation risk before pickup. The “market-only” framing means you should adjust or segment away factors outside marketplace quality, such as rider intent mix, product type, weather shocks, airport rules, or price level when the goal is to measure balance. A composite Market Balance Index could combine standardized components like P(match ≤ 2m), median_wait_time, price-adjusted conversion, and abandonment hazard, but you should justify weights and show sensitivity to city, hour, and trip type. The constraint is not just statistical fit; it is metric validity, interpretability, and whether local operations teams can act on the signal.
Common pitfalls
Pitfall: Treating abandonment as a plain binary label loses timing information.
A tempting answer is “build a classifier predicting whether the rider cancels.” That ignores that a rider who waits 30 seconds and a rider who waits 9 minutes contribute very different evidence; survival modeling uses the full risk process and handles riders whose outcomes are only partially observed.
Pitfall: Calling every non-abandonment case “censored” without checking the business process.
If a rider gets matched quickly, that is not random censoring; it is a competing marketplace outcome related to driver supply and ETA. A better answer acknowledges competing risks and either models cause-specific hazards or defines the estimand carefully, such as abandonment before match.
Pitfall: Over-indexing on formulas and under-explaining product interpretation.
Interviewers do not just want and . They want to hear how a hazard ratio, survival curve, or time-horizon probability would change marketplace decisions, metric dashboards, experiment guardrails, or rider experience interventions.
Connections
This topic often pivots into causal inference, especially whether reducing ETA causes lower abandonment versus merely correlating with higher supply. It can also connect to experiment design, marketplace metrics, calibration, ranking/model evaluation, and segmentation analysis by city, hour, rider tenure, or trip type.
Further reading
-
Cox, “Regression Models and Life-Tables” (1972) — the original proportional hazards paper and foundation for hazard-ratio interpretation.
-
Kleinbaum and Klein, Survival Analysis: A Self-Learning Text — practical coverage of censoring, Cox models, diagnostics, and interpretation.
-
Cam Davidson-Pilon, lifelines documentation — accessible Python examples for
KaplanMeierFitter,CoxPHFitter, and time-varying survival data.
Featured in interview prep guides
Practice questions
Related concepts
- ETA Evaluation And PredictionAnalytics & Experimentation
- Statistical Inference, Regression, And ProbabilityStatistics & Math
- Queueing Theory, Probability, And DistributionsStatistics & Math
- Predictive Modeling For Delivery And Marketplace DecisionsMachine Learning
- Cohort, Funnel, Retention, And Churn Analysis
- Cohort, Funnel, And Retention Analysis