The interview problem
A retailer launches 2,000 new SKUs each month across 100 stores. Design forecasts for each product's first eight weeks, before it has sales history and as early observations arrive. Supply planners need uncertainty conditional on the planned distribution and promotion schedule. Explain analog selection, evaluation, updates and failure handling.
Original ML-design practice, not a reported company interview. Numerical assumptions are hypothetical. Technical sources retrieved September 27, 2026; interview date not applicable.
1. Separate demand rate from launch exposure
Define the output as a distribution of units demanded per SKU, store and day, conditional on price, promotion, availability assumptions and planned distribution. Distinguish this from fulfilled sales and from an inventory order. If a product is listed in only ten stores, multiplying its observed total by a historical nationwide launch curve without adjusting coverage is misleading.
Record launch age as well as calendar date. Week two of a launch during a holiday may differ from week two in an ordinary month. Decide how returns, cancellations, preorders and store closures enter the target. Keep gross demand and net sales separate when their operational meanings differ.
The worked example assumes fully available products and treats sales as demand. Outside that assumption, stockouts censor observations and require a separate observation model or qualified labels. A zero on an unlisted store-day is not evidence of zero customer interest.
2. Build a forecast that can be reproduced
catalog + launch plan + price/promotion + store exposure
↓
point-in-time features and eligible historical launch cohorts
↓
analog baseline → pooled model → conditional scenarios
↓
daily sales-quality checks and new-product updates
↓
immutable forecast vintage → replenishment decisions
↓
launch-cohort evaluation and calibration monitoringA forecast vintage records when it was issued, what data were available, its model version and the plan it assumed. A revised promotion schedule creates a new vintage instead of overwriting the earlier forecast. This lets planners distinguish model error from a changed launch plan.
Track event time and available-at time. A corrected transaction can have an old event date but arrive after a forecast was made. Backtesting with the corrected value before it was available leaks information. Version analog membership and feature transformations too.
3. Start with defensible comparable launches
Compare several prior launches using category, use case, price position, package size, channel, store coverage, season and promotion regime. Document important differences as well as similarities. A visually similar package need not have similar demand, and a famous successful launch is not necessarily the best reference.
Use launch-age-aligned rates per eligible store-day rather than raw totals when exposure differs. Include failed and discontinued launches under a declared target. Restricting the training set to products still sold today creates survivorship bias. Do not use the new product's eventual sales to decide which historical analogs were “closest.”
A transparent baseline is a weighted combination of comparable rates or launch curves. Compare it with a pooled count model that shares information across products while modeling launch age and exposure. A hierarchical model can let categories and products differ without fitting a fragile independent model to each new SKU.
If no analog is credible, return a documented range of conditional scenarios and flag weak evidence. Recommend staged inventory commitments where feasible. A nearest-neighbor system always returning a match is not proof that the match is useful.
4. Construct an explicit prelaunch baseline
Suppose three comparable, unpromoted, fully available launch cohorts average 4, 6 and 10 units per store-day. Choose illustrative weights of 0.5, 0.3 and 0.2 before observing this launch:
baseline rate = 0.5 × 4 + 0.3 × 6 + 0.2 × 10
= 5.8 units per store-dayWeights should be selected and evaluated on earlier launches, not tuned after seeing the target product's outcome. For a simple updating example, let the unpromoted rate λ have a Gamma prior with shape 29 and rate 5:
E[λ] = shape / rate = 29 / 5 = 5.8 Var(λ) = shape / rate² = 29 / 25 = 1.16
This is the rate parameterization, not the scale parameterization. The prior strength is an explicit illustrative assumption equivalent to five units of exposure in the update. It is not determined by the three weighted means alone. Check its predictive spread on held-out launches; a narrow prior can transfer confidence that the analog evidence does not justify.
5. Update after early promotional sales
The new product records 72 units over six fully available store-days, all under a promotion. For this calculation only, assume a known promotion multiplier of 2 and independent Poisson observations conditional on one constant baseline rate λ. Exposure is measured in store-days, adjusted by the multiplier.
effective baseline-equivalent exposure = 6 × 2 = 12
likelihood for total sales: Y | λ ~ Poisson(12λ)
prior: λ ~ Gamma(shape=29, rate=5)
posterior: λ | Y=72 ~ Gamma(shape=29+72, rate=5+12)
= Gamma(shape=101, rate=17)
posterior mean = 101 / 17 ≈ 5.9412 units/store-dayThe update follows because the Poisson likelihood contributes a factor proportional to λ to the power of the observed count and an exponential term with the added exposure. Combining those terms with the Gamma prior adds counts to shape and exposure to rate.
Next week, all 100 stores will carry the product for seven days without promotion. Assume this exposure and rate remain applicable:
future exposure M = 100 × 7 = 700 store-days expected demand = 700 × 101 / 17 ≈ 4,158.82 units naive raw launch extrapolation = 700 × (72 / 6) = 8,400 units
The raw extrapolation carries the promotional rate into an unpromoted week. The conditional model predicts roughly 4,159 units instead. Expected demand can be fractional; the downstream inventory decision must choose whole units using its costs and constraints rather than treating the mean as an automatic order.
6. Keep predictive uncertainty and scenario uncertainty separate
For future count D with D conditional on λ distributed as Poisson(Mλ), the law of total variance gives:
Var(D | observations) = E[Var(D | λ)] + Var(E[D | λ]) = M × α/β + M² × α/β² M=700, α=101, β=17: mean ≈ 4,158.82 variance ≈ 175,404.50 standard deviation ≈ 418.81 units
Integrating a Poisson rate over this Gamma posterior gives a negative-binomial predictive distribution. Compute its quantiles or simulate from the posterior and then the conditional count distribution. For each simulated future, draw the shared λ once and use it across that future’s store-days. Drawing an independent λ for every store-day incorrectly removes the shared rate uncertainty. Store-day quantiles also cannot generally be summed to obtain a quantile of total demand. Do not turn the standard deviation into a claimed calibrated interval without checking the model and the intended tail probabilities.
This calculation includes Poisson count noise and uncertainty in the shared rate. It excludes uncertain promotional lift, changing launch-age effects, additional store dependence and analog mismatch. The future exposure is assumed known. The resulting distribution is conditional on these assumptions, not a complete accounting of business uncertainty.
Now repeat the update assuming a promotion multiplier of 1.2:
effective exposure = 6 × 1.2 = 7.2 posterior shape = 101 posterior rate = 5 + 7.2 = 12.2 next-week expectation = 700 × 101 / 12.2 ≈ 5,795.08 units
The same observed sales imply a higher baseline when less of the launch rate is attributed to promotion. These two forecasts are conditional alternatives; they are not estimated scenario probabilities. With only promotional observations, baseline demand and lift are not separately identified without outside evidence or additional assumptions.
Promotion allocation is often selective. Merely logging campaigns does not make their observed relationship with sales causal. Use defensible experimental evidence where available, or explicitly document the lift assumption and sensitivity. Do not label arbitrary optimistic and pessimistic scenarios a 95% prediction interval.
7. Extend the toy model carefully
The constant-rate example makes the update transparent. A production model should compare this baseline with launch-age curves, store effects, category pooling, price and promotion covariates. Allow overdispersion where a Poisson model is too restrictive. Estimate prior strength from earlier launches with separate validation, and propagate uncertainty in uncertain covariates when the decision requires it.
Do not add every possible feature immediately. A pooled model that improves ordinary launches but fails badly on new categories may be unsuitable for the highest-risk decisions. Monitor novelty and evaluate a fallback policy explicitly. An embedding can help retrieve analogs, but its similarity score is not a calibrated forecast interval.
Product demand also differs from incremental category demand. A new variant may displace another SKU. Forecasting the new item's sales alone cannot establish the launch's incremental business benefit. Use substitution evidence or category-level analysis for that separate question.
8. Backtest entire launches at realistic decision times
Use chronological launch cohorts. Train only on evidence available before a held-out launch, then issue simulated day-zero, day-three and day-seven forecasts with the corresponding information. Group closely related variants when necessary so sister products do not reveal held-out outcomes through features or aggregates.
Compare category baselines, analog forecasts and the pooled model on the same launch cohorts and decision horizons. Measure signed bias, absolute error, quantile loss and interval coverage. Report results by novelty, category, promotion regime and rollout size. Aggregate accuracy can conceal undercoverage for precisely the launches with the least evidence.
Avoid percentage error measures that fail at zero. Evaluate inventory consequences under declared costs, lead times and service requirements; a lower average forecast error does not automatically imply a better replenishment policy. Sales during stockouts cannot directly validate unconstrained demand.
Keep failed and discontinued launches in the evaluation population under a clear definition. If the intended target becomes demand under the realized distribution plan, say so; do not silently compare one model under full availability with another under reduced availability. Retain the forecast's assumed plan so outcome differences can be interpreted.
9. Size forecast storage by cohort and vintage
For one monthly cohort, assume a full 56-day forecast grid for every product-store pair and three quantiles per point:
2,000 products × 100 stores × 56 days = 11.2 million points 11.2 million × 3 quantiles = 33.6 million numeric values 33.6 million × 8 bytes = 268.8 MB per vintage 30 full vintages = 8.064 GB of numeric values
These decimal figures exclude keys, metadata, indexes, replication and intermediate features. They also cover only one cohort. A daily refreshed rolling horizon can retain the same grid size; a fixed launch-end horizon shrinks as time passes. State which policy applies. Older active cohorts increase the total.
Batch forecasts by category or store group and cache invariant features. Publish a manifest with expected coverage and versioned plan inputs. A failed partition should remain visibly missing or use a labeled prior vintage under a defined policy, rather than mixing versions without notice.
10. Handle misleading early evidence
| Failure | Why it matters | Response |
|---|---|---|
| Incorrect store-day exposure | Rate is distorted even when sales counts are correct | Validate listing, open hours and availability boundaries |
| Launch promotion changes | Forecast conditions no longer match the plan | Issue a new vintage and retain the old assumptions |
| Stockouts during a successful launch | Observed sales understate demand | Use availability-aware observations and flag uncertainty |
| Duplicate or late sales | Early updates overreact to bad counts | Deduplicate and version corrections by available-at time |
| Unrepresentative analogs | Pooling transfers systematic error | Audit cohort selection and validate a weaker-prior fallback |
| Correlated store outcomes | Independent-observation assumptions overstate information | Model shared effects and check cohort-level coverage |
Human overrides should record the reason, assumed scenario and expiry. Evaluate overrides against the same information available at the time. A management sales target is not a forecast simply because it is entered into the planning system.
Trade-offs and follow-ups
- Why pool across products? It supports zero-history forecasts, but poor analogs can transfer bias. Validate both the mean and the strength of borrowing.
- Why not trust the first few days completely? They may be promotional, geographically selective, censored or dominated by preorders.
- What if the launch is unlike anything historical? Expose the evidence gap, use conditional scenarios and reduce irreversible inventory commitments where possible.
- Should an order equal the posterior mean? No. Use the predictive distribution with underage/overage costs, lead time and operational constraints.
- How do we know the model improved? Compare held-out launch cohorts at matching decision times, including calibration and inventory outcomes.
Self-review rubric
A strong answer defines exposure and the forecast target, selects analogs without outcome leakage and updates forecasts using explicit assumptions. It distinguishes promotion effects from baseline demand and conditional prediction intervals from scenarios. An excellent answer handles survivorship, point-in-time features, uncertainty in plan inputs, cannibalization and the difference between a forecast and an inventory decision.
Sources and attribution
- Forecasting: Principles and Practice, section 6.4 — systematic forecasting by analogy using multiple comparisons.
- Section 6.5: Scenario forecasting — scenarios and contingency planning.
- Book edition and update information — Hyndman and Athanasopoulos, third edition, 2021.
Retrieved September 27, 2026. The book reports an online update on September 16, 2026; individual section update dates are not established. The architecture, Gamma–Poisson derivation, numerical assumptions and interview scenario are original practice, not copied solutions or reported company questions.
Continue your preparation
Choose a connected learning path or browse more ML system design questions. Read our editorial method and attribution policy.