The interview problem

Practice prompt

An online retailer wants to reduce avoidable product returns by showing sizing or compatibility guidance before checkout. Design the prediction and intervention system.

Original practice, not a reported company interview. All scenarios and worked numbers are illustrative. Interview date: not applicable. Sources retrieved September 30, 2026.

1. Scope and assumptions

Predict a return within 30 days using information available before purchase. Do not use the score to deny legitimate returns. The target is helpful guidance, distinct from fraud detection or demand forecasting.

2. Worked approach

matured purchases
  → pre-purchase features
  → risk + reason
  → guidance experiment
  → net outcome

Join matured purchase cohorts to return outcomes and reason codes. Record product version, displayed description, size choices and guidance exposure as of the decision. Begin with category-specific rates and a calibrated tabular baseline; add text or image features only if they improve held-out decisions.

Serve a score plus an actionable reason category to a guidance policy. Unsupported reasons should produce neutral guidance rather than fabricated explanations. Log exposure and subsequent purchases so evaluation includes customers who abandon checkout. Randomize guidance among eligible customers to distinguish prediction quality from intervention benefit.

3. Calculate the example

Suppose 10,000 eligible purchases would have a 20% return rate without guidance. If guidance reduces that rate to 17%, the absolute reduction is 3 percentage points, or 300 returns at unchanged purchase volume. At $8 avoidable handling cost each, gross savings are $2,400. If guidance also loses 100 purchases with $30 contribution each, that $3,000 loss outweighs the handling savings. A returns-only metric would recommend the wrong policy.

4. Failure cases and trade-offs

Recent purchases labeled negative before 30 days create delayed-label bias. Reason codes may describe customer convenience rather than the true defect. The intervention changes the population that purchases, so comparing observed purchasers alone can be misleading.

A product-level model is interpretable and cheap but misses individual compatibility. Personalization requires stronger data controls and evidence that it improves assistance. A high-risk prediction does not establish that the proposed guidance changes the outcome.

5. Validate the result

Use time-separated matured cohorts, hold out new products and report calibration by category. Run an intent-to-treat policy experiment measuring contribution, completed purchases and returns. Audit whether recommendations unfairly block access to support.

6. Interview follow-ups and self-review

What if customers return after 30 days? How do new products get a score?

Reward mature labels, actionable interventions, purchase-selection awareness and net-value arithmetic.

Sources and related practice

Technical reference: scikit-learn.org — Prediction metric definitions only; retail scenario, causal rollout and economics are original.

Exact publication/update date not established in this review. Retrieved September 30, 2026. This reference supports the named technical concept; the proposed workflow and examples are original, not a documented vendor implementation or interview report.

Continue with Design learning from delayed conversion labels; Distinguish prediction from causal effects.

Continue your preparation

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