Validate a Grocery Demand Forecast Before Replacing Manual Ordering

Last updated: November 29, 2026

Quick Overview

A grocery client wants to replace store managers' manual orders with a model that forecasts daily demand per product and store. How would you evaluate the model offline and decide whether it is ready to drive real orders?

Thoughtworks
Machine Learning
Data Scientist
Thoughtworks
November 29, 2026
Data Scientist
Onsite
Machine Learning
Medium

0

0

0 solved


A grocery client wants to replace store managers' manual orders with a model that forecasts daily demand per product and store. How would you evaluate the model offline and decide whether it is ready to drive real orders?

Thoughtworks data and AI engagements frequently build forecasting for retail clients and stress getting models into production responsibly (continuous delivery for ML). The interviewer looks for time-aware validation, metrics tied to business cost, comparison with the current process, and a careful rollout.

What the Interviewer Expects
  • Uses rolling-origin backtesting instead of random splits
  • Chooses metrics that survive zero sales (WAPE or MASE, not plain MAPE)
  • Compares against the managers' orders and a seasonal naive baseline
  • Translates errors into waste and stockout cost, asymmetric by product
  • Segments results by store, category and promotion periods
  • Proposes a shadow run and phased rollout with monitoring
Key Topics to Cover
Time series backtesting
Forecast metrics
Censored demand
Business cost of error
CD4ML
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • Sales are censored when a product is out of stock. How does that bias training and evaluation?
  • How would you forecast a brand new product with no history?
  • What would you monitor after launch, and what triggers retraining?
  • How would you explain a large miss to a store manager who distrusts the model?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Horizon and granularity: orders are placed two days ahead, per store and SKU, daily. Decision: order quantity, so the forecast feeds a replenishment rule. Cost: perishable waste for overstock, lost ma...

Approach

Backtest with rolling origins: train up to week t, forecast t+1 to t+2 days, slide forward over at least a year so holidays and promotions appear. Compare three candidates: seasonal naive (same weekda...


Submit Your Answer
Markdown supported

Related Questions