skip to content

Time-Series Analysis

Data ordered in time breaks the i.i.d. assumption: trend and seasonality, stationarity, autocorrelation, ARIMA and Holt-Winters forecasts. Interviewers use it to find who peeks ahead.

on this pageshow

explore

questions

page 2 of 2

In a 14-day-ahead backtest, why put a 14-day gap between training and test data?

level: seniorimportance: should knowfreq 44%

basics

~20 s

Because a row dated within 14 days of the forecast origin has a target that lands at or after the origin, so it was not yet observed there. Dropping those rows keeps training to outcomes genuinely known at prediction time.

open as a page

Is a last-year holdout a valid backtest if you tuned the model on the full history?

level: seniorimportance: should knowfreq 50%

basics

~20 s

No. If the last year influenced which model or hyperparameters you picked, its error is an optimistic in-sample number for that choice, not an independent estimate. Selection must happen on origins entirely before the holdout begins.

open as a page

How would you test whether two non-stationary stock price series are cointegrated?

level: seniorimportance: should knowfreq 40%

basics

~20 s

Confirm each series has a unit root, regress one on the other, then test whether the residual spread is stationary using cointegration critical values. If it is, the pair is cointegrated, and step two fits an error-correction model.

open as a page

How do moving holidays like Easter distort the seasonal indices of a monthly retail series?

level: seniorimportance: should knowfreq 33%

basics

~20 s

A month-of-year seasonal index assumes the same calendar effect every year, but Easter falls in March some years and April others. Both indices become blends of holiday and non-holiday years, so both are biased and the remainder carries a paired March-April swing.

open as a page

What does STL decomposition give you that a classical moving-average decomposition does not?

level: seniorimportance: should knowfreq 42%

basics

~20 s

STL uses local regression instead of fixed averages, so the seasonal shape may change over time, trend and seasonal smoothness are tunable, and a robust variant pushes outliers into the remainder instead of letting them bend the trend.

open as a page

Holt's linear trend forecasts a startup's sign-ups 24 months out at an implausible level. What do you change?

level: seniorimportance: should knowfreq 48%

basics

~20 s

Switch to a damped trend. Multiply the slope by a damping factor phi between 0 and 1 once per step ahead, so the extrapolated growth flattens to a finite asymptote instead of continuing in a straight line forever.

open as a page

For a 28-day-ahead forecast, how do recursive and direct multi-step strategies differ?

level: seniorimportance: should knowfreq 55%

basics

~20 s

Recursive forecasting trains one one-step model and feeds its own predictions back as lags, so errors compound over 28 steps. Direct forecasting trains a model per horizon using only lags of at least that horizon, so nothing is fed back.

open as a page

ADF fails to reject a unit root and KPSS rejects stationarity on the same series — what do you conclude?

level: seniorimportance: should knowfreq 45%

basics

~10 s

The two tests carry opposite null hypotheses, so both verdicts point the same way: the evidence supports a unit root. Difference the series once, then re-run both tests on the differenced series before modelling.

open as a page

How do you choose the headline forecast accuracy metric for a portfolio of thousands of series?

level: principalimportance: should knowfreq 36%

basics

~20 s

Pick a scale-free measure so series of different sizes can be aggregated, weight by business value rather than series count, and publish a naive baseline's score on the same window so the number reads as skill, not difficulty.

open as a page

How do you set an anomaly-detection threshold that trades false alarms against detection delay for on-call?

level: principalimportance: should knowfreq 42%

basics

~20 s

Set the threshold from an alarm budget, not from a default number of sigmas. Measure false alarms per week and median detection delay across the whole fleet of series, then pick the point on that curve on-call can sustain.

open as a page

Would you fit a SARIMA with m=52 to three years of weekly sales, and how would you justify the call?

level: principalimportance: should knowfreq 31%

basics

~20 s

Usually no. A lag-52 seasonal term is informed by complete yearly cycles, and three years gives three; seasonal differencing also discards 52 of about 156 weeks. Carry annual seasonality with a few harmonic regressors instead.

open as a page

Your team wants to replace exponential smoothing baselines with deep learning across 5,000 SKUs. How do you decide?

level: principalimportance: should knowfreq 40%

basics

~20 s

Keep exponential smoothing as the benchmark the new method must beat on the same series. Complex forecasters tend to win only with many related series, useful covariates and enough history per series; otherwise damped-trend smoothing is very hard to beat.

open as a page

Would you train one global model across thousands of store-item series, or one model per series?

level: principalimportance: should knowfreq 38%

basics

~20 s

Default to one global model trained on the pooled rows of all series, with a series identifier and static attributes as columns. It shares structure across series, covers brand-new ones, and leaves one artifact to operate. Reserve per-series models for high-value, atypical series.

open as a page

What does a CUSUM chart detect that a per-point threshold rule misses?

level: middleimportance: nice to knowfreq 30%

basics

~20 s

CUSUM accumulates signed deviations from the target mean instead of judging each point alone, so it catches a sustained small shift that never breaches a per-point limit. Slack k targets the shift size; threshold h triggers the alarm.

open as a page

In a time series, what distinguishes a cycle from a seasonal pattern?

level: middleimportance: nice to knowfreq 27%

basics

~20 s

A season repeats at a fixed, calendar-known period such as 12 months or 7 days. A cycle also rises and falls, but its length and height vary from one repetition to the next, so no calendar pins it down.

open as a page

Simple exponential smoothing is equivalent to which ARIMA model?

level: middleimportance: nice to knowfreq 26%

basics

~20 s

Simple exponential smoothing is equivalent to ARIMA(0,1,1): difference the series once and model the result with a single moving-average term. Writing that as y_t - y_{t-1} = e_t - theta * e_{t-1}, the smoothing weight is alpha = 1 - theta.

open as a page

How do Fourier terms with period m=365 encode yearly seasonality as model columns?

level: middleimportance: nice to knowfreq 34%

basics

~10 s

Fourier terms are sine and cosine columns built from the date index: sin(2pikt/365) and cos(2pikt/365) for k = 1..K. Those 2K columns approximate a smooth yearly cycle using far fewer parameters than day-of-year indicators.

open as a page

Why does minimising pinball loss at the 0.9 quantile give a higher forecast than minimising MAE?

level: seniorimportance: nice to knowfreq 27%

basics

~20 s

Pinball loss weights error directions unequally: at the 0.9 level, falling short costs nine times as much per unit as overshooting. Its minimiser is the 0.9 quantile, while absolute error is minimised by the median.

open as a page

In an ARIMA model, what do the stationarity and invertibility conditions require of its roots?

level: seniorimportance: nice to knowfreq 26%

basics

~20 s

Both require roots of a lag polynomial to lie outside the unit circle: the autoregressive polynomial's roots for stationarity, the moving-average polynomial's for invertibility. For a first-order model that reduces to the coefficient having absolute value below one.

open as a page

After differencing, a series has a lag-1 autocorrelation near -0.5. What does that suggest?

level: seniorimportance: nice to knowfreq 26%

basics

~10 s

A large negative lag-1 autocorrelation right after differencing is the classic signature of over-differencing: the series was already level enough, and the extra difference injected artificial negative correlation and inflated the variance.

open as a page

How do you tell a trend-stationary series from a difference-stationary one?

level: seniorimportance: nice to knowfreq 33%

basics

~20 s

A trend-stationary series varies around a fixed deterministic trend and its shocks fade; a difference-stationary series has a unit root and its shocks persist forever. Detrend by regression in the first case, difference in the second.

open as a page

How should a rolling-origin backtest reflect how often the model is refit in production?

level: principalimportance: nice to knowfreq 30%

basics

~20 s

The backtest should refit on the same schedule the deployed system uses. Refitting at every origin while production retrains quarterly reports the accuracy of a model far fresher than the one that will actually be serving forecasts.

open as a page

When would you keep an error-correction term rather than simply differencing two cointegrated series?

level: principalimportance: nice to knowfreq 26%

basics

~20 s

Keep the error-correction term when the level gap carries information you need: longer forecast horizons, or decisions that depend on the pair converging. Differencing a cointegrated pair is safe but discards the equilibrium and misspecifies the dynamics.

open as a page

showing 31–53 of 53