The interview problem

Practice prompt

Build a model predicting whether an ad click produces an attributed purchase within seven days. Training runs hourly, but many purchases arrive days later. A dashboard shows conversion probability falling whenever traffic grows. Design the label pipeline, learning strategy and evaluation needed to distinguish a real decline from incomplete outcomes.

Original ML-design practice, not a reported interview. Numerical examples and operational assumptions are hypothetical. Primary research retrieved September 27, 2026.

Quick answer

A recent non-conversion may simply be an outcome that has not arrived yet. Compare cohorts at matched ages or use a justified delay model, and keep a mature-label holdout. Mixing one-day and seven-day observations can make unchanged performance look worse.

1. Specify the outcome and two clocks

The prediction is P(at least one attributed purchase within seven days of a click | features available at click time). This is a post-click probability, not conversion per impression or the causal effect of showing an advertisement. Define attribution when several clicks precede a purchase, and version that rule.

Keep event time and ingestion time separate. A purchase on day six arriving on day nine belongs to the seven-day outcome, even though the label service learns about it later. A purchase on day eight arriving immediately is outside this target. Define whether cancellations or refunds alter the label or belong to a separate value target.

Store the click time, observed follow-up, first qualifying event time if any, ingestion timestamps and label revision. “No purchase observed yet” is an observation state. It becomes a finalized negative only under the horizon and data-completeness policy.

2. Work through the apparent decline

Suppose a mature cohort of 100,000 clicks has 2,000 seven-day conversions: 2%. Historically, half of eventual seven-day conversions are visible after one day. A comparable one-day-old cohort would show about 1,000 observed conversions, or 1%, despite the same eventual rate.

If the training set contains one mature cohort of 100,000 and a recent cohort of 900,000 clicks, expected observed positives are 2,000 + 9,000 = 11,000. A naive rate is 1.1%, even though the assumed eventual rate remains 2%. Changing the age mix alone caused the apparent decline.

Dividing the recent rate by 0.5 recovers 2% in this toy example, but assumes the visibility fraction transfers to the new population. If a new product converts more slowly, the correction can be wrong. Estimate delay behavior by relevant slices and time, and distinguish behavioral delay from missing tracking events.

3. Build revision-aware labels

Use an immutable click log and deduplicated conversion stream feeding a versioned attribution join. Partition by a stable joining key, and keep enough click history for the attribution window plus the agreed arrival allowance. Upsert label state by click ID and attribution-rule version; duplicate purchase deliveries must not create repeated positive examples.

A training snapshot records both its extraction cutoff and label version. Join features as they existed at prediction time. A current customer profile may include the eventual purchase and leak the outcome into training, even if the label logic itself is correct.

Suppose operations choose seven days of behavioral follow-up plus two days of arrival allowance. This gives a nine-day mature-data lag, not a guarantee that every label is final. Monitor arrivals after the allowance and issue explicit corrections or backfills. Do not silently rewrite old benchmark labels while keeping their reported scores unchanged.

Reconcile event counts with the source system. A broken purchase connector can resemble a slower delay distribution. Track ingestion lag, join failures, attribution conflicts and revisions independently from model quality.

4. Start with a mature baseline, then earn freshness

The simplest baseline trains on mature cohorts only. Its labels are easier to audit, but the model reacts slowly to changed products or traffic. Report that freshness cost explicitly. An hourly training schedule does not make nine-day-old labels current.

A second option uses a model of conversion and delay. For illustration, let p(x) be seven-day conversion probability and F(a | x, conversion) the probability a qualifying conversion has occurred by age a, conditional on converting within seven days. Ignoring ingestion delay for this equation, an unconverted click of age a contributes likelihood 1 − p(x)F(a | x, conversion), rather than 1 − p(x). Here age is capped at seven days, so F(7 | x, conversion) = 1. The expression assumes complete observation up to that age; missing tracking or reporting delay requires an additional observation model or a verified observation cutoff.

At p = 0.02 and F = 0.5, the no-event probability is 0.99. Among clicks with no event yet, probability of a later qualifying conversion is p(1 − F)/(1 − pF) = 0.01/0.99 ≈ 1.01%. This is not the unconditional 2% probability; observing no early conversion changes what we know.

For observed event times, include the appropriate delay probability or density with the conversion probability. Flexible delay models avoid forcing every slice into one exponential shape, but need enough evidence. Conversion probability and delay can be hard to distinguish in very young cohorts. Mature data anchors the model.

Alternative correction or sampling methods can use recent data, but their assumptions, weights and duplicate handling must be explicit. Replaying an initially negative click later as a positive does not automatically undo its earlier training contribution. Compare against the mature baseline before accepting additional complexity.

5. Size state and freshness separately

At ten million clicks/day and nine days of active label state, retain about ninety million records. At 200 bytes per record, payload is 18 GB; three copies are 54 GB before indexes, logs and storage overhead. A 2% conversion rate implies roughly 200,000 qualifying positive clicks per day in steady state, not necessarily 200,000 purchase-event deliveries.

A full scan of ninety million records every hour touches 2.16 billion record instances per day. Incremental updates and partitioned snapshots reduce unnecessary scanning, but training still needs a defined population and reproducible sampling. Keep label-update throughput, training throughput and online scoring capacity as separate budgets.

The serving path uses click-time features and a versioned model to return the seven-day probability. It does not wait for a delayed label lookup. Include model age, feature freshness and calibration monitoring; hourly label updates do not require an hourly production rollout.

6. Replay history as it was knowable

Run rolling temporal backtests. At each historical training cutoff, expose only events ingested by that cutoff, train the candidate, and score later clicks using their historical features. Evaluate those predictions after the outcome and arrival windows have matured. This tests the real information constraint rather than a retrospectively cleaned dataset.

Compare log loss, calibration and ranking on the same mature cohorts. Audit the training population by click age at extraction, and break held-out results down by product, source and delay profile. Record label revisions and metric sensitivity to a longer arrival allowance. AUC alone can hide systematically underpredicted probabilities.

For current traffic, show provisional observed outcomes by cohort age alongside delay-adjusted estimates, clearly labeled as estimates. Never compare a one-day-old cohort directly with a fully matured cohort as though the labels were equally complete. Early operational guardrails remain useful even when the primary conversion result is pending.

Use a controlled rollout for product effects and wait for outcome maturity before final interpretation. If treatment changes conversion timing as well as frequency, an old delay correction can misestimate the treatment effect. Preserve mature follow-up rather than declaring a winner solely from an early modeled lift.

7. Stress the assumptions

If tracking fails, investigate the data pipeline before retraining on apparent negatives. If a new category has no delay history, use a conservative fallback or mature-data path and report uncertainty. If attribution rules change, version labels and compare under a consistent definition rather than joining incompatible targets.

Follow-ups: How would refunds change the target? Why is day-six event time different from day-nine ingestion time? What if delay depends on features? When can a recent-data correction hurt more than stale training?

Score 0–2 each for target precision, label revision design, censoring-aware learning, temporal backtesting and operational diagnosis. A strong answer offers a simple baseline and explains what evidence justifies the more complex model.

A delay shift can look like a quality collapse

Assume two cohorts each have 100,000 exposures and eventually produce 2,000 conversions: a 2% mature rate. In the first cohort, 50% of conversions are visible by day one, giving 1,000 observed conversions or 1%. In the second, only 25% are visible by day one, giving 500 or 0.5%.

The early metric falls by half despite identical eventual conversion in this constructed example. Matching cohort age is necessary, but not sufficient when the delay distribution itself changes. Track the fraction of mature conversions observed by each age and investigate event time versus ingestion time.

A delayed payment process and a broken event pipeline can initially look alike. Reconcile against the source of truth and wait for mature cohorts before concluding that the model recovered. Do not automatically double recent positives using an old delay correction: the correction fails precisely when its assumed visibility curve changes.

Original worked follow-up, reviewed October 7, 2026. Reference: Research paper: delayed feedback modeling.

Sources and next steps

The architecture, finite-horizon equations and numerical examples are original practice. For censoring fundamentals, read survival analysis.

Continue your preparation

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