Build a daily demand forecast for 5,000 products across 200 stores. How would you approach it?
What the interviewer wants to hear
- Understand use: decision, horizon, granularity, cost of errors
- Baselines: seasonal naive, moving averages
- Global models (gradient boosting) with lag, calendar, price, promo features
- Handle intermittent demand, new products, stockouts
- Time-based backtesting and probabilistic forecasts
Model answer
First I learn how the forecast is used: if it drives store replenishment, I need daily forecasts per product and store, a horizon matching lead times, and the cost of overstock versus stockouts. I build simple baselines first, like seasonal naive using the same weekday last week. Then I train one global model, often gradient boosting, across all series with features such as lagged sales, rolling averages, day of week, holidays and festivals, price, promotions and store attributes. A global model shares patterns, which helps sparse products. I treat stockouts carefully, since zero sales during a stockout are not zero demand. For new products I use similar-item features. I evaluate with rolling time-based backtests using metrics like weighted MAPE, and produce quantile forecasts because replenishment needs uncertainty, not only a point estimate.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Data Scientist questions
- An A/B test shows a significant 3% increase in conversion but a significant 2% drop in average order value. What do you do?
- Leadership wants to know the effect of a loyalty programme that launched for everyone last year, with no experiment. How do you estimate it?
- Why are A/B tests tricky in a two-sided marketplace like a ride-hailing app, and how would you handle it?
- Daily active users dropped 8% overnight. How do you investigate?
- Marketing wants to send a discount only to customers it will actually persuade. How would you build and validate that targeting model?
- A model that looked strong offline performs much worse a month after launch. How do you investigate?
- When would you use survival analysis instead of a binary churn classifier, and how would you set it up?
- You must estimate the effect of a feature that users chose to adopt, using propensity score methods. What can go wrong and how do you guard against it?
- The business wants to know how demand responds to price for thousands of products. How would you estimate price elasticity?