Design Perishable Grocery Replenishment Ranges
Company: C3 AI
Role: Data Scientist
Category: ML System Design
Difficulty: medium
Interview Round: Technical Screen
Design a system that recommends a replenishment quantity range for perishable grocery products at each store. Products can spoil, demand varies by day, deliveries have lead times and case-pack constraints, and both stockouts and waste are costly.
Explain the data, forecasting target, decision rule, offline and online evaluation, serving architecture, and monitoring. The output must be a range with an interpretable recommended point, not a single unexplained forecast.
### Clarifying Questions to Ask
- Is the decision made per store-SKU-day, and how often can it be revised?
- What are shelf life, lead time, minimum order, case pack, storage, and supplier constraints?
- How are lost sales and censored demand represented when inventory reaches zero?
- What relative costs or service-level targets define stockout versus waste trade-offs?
### Part 1 — Data and demand distribution
Define training labels, features, leakage controls, and a probabilistic forecast over the relevant inventory horizon.
#### What This Part Should Cover
- Sales, inventory, stockout, waste, price, promotion, calendar, weather, lead-time, and substitution signals.
- Separation of observed sales from latent demand under stockouts.
- Rolling time splits and store-SKU cold-start behavior.
- Quantiles or a full distribution rather than only a point estimate.
### Part 2 — Replenishment decision and range
Convert the forecast into a feasible order recommendation and lower-upper range.
#### What This Part Should Cover
- Inventory position, demand through lead time and shelf life, and existing aging stock.
- A cost or service-level quantile tied to underage and overage costs.
- Case-pack, capacity, minimum-order, and expiry constraints.
- An uncertainty range that has a clear operational interpretation.
### Part 3 — Evaluation, serving, and monitoring
Describe a safe rollout and system architecture.
#### What This Part Should Cover
- Forecast calibration plus decision metrics such as waste, availability, lost sales, and margin.
- Backtesting or simulation limitations and a randomized or phased field test.
- Batch feature computation, decision service, overrides, fallbacks, and audit logs.
- Drift, override, calibration, and constraint-violation monitoring.
```hint Optimize the decision, not forecast error alone
Two models with similar prediction error can create different waste and stockout costs when their uncertainty is calibrated differently.
```
### What a Strong Answer Covers
- A coherent path from censored demand data to a probabilistic decision.
- Explicit perishability and inventory constraints.
- A range whose endpoints are defined, calibrated, and actionable.
- Evaluation at both forecast and business-decision levels.
### Follow-up Questions
- How would you model substitution when one item stocks out?
- What fallback would you use for a newly launched product?
- How would a supplier's variable lead time enter the range?
- When should a store manager override the recommendation?
Overview: Design an ML replenishment system for perishable groceries. Connect censored demand, probabilistic forecasts, newsvendor costs, shelf life, order constraints, field tests, and monitoring.
Read the full C3 AI Data Scientist interview experience this question came from