Time series interview questions and answers
Time series interview questions test whether you respect the order of the data: that you split by time, beat a naive baseline and explain why a forecast will drift. Expect trend and seasonality, stationarity and differencing, ACF and PACF, ARIMA and exponential smoothing, walk-forward backtesting, MAPE and its traps, and a scenario such as forecasting demand through a promotion or a holiday.
By Evin JohnPublished 7 min read
How time series questions show up
Forecasting is tested for data scientists in retail, logistics, finance, energy and marketplace companies, for demand planning and supply chain analysts, and for ML engineers who own forecasting pipelines. Interviewers know that most bugs in this area are not model bugs. They are a test set that overlaps the training window, a feature that would not be known at forecast time, or a metric that explodes near zero. The questions below are grouped by level, so start with the fundamentals and go as far as the role demands.
- ConceptsDefine stationarity, read an ACF plot, explain why differencing helps. Quick, precise answers with a sketch are ideal.
- Hands-onResample and fill a messy series in pandas, build lag and rolling features without leaking, or write a backtest loop.
- Model discussionChoose between a statistical model, gradient boosting on lag features and a neural forecaster, and justify it by data size, horizon and how many series you have.
- Business caseForecast store demand, call volume or server load. You name the baseline, the metric, the horizon and how the forecast will be used.
Time series fundamentals questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| What are the components of a time series? | Decomposition | Trend (long-run direction), seasonality (a repeating pattern with a fixed period), cycles (longer swings without a fixed period) and the remainder. Additive when seasonal swings stay the same size, multiplicative when they grow with the level. |
| What does stationarity mean and why does it matter? | Core theory | A weakly stationary series has a constant mean, constant variance and an autocovariance that depends only on the lag. Many classical models assume it, because relationships learned from the past then still hold. |
| How do you make a series stationary? | Transformations | Difference it to remove trend, take seasonal differences for seasonality, and use a log or Box-Cox transform when variance grows with the level. Test the result with a plot and a unit root test. |
| What is autocorrelation? | Dependence | The correlation of a series with its own past values at a given lag. The ACF plots it across lags and shows persistence and seasonal spikes. |
| ACF versus PACF? | Diagnostics | The PACF shows the correlation at lag k after removing the effect of shorter lags. A sharp PACF cutoff suggests an AR order; a sharp ACF cutoff suggests an MA order. |
| What is a random walk and why is it hard to beat? | Baselines | Each value is the previous one plus noise, so the best forecast is the last value. Many financial and some business series behave close to this, which is why the naive forecast is a serious benchmark. |
| What is white noise? | Residual checks | Uncorrelated values with constant mean and variance. Good model residuals should look like it; leftover autocorrelation means the model missed structure. |
| What does the ADF test check? | Unit roots | The augmented Dickey-Fuller test has a unit root (non-stationarity) as its null hypothesis. KPSS reverses it, with stationarity as the null, so running both gives a clearer picture. |
| Why can you not shuffle time series data for cross-validation? | Leakage | Shuffling puts future rows into training folds, so the model learns from information it would not have, and the score overstates real performance. |
| What is a forecast horizon? | Problem framing | How far ahead you predict. Error grows with the horizon, and the right model and features often differ between next-day and next-quarter forecasts. |
import numpy as np
def acf(x, max_lag):
"""Sample autocorrelation for lags 1..max_lag."""
x = np.asarray(x, dtype=float) - np.mean(x)
denom = x @ x
return np.array([(x[:-k] @ x[k:]) / denom for k in range(1, max_lag + 1)])
rng = np.random.default_rng(0)
walk = np.cumsum(rng.normal(size=500)) # random walk: not stationary
print(acf(walk, 3).round(2)) # [0.99 0.98 0.97], decays very slowly
diffed = np.diff(walk) # first difference is white noise
print(acf(diffed, 3).round(2)) # [-0.02 0.01 -0.07], all near zeroModel questions: smoothing, ARIMA and machine learning
- What do the p, d and q in ARIMA(p, d, q) mean? p is the number of autoregressive lags, d the number of differences taken to reach stationarity, and q the number of lagged forecast errors in the moving average part. SARIMA adds the same three for the seasonal period.
- How would you choose ARIMA orders? Difference until the series looks stationary, read candidate orders from the ACF and PACF, then compare a few candidates by AIC or a backtest and check that residuals look like white noise.
- Explain simple exponential smoothing. The forecast is a weighted average of past values with weights that decay geometrically, controlled by a smoothing parameter. Holt adds a trend term and Holt-Winters adds seasonality.
- When would you use gradient boosting instead of ARIMA? When you have many related series, useful external features such as price and promotions, and enough history to learn shared patterns. A single short series with clear seasonality often does better with a classical model.
- How do you turn forecasting into a supervised learning problem? Build rows with lag values, rolling statistics, calendar features and known future inputs, all computed only from data available at the forecast origin, and predict the target at the chosen horizon.
- Recursive versus direct multi-step forecasting? Recursive uses one model and feeds its own predictions back as inputs, so errors compound. Direct trains a separate model per horizon, which avoids compounding at the cost of more models.
- How do you find the seasonal period of a series? Plot it at several zoom levels, look for spikes in the ACF at lags such as 7 for daily data or 12 for monthly data, and check a periodogram when the cycle is not obvious. Daily retail data often carries both weekly and yearly patterns.
- What do you do with missing timestamps? First decide whether missing means zero (no sales) or unknown (sensor down). Reindex to a full calendar, then fill zeros, interpolate or flag the gap accordingly.
- How do holidays and promotions enter a model? As explicit features: holiday flags with leads and lags around the date, promotion depth and type, and price. Without them the model treats a spike as noise or, worse, as a new level.
Backtesting and forecast metric questions
If you remember one habit from this page, make it this one: compare every model against a naive and a seasonal naive forecast on a walk-forward backtest. Interviewers often ask candidates to write that loop.
import numpy as np
import pandas as pd
from sklearn.model_selection import TimeSeriesSplit
# Two years of daily sales with a weekly pattern and a slow trend
days = pd.date_range("2024-01-01", periods=730, freq="D")
rng = np.random.default_rng(1)
weekly = np.tile([90, 100, 100, 105, 120, 160, 140], 105)[:730]
sales = pd.Series(weekly + np.arange(730) * 0.05 + rng.normal(0, 5, 730), index=days)
def mae(a, b):
return float(np.mean(np.abs(np.asarray(a) - np.asarray(b))))
# Walk-forward evaluation: always train on the past, test on the next 28 days
for train_idx, test_idx in TimeSeriesSplit(n_splits=3, test_size=28).split(sales):
train, test = sales.iloc[train_idx], sales.iloc[test_idx]
naive = np.repeat(train.iloc[-1], len(test)) # last value carried forward
seasonal = np.resize(train.iloc[-7:].values, len(test)) # same weekday last week
print(test.index[0].date(), round(mae(test, naive), 1), round(mae(test, seasonal), 1))
# 2025-10-08 22.8 5.4
# 2025-11-05 24.5 6.4
# 2025-12-03 22.9 6.9| Question | What it tests | What a strong answer shows |
|---|---|---|
| MAE, RMSE, MAPE or MASE? | Metric choice | MAE is easy to explain, RMSE punishes big misses, MAPE is scale-free but breaks near zero and penalizes over- and under-forecasts unevenly. MASE scales error by a naive forecast, so it compares across series and shows whether you beat the baseline. |
| Why is MAPE dangerous for intermittent demand? | Metric traps | Many periods have zero or tiny actuals, so percentage errors become infinite or huge. Use weighted MAPE over the total, MASE, or a metric tied to inventory cost. |
| How do you set up a backtest? | Evaluation design | Pick several forecast origins, train only on data before each one, forecast the real horizon, and average errors across origins. Use an expanding or sliding window depending on whether old data still applies. |
| Your model beats the naive forecast by a tiny margin. Is it worth it? | Judgement | Compare the gain to the cost of running a more complex system, and check whether the gain is consistent across origins and segments or driven by one period. |
| How do you produce prediction intervals? | Uncertainty | From the model's error distribution (statistical models), quantile loss (boosting), or empirical residuals from the backtest at each horizon. Then check coverage: do 80 percent intervals contain about 80 percent of actuals? |
| What is forecast bias and how do you measure it? | Bias | A consistent tendency to over- or under-forecast, measured by the mean signed error. Planners care because systematic bias drives overstock or stockouts even when absolute error looks fine. |
Senior and scenario questions
| Question | What it tests | What a strong answer shows |
|---|---|---|
| Forecast weekly demand for 20,000 products across 500 stores. | Scale | One global model on lag and calendar features usually beats thousands of separate ARIMA fits. Discuss hierarchy (product, store, region), reconciliation so totals add up, and how new products borrow from similar ones. |
| A new product has six weeks of history. How do you forecast it? | Cold start | Use attributes and the launch curves of similar past products, blend with early actuals as they arrive, and widen the intervals honestly. |
| The pandemic period distorts your training data. What do you do? | Structural breaks | Flag or exclude the period, add a regime feature, or weight recent data more. Explain the choice, and backtest across the break to see which option holds up. |
| Your forecast is accurate on average but stores still run out. Why? | Decision link | The cost is in the tails and in bias at specific stores. Optimize for a service-level quantile rather than the mean, and measure error where stockouts happen. |
| How would you monitor a forecasting system in production? | Operations | Track error and bias by segment as actuals arrive, alert on data freshness and on sudden shifts in inputs, and keep the naive baseline running alongside to spot when the model stops earning its place. |
| Correlation between two trending series is 0.9. Does one drive the other? | Spurious regression | Two trending series correlate even when unrelated. Difference them or test for cointegration before reading anything into it, and look for a mechanism. |
Regression with lagged features follows the ideas in linear regression interview questions, and testing whether a forecast-driven change worked belongs in A/B testing interview questions.
Fictional example
- Interviewer
- We staff a support center from a call volume forecast. How would you build it?
- Candidate
- I would start with how the forecast is used: schedules are set two weeks ahead in 30-minute slots, so the horizon is two weeks and the grain is half-hourly. Volume has daily and weekly seasonality and spikes after releases and billing runs, so I would add those dates as features. My baseline is the same slot last week. Then I would try a seasonal smoothing model and a gradient boosting model on lags and calendar features, and backtest both from several origins. Because understaffing costs more than overstaffing, I would forecast an upper quantile, not only the mean, and report bias by hour so the planners can trust it.
A two-week time series practice plan
- Days 1 to 3: explain stationarity, differencing, ACF and PACF out loud with a sketch for each, then simulate a random walk and an AR(1) and compare their plots.
- Days 4 and 5: practise pandas time handling: resampling, time zones, reindexing to a full calendar and rolling windows that only look backwards.
- Days 6 to 8: take a public daily series and build naive, seasonal naive, exponential smoothing and boosted lag-feature forecasts, scored on one walk-forward backtest.
- Days 9 and 10: compute MAE, RMSE, MAPE and MASE for the same forecasts and explain why their rankings differ.
- Days 11 to 14: two scenario questions out loud (many series, and a promotion-heavy series), each covering grain, horizon, baseline, metric, intervals and monitoring.
Forecasting answers tend to wander, because there is always one more feature to mention. Natively, an AI interview assistant for Mac and Windows, gives you a transcript of each mock interview, captured on your computer, so you can see whether you stated the horizon and baseline before diving into models. During practice it can suggest answers, read an ACF plot or a forecast chart from a screenshot, and help debug a pandas backtest. Pro or the free trial lets it draw on your résumé and the job description you add, and your notes stay available afterwards.
Questions people ask
What time series questions are asked in data science interviews?
Stationarity and differencing, autocorrelation and the ACF and PACF, ARIMA and exponential smoothing, how to backtest without leakage, forecast metrics such as MAPE and MASE, and a scenario such as forecasting demand for many products.
How do you explain stationarity in an interview?
Say a stationary series has a constant mean, constant variance and correlations that depend only on the gap between points, then explain that differencing or a log transform is the usual way to get there.
Why can't you use normal cross-validation on time series?
Random folds put future data into training, which leaks information and inflates the score. Use walk-forward splits that always train on the past and test on the period after it.
Which forecasting model should I mention first?
A naive or seasonal naive baseline. Interviewers expect every other model, from ARIMA to gradient boosting, to be compared against it on the same backtest.
Where to go next
Practice with the same assistant you would use on a call: it listens, transcribes and suggests answers from your own resume and the job description.
Facts on this page were last checked on . Product details come from the Natively app itself; if something here is out of date, tell us at hello@heynatively.com.
