Time series forecasting
- ML fundamentals
- Specialist topic or differentiator
- About 2 h 30 min to learn
- 3 vetted resources
What this topic covers
How to forecast and, above all, how to evaluate a forecast honestly. Start from simple baselines (the mean, naïve, seasonal naïve and drift methods), split train and test by time rather than at random, and backtest with a rolling forecasting origin so every prediction uses only the past. Then compare two families: ARIMA, which models one series’ autocorrelation after differencing it to stationarity, and gradient boosting on lag and rolling-window features, which learns one model across many series and exogenous inputs. Interviewers check that you never leak the future into training, can pick an error measure that works across series of different scales (MASE rather than MAPE near zero), and can say when each model family fits the problem.
Builds on
You’re ready when you can
What interviewers check, from the resources below.
- Name the four simple benchmark methods and when seasonal naïve is the one to beat
- Explain why a time series test set must come after the training data
- Describe evaluation on a rolling forecasting origin and what it adds over a single split
- Say why MAPE breaks down near zero and what MASE compares against
- Build lag and rolling-window features with a shift so no feature uses the value being predicted
- Explain why a shuffled split overstates accuracy for a forecasting model
- Configure TimeSeriesSplit and say what its gap parameter protects against
- Use quantile loss to produce a prediction interval from gradient boosting
- Explain stationarity and how differencing achieves it
- Say what the p, d and q of ARIMA(p, d, q) each control
Time series forecasting interview questions
Answer out loud, then open the points a strong answer covers. All Machine learning interview questions
Why can’t you evaluate a forecasting model with a shuffled K-fold split, and what would you do instead?
- Shuffling puts future observations in the training folds, so the model effectively learns from data it would never have when forecasting, and the reported error looks better than reality.
- Backtest with a rolling or expanding forecasting origin: train only on data before each cut-off, forecast the next horizon, and average the error across many cut-offs.
- Leave a gap between training and test windows when lag or rolling features could reach across the boundary, and make each test window as long as the real forecast horizon.
When would you choose ARIMA over gradient boosting on lag features, and when the reverse?
- ARIMA suits a single series or a few, with modest history and mostly linear autocorrelation, and it gives prediction intervals and coefficients you can read, after differencing to stationarity.
- Gradient boosting on lag, rolling and calendar features suits many related series in one global model, with exogenous inputs such as prices or holidays and nonlinear effects.
- Tree models cannot extrapolate beyond the target range seen in training, so detrend or difference first, and benchmark both against a seasonal naïve forecast using a scaled error like MASE.
What to study, in order
Each link opened and checked by hand; the date says when.
Start here
5 The forecaster’s toolbox (opens in a new tab)
Forecasting: Principles and Practice (3rd edition) · Rob J Hyndman and George Athanasopoulos · 50 min · Free · checked 26 Oct 2026
- Why
- Interviewers judge a forecasting answer first on whether it beats a naïve baseline and is evaluated without leaking the future, and this chapter is the standard reference for both.
- What to read
- Read 5.2 “Some simple forecasting methods” (mean, naïve, seasonal naïve, drift), 5.8 “Evaluating point forecast accuracy” (“Training and test sets”, “Scale-dependent errors”, “Percentage errors”, “Scaled errors”) and 5.10 “Time series cross-validation”.
- What to skip
- 5.1, 5.3–5.7 and 5.9, and the R and fable code, which you can read past without running.
Free alternative
Lagged features for time series forecasting (opens in a new tab)
scikit-learn examples · scikit-learn developers · 45 min · Free · checked 26 Oct 2026
- Why
- Most production forecasting at tech companies is gradient boosting on lag features, and interviewers want to see you build the features and backtest them without leakage.
- What to read
- Read “Generating Polars-engineered lagged features”, “Naive evaluation of the next hour bike demand regression”, “Proper next hour forecasting evaluation” (TimeSeriesSplit with a gap) and “Modeling predictive uncertainty via quantile regression”, then the “Conclusion”.
- What to skip
- “Analyzing the Bike Sharing Demand dataset” beyond its first plot, and “A qualitative look at the predictions”.
Go deeper
9 ARIMA models (opens in a new tab)
Forecasting: Principles and Practice (3rd edition) · Rob J Hyndman and George Athanasopoulos · 75 min · Free · checked 26 Oct 2026
- Why
- ARIMA is the classical baseline interviewers compare against gradient boosting, so you need to explain what p, d and q mean and when the model fits.
- What to read
- Read 9.1 “Stationarity and differencing”, 9.3 “Autoregressive models”, 9.4 “Moving average models”, 9.5 “Non-seasonal ARIMA models” and 9.6 “Estimation and order selection”, then skim 9.9 “Seasonal ARIMA models”.
- What to skip
- 9.2 “Backshift notation” beyond its definitions, 9.7 on fable, 9.8 and 9.10, and the R code.
Companies that test ML fundamentals most
Put Time series forecasting in your plan
Tell us your interview date and hours a day; it lands on the right day, in the right order.