Evaluate a Grocery Substitution Recommender Before Launch
Last updated: November 29, 2026
Quick Overview
When an ordered grocery item is out of stock, a model suggests a substitute for the picker. Explain which offline and online metrics you would use to decide whether a new substitution model is better than the current one.
Walmart Labs
November 29, 20260
0
0 solved
When an ordered grocery item is out of stock, a model suggests a substitute for the picker. Explain which offline and online metrics you would use to decide whether a new substitution model is better than the current one.
Substitutions are a constant part of Walmart's online grocery fulfillment, and a bad swap (salted for unsalted butter, wrong size of diapers) generates refunds and lost trust. The interviewer wants metrics that match the business outcome, awareness of biased labels from the existing policy, and a sensible launch plan.
What the Interviewer Expects
- Define success as customer acceptance and retention, not similarity alone
- Pick offline ranking metrics and explain label sources and their bias
- Segment results by category and by hard constraints such as size and dietary attributes
- Propose an online A/B test with guardrails such as refunds and picker time
- Discuss counterfactual evaluation given logged policy data
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- Acceptance logs only exist for substitutes the old model proposed. How does that bias offline evaluation?
- How would you weigh a rejected substitution against a missing item?
- What would you do if acceptance rises but refunds also rise?
- How would you evaluate for new items with no history?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
The model ranks candidate substitutes for an out of stock item; the picker usually takes the top one, and the customer can accept or reject in the app or at handoff. Outcomes we care about: acceptance...
Approach
Offline: build a test set from recent orders with logged substitution outcomes (accepted, rejected, refunded), plus explicit customer preferences ("always choose this brand"). Evaluate ranking with Hi...