The interview problem

Practice prompt

You want to predict time from trial signup to first paid subscription. Some users have not converted when the dataset is extracted, and newer users have shorter follow-up. Explain how to represent these observations, estimate a conversion curve and evaluate a model without treating every incomplete record as a permanent negative.

Original fundamentals practice, not a reported interview. This example concerns software subscriptions. All observations are hypothetical. Technical documentation retrieved September 27, 2026.

Quick answer

Survival analysis models time until an event while accounting for incomplete observation. Right-censored records say the event has not been observed up to a known time; they are not permanent negatives. Define the event, time origin and censoring assumptions before estimating conversion or churn.

1. Define the clock and event

Choose time zero, the event and the population before modeling. Here time zero is trial signup, and the event is the first completed paid subscription. A failed payment attempt is not the event. Decide how duplicate accounts, refunds and later re-subscriptions are handled; a first-event model does not automatically model recurrent events.

Let T be event time and C the time observation ends. Store observed duration Y = min(T, C) and an indicator of whether conversion was observed. A user followed for three days without converting tells us that T exceeds three days, not that T is infinite or that conversion never occurs.

Administrative extraction creates right censoring. Deleting censored rows selects observed converters, generally biasing time estimates toward earlier events. Assigning the censoring time as the event time instead invents conversions that did not happen.

2. Compute a Kaplan–Meier example

Suppose five users enter observation at their own signup time. In elapsed days, A converts on day 2, B is censored on day 3, C converts on day 4, D converts on day 6 and E is censored on day 8. There are no tied times and no delayed entry in this example.

The survival function S(t) is the probability of remaining unconverted beyond t. The Kaplan–Meier estimate multiplies 1 − d/n at each event time, where n is the number still observed and event-free immediately before that time and d is the number of events then.

At day 2, all five are at risk and one converts: S becomes 4/5 = 0.8. B leaves observation on day 3 without causing a drop in the curve. Immediately before day 4, only C, D and E remain at risk, so S becomes (4/5) × (2/3) = 8/15 ≈ 0.5333. At day 6, D and E are at risk; after D converts, S becomes (8/15) × (1/2) = 4/15 ≈ 0.2667.

Estimated cumulative conversion by day 6 is 1 − S(6) = 11/15 ≈ 73.33%. The raw fraction of observed conversions, 3/5 = 60%, ignores unequal follow-up. The survival estimate is not a claim that 3.67 of these five specific people actually converted: it estimates a population probability under assumptions, with substantial uncertainty in this tiny sample.

The estimated median event time is day 6, the first event time where S is at most 0.5. If the curve never crosses 0.5 during supported follow-up, report that the median is not estimable there instead of inventing a later time.

3. Ask why observation ended

The ordinary Kaplan–Meier interpretation needs noninformative censoring: among users still event-free at a given time, censoring must not select users with systematically different future event times. Conditional methods can account for measured predictors, but they still require an appropriate censoring assumption given those predictors.

Extraction at a fixed calendar date may look harmless, yet recent signup cohorts could behave differently after a product change. Short follow-up is then associated with a different conversion distribution. Stratify or model calendar cohort and evaluate the assumption rather than calling all administrative censoring automatically independent.

Tracking loss is another concern. If high-intent users disappear from tracking because they move to a different device, censoring may depend on future conversion. A survival library cannot repair missing identity linkage by itself. Investigate the data process, improve observation and conduct sensitivity analysis where the missingness mechanism remains uncertain.

4. Move from a curve to conditional predictions

Start with cohort-level curves, then consider conditional survival models if features justify them. The desired output may be probability of conversion within 7 or 30 days, rather than one exact predicted date. For a user known to remain unconverted beyond day s, a coherent conditional probability of conversion by later day t is 1 − S(t)/S(s), when S(s) is positive and the curve applies to the user's information.

In the toy curve, estimated conversion between days 4 and 6 conditional on remaining unconverted beyond day 4 is 1 − (4/15)/(8/15) = 0.5. This conditioning differs from the unconditional 73.33% conversion estimate by day 6.

A hazard describes event intensity among those still event-free; it is not the cumulative probability of conversion. A Cox proportional-hazards model assumes covariate hazard ratios remain constant over time. Check whether that assumption is plausible, or use a suitable alternative. A hazard ratio is not a risk ratio or a direct change in conversion probability.

Use only features available at the prediction time. A support interaction occurring after signup cannot be a signup-time feature. If predictions update over time, define landmarks or another supported time-varying design and rebuild the risk set accordingly.

5. Evaluate at horizons the data can support

Use temporal validation to reflect deployment, and keep related accounts together where needed. For a 30-day binary outcome, users observed without conversion for only three days do not yet have a known 30-day label. One simple baseline is evaluating mature cohorts, while recognizing that they may differ from the current population.

Survival-specific evaluation can account for censoring under its own assumptions. A concordance statistic measures ordering on comparable observations, not calibrated 30-day probabilities. Report horizon-specific calibration and an appropriate censored-data scoring method when probability quality matters. Weighting by observation probability becomes unstable where few users remain observable.

Show numbers at risk and uncertainty with curves. The tail may be supported by only a handful of users. Do not extrapolate a flat final Kaplan–Meier segment indefinitely as proof that remaining users will never convert. Longer-horizon claims need more follow-up or explicit model assumptions.

6. Distinguish censoring from competing events

If a permanently closed trial can no longer convert, closure may be a competing event, not merely lost observation. The business question could be probability of conversion before closure. Simply censoring closures and using one minus Kaplan–Meier can misrepresent that probability; use a competing-risk framework with a clearly defined event process.

Observation beginning after signup creates delayed entry, also called left truncation, if inclusion requires remaining event-free until entry. The risk set must reflect that entry time. Events known only to have occurred between two checks are interval-censored, a different observation structure from an exact timestamp plus right censoring.

Foundation: explain why an unconverted recent signup is not a permanent negative. Senior: reproduce the risk sets and conditional probability. Staff: redesign estimation when tracking loss or competing closure depends on user behavior.

Score 0–2 each for event definition, risk-set arithmetic, censoring assumptions, leakage control and evaluation limits. Continue with data leakage and uncertainty.

Terminal cancellation changes the target

Imagine 10 accounts observed completely through day 10. On day 2, two accounts permanently cancel and can never convert. On day 5, three of the remaining eight convert. The other five stay active without conversion through day 10.

The observed conversion incidence is 3/10 = 30%. Treating the two cancellations as ordinary censoring and applying Kaplan–Meier to conversion would give 1 − (1 − 3/8) = 37.5%. That calculation removes cancelled accounts from the risk set without treating cancellation as a competing event; it does not estimate the real-world probability of converting before terminal cancellation.

For a competing-risk calculation, survival without either event after day 2 is 8/10. The day-5 conversion increment is (8/10) × (3/8) = 30%. State whether cancellation is truly absorbing: if reactivation is allowed, a multi-state model or a different endpoint may be needed. Do not infer a cancellation effect by comparing these two percentages.

Original worked follow-up, reviewed October 7, 2026. Reference: scikit-survival: survival analysis introduction.

Sources and next steps

The subscription example and calculations are original. Censoring assumptions concern how data were observed, not merely which estimator was called.

Continue your preparation

Choose a connected learning path or browse more ML fundamentals questions. Read our editorial method and attribution policy.