Feature Engineering for Store Level Daily Demand Forecasting

Last updated: November 29, 2026

Quick Overview

You are forecasting daily unit sales for each item in each store to drive replenishment. Describe the features you would build and how you would avoid leakage.

Walmart Labs
Machine Learning
Data Scientist
Walmart Labs
November 29, 2026
Data Scientist
Technical Screen
Machine Learning
Medium

0

0

0 solved


You are forecasting daily unit sales for each item in each store to drive replenishment. Describe the features you would build and how you would avoid leakage.

Replenishment at Walmart's scale depends on item-store forecasts across a huge assortment, and the inputs include promotions, holidays, weather and local events. Interviewers check whether you know which features carry signal for retail demand, how to handle sparse slow movers, and how to keep time series features free of future information.

What the Interviewer Expects
  • Build lag and rolling window features aligned to the forecast horizon
  • Encode calendar effects including moving holidays and paydays
  • Include price, promotion and markdown features with care
  • Use hierarchical and cross item features for sparse series
  • Explain censored demand from stockouts
  • Validate with time-based backtesting
Key Topics to Cover
Lag and rolling features
Calendar and holiday encoding
Stockout censoring
Hierarchical features
Time series cross validation
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
  • How do you treat days when the item was out of stock?
  • How would you forecast a brand new item?
  • Why might a lag-1 feature be invalid for a 7 day ahead forecast?
  • How would you capture a competitor store opening nearby?
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

Forecast horizon matters: replenishment orders might be placed for deliveries 3 to 10 days out, so features must be computed as of the order date. Target is units sold per item-store-day, but sales ar...

Approach

Feature groups:

  1. History: lags at horizon h and beyond (lag h, h+7, 364), rolling means and medians over 7, 28, 91 days ending at the forecast origin, rolling zero-sales fraction.
  2. *Calendar...

Submit Your Answer
Markdown supported