Articles
ARIMA Interview Questions: Stationarity, Differencing, and Residual Checks
Prepare ARIMA interview answers using an eight-point differencing trace, residual diagnostics, and rolling-origin baseline checks.
An ARIMA interview question is rarely solved by announcing three integers. A strong answer shows why the series needs differencing, what pattern remains after differencing, whether the fitted innovations still contain predictable structure, and whether forecasts beat a simple baseline on future observations. This guide gives you an original eight-point trace to discuss on a whiteboard, then a diagnostic decision tree for the common traps.
Authoritative teaching source: Hyndman and Athanasopoulos' Forecasting: Principles and Practice explains stationarity, differencing, ARIMA orders, and residual diagnostics. Candidate reports: none are used to imply any employer asks this exact prompt. Original exercise and inference: the short series and interview dialogue below are constructed for practice; they are not a fitted production model or a reported question.
What does stationarity mean for the modeling decision?
A stationary series has statistical properties that do not depend on when it is observed. A visible trend or fixed seasonal pattern violates that simplified working condition. For ARIMA, the practical question is whether differencing has made the relevant mean behavior stable enough that an autoregressive and moving-average structure can model remaining dependence. It is not a demand that every finite plot look flat or normally distributed.
Start with the data contract: frequency, missing periods, target transformation, forecast origin, and horizon. A daily count with holiday spikes and missing weekends is not the same object as a regular daily time series with true zero weekends. An ARIMA order chosen before those issues are resolved may model the data collection process. If the task is an hourly series with a weekly cycle, a nonseasonal model that merely differences once can leave clear periodic dependence. Ask whether a seasonal ARIMA formulation, regressors, or another baseline is appropriate.
The stationarity chapter illustrates how a first difference can remove level changes, and cautions that differencing can be overdone. A unit-root test is one piece of evidence, not an automatic order selector. A small p-value from a stationarity test must be interpreted with that test's null hypothesis, sample size, and structural breaks in mind. For example, KPSS uses stationarity as its null; ADF has a unit-root null. Treating both p-values as if they mean the same thing reverses an answer.
In an interview, say what evidence you would put side by side: time plot, ACF of original series, ACF after a candidate difference, seasonal plot if relevant, and a record of known interventions. A near-one lag-one autocorrelation and slow ACF decay may suggest a unit root, but a deterministic trend or regime shift can produce similar visual clues. Explain why you would compare plausible specifications on a rolling-origin holdout instead of interpreting one chart as proof.
Work an eight-point differencing trace
Original practice series: observed values at equally spaced times are [20, 23, 25, 28, 30, 33, 35, 38]. The first differences are [3, 2, 3, 2, 3, 2, 3]. The original level rises; the differenced series oscillates around about 2.6. That makes one difference a plausible first trial, so d = 1 is a hypothesis. It does not show that ARIMA(0,1,0) is sufficient: the alternating 3,2 pattern is predictable, and a residual or ACF check might reveal it.
If you difference again, the second differences are [-1, 1, -1, 1, -1, 1]. The regular sign reversal is not “more stationary” in any useful sense; it is new dependence created or emphasized by another difference. For some series, an overly negative lag-one ACF after differencing is a practical warning of over-differencing. This particular toy sequence is deterministic and too short for reliable statistical fitting. Its purpose is to expose the reasoning, not to estimate a robust ARIMA model.
| Candidate view | What it shows | Decision you can defend |
|---|---|---|
Original [20,23,25,28,30,33,35,38] | Rising level | Test a first difference and simple drift baseline |
First difference [3,2,3,2,3,2,3] | Level trend removed; alternating increments remain | Consider AR/MA structure, inspect ACF and residuals |
Second difference [-1,1,-1,1,-1,1] | Strong artificial sign reversal | Do not increase d merely to make mean near zero |
An interviewer may replace the sequence with [20,20,20,20]. Differencing gives all zeros, but that does not mean an integrated stochastic model is needed. A constant baseline may be sufficient. Another variation uses a one-time permanent jump; differencing makes a single large pulse, but an intervention indicator or segmented model may explain it better than increasing order. State the alternative mechanism before tuning p and q.
How do p, d, and q differ?
In nonseasonal ARIMA(p,d,q), d counts differences applied to the series, p is the order of the autoregressive part, and q is the order of the moving-average part. The ARIMA chapter writes those components in backshift notation. In plain language, p uses previous values of the stationary working series, while q uses previous forecast innovations. A moving-average term is not a rolling average of raw observations.
After choosing a plausible differencing order, inspect ACF and PACF as hints for small p and q candidates. Do not present the old “ACF cuts off, therefore exact q” rule as a guarantee; finite data, mixed ARMA structure, seasonality, and parameter estimation make patterns ambiguous. Compare a small, interpretable set of candidate models using fit criteria such as AICc and a true forecast holdout. A lower in-sample AICc does not automatically mean lower out-of-sample error.
Ask about a constant or drift term. When d = 1, a constant in the differenced equation corresponds to average drift in levels. Forecasts can then trend. Without drift, a random-walk-type model's point forecast may flatten at the last observed level. That choice matters more to a business forecast than whether a fitted p is one or two. Inspect the model's exact parameterization: software packages may label trend and intercept differently.
Seasonality adds separate orders and a seasonal period. If monthly demand repeats annually, the potential seasonal difference is y_t - y_(t-12), distinct from ordinary y_t - y_(t-1). A seasonal difference can be useful, but one should check whether the seasonal signal is real, stable, and represented in training. If only two seasonal cycles exist, elaborate seasonal parameters may be unidentifiable or unstable. The interview answer should state the amount of history available.
What does a residual check actually establish?
Residuals or innovations should not retain predictable autocorrelation that the model was meant to explain. Plot them over time, inspect their ACF, and consider a Ljung–Box test at a justified lag with an appropriate degrees-of-freedom adjustment. The residual diagnostics chapter explains that large Ljung–Box statistics suggest residual autocorrelation; it also notes ARIMA adjustments. A high p-value means this test did not find evidence of autocorrelation at the examined lags, not that the model is true or that forecasts are accurate.
Separate three questions that are often collapsed. Are residuals centered near zero, or is there directional bias? Are they serially correlated, suggesting remaining signal? Does their spread change over time, suggesting heteroskedasticity, outliers, or an omitted regime? A residual series could pass an autocorrelation test yet produce bad forecasts after a structural break. Conversely, a small autocorrelation pattern can be statistically significant in a huge sample without being operationally important. Put diagnostics beside holdout loss and interval coverage.
For a hypothetical fitted model, imagine residual ACF at lag one is 0.42 and a Ljung–Box test at lag 10 returns p = 0.01. Those are illustrative diagnostics, not calculated from the eight-point series. You would investigate missed AR/MA or seasonal structure, an omitted predictor, data errors, or a break. If another candidate has lag-one ACF 0.05 and p = 0.44, you still compare its future forecast errors and uncertainty intervals before choosing it. Good whiteness is a necessary model check for some purposes, not a prize independent of prediction.
Do not apply normality as a universal pass/fail. Gaussian residual assumptions matter for some interval calculations and likelihood approximations, but point forecasts can be useful under nonnormal errors. If the target is a nonnegative count, a Gaussian ARIMA may generate negative point or interval values; this can signal that a transform or count model better matches the decision. Ask how the business uses uncertainty, not just the point estimate.
How should the forecast be validated?
Set a forecast origin and horizon before splitting. If the business predicts three weeks ahead every Monday, evaluate that exact three-week task across multiple origins. Fit transformations, differencing choices, and hyperparameter selection using only data available before each origin. A random row split destroys time order. If future exogenous regressors are used, ask whether their future values will actually be known or must themselves be forecast.
Original comparison: suppose a final three-period holdout is [40, 42, 45] after the last observed value 38. A flat last-value baseline predicts [38,38,38], with absolute errors [2,4,7] and MAE 13/3 ≈ 4.33. A candidate forecast [39.5,42,44.5] has absolute errors [0.5,0,0.5] and MAE 1/3 ≈ 0.33. This calculation demonstrates how to compare forecasts at the same origins; it does not establish that ARIMA produced the candidate values. Report the method that generated each forecast before attributing lift.
Compare with a naïve, drift, and seasonal-naïve baseline as appropriate. Report errors by horizon and important segment, plus bias, interval coverage, and costs of over- versus underforecasting. If the model beats a baseline at horizon one but fails at horizon twelve, the correct recommendation may be limited deployment. A small average improvement can hide rare but costly peaks.
A compact interview answer
“I would first define the timestamp grid, horizon, missing-period policy, and baseline. I would inspect trend and seasonality, try the minimum defensible differencing order, and check the transformed series rather than automatically increasing d. I would fit a small set of ARIMA candidates, inspect innovation residuals for bias and autocorrelation, and compare rolling-origin forecasts with naïve alternatives on the same periods. A residual test that fails to reject white noise does not by itself validate the forecast.”
If pushed on the eight-point sequence, point to its alternating first differences: one difference removes the level rise but leaves structured increments. If pushed on test results, name the null and diagnostic lag. If pushed on production, explain what happens when a new holiday or regime shift appears. That turns an acronym answer into a credible forecasting decision.
Use Build a time-series forecasting model to practice stating the horizon and baseline before you discuss ARIMA orders.