Learning on Web Dev Open is free for all.

Interview Prep · ML System DesignDesign demand forecasting
← ML System Design

Design demand forecasting

Medium45 minFree, no account

A forecast whose errors cost different amounts in each direction, evaluated by a split nobody gets right.


The question

Design the system that forecasts how much of each product each warehouse will sell next week, to drive restocking.

100,000 products, 50 warehouses.

Functional
  • A weekly forecast per product per warehouse, with an uncertainty range.
  • Handle new products with no history and products with intermittent demand.
  • Forecasts must roll up consistently to region and national totals.
Non-functional
  • 5M series, refreshed daily.
  • Over-forecasting costs holding and waste; under-forecasting costs a lost sale.
  • Buyers must be able to see why a number changed.
45:00Commit to an answer before you open the solution. Reading it first teaches you to recognise good answers, which is not the skill being tested.

Stuck?

0 of 3 hints taken

The worked solution

written by a person · not a grade

Score yourself

0 of 5 marked
  • Rolling-origin backtesting with a latency gap, not a random split30
  • Asymmetric, category-specific loss via quantiles25
  • A global model with a stated baseline, and intermittent demand handled separately20
  • Hierarchical reconciliation so levels agree15
  • Noticed censoring from stock-outs10

We run no AI here and nothing on this page grades you. The score is yours, and the useful number is the one you get on the same problem a month from now, cold.

kept in this browser only