Time series forecasting is one of the most commercially valuable skills in data science — almost every business needs to forecast demand, sales, traffic, or capacity. Time series interviews combine statistical theory (stationarity, ARIMA, autocorrelation), ML approaches (gradient boosting, LSTM), and modern probabilistic methods (Prophet, N-BEATS, Temporal Fusion Transformer). This guide covers the 35 most asked time series interview questions with complete answers.
Related reading: Statistics Interview Q&A covers the probability and hypothesis testing foundation that underpins time series analysis. For feature engineering from temporal data, see our Feature Engineering Interview Q&A.
Core Time Series Concepts
Q1. What is a time series and how does it differ from cross-sectional data?
A time series is a sequence of observations indexed in time order — daily sales, hourly CPU usage, monthly inflation. The key distinction: observations are not independent. Today’s sales correlate with yesterday’s (autocorrelation). This violates the independence assumption of most standard ML models, requiring specialised methods. Cross-sectional data is a snapshot at one point in time where each row is independent. Panel data combines both: multiple units observed over time.
Q2. What is stationarity and why does it matter?
A time series is stationary if its statistical properties — mean, variance, and autocorrelation structure — do not change over time. Most classical models (ARIMA, SARIMA) assume stationarity. A model fit to a non-stationary series produces unreliable forecasts. Weak stationarity: constant mean, constant variance, autocorrelation depends only on the lag. Most economic and business series are not stationary — they have trends, seasonality, and/or changing variance.
Q3. How do you test for stationarity?
Augmented Dickey-Fuller (ADF) test: H0 = unit root (non-stationary). If p-value < 0.05, series is stationary. KPSS test: H0 = stationary. If p-value < 0.05, non-stationary. Using both: if ADF rejects H0 and KPSS does not → stationary. If both reject → needs differencing. Visual inspection of rolling mean and rolling std is always the first step.
import pandas as pd
from statsmodels.tsa.stattools import adfuller, kpss
def test_stationarity(series, label='Series'):
adf_res = adfuller(series.dropna())
print(f'{label} — ADF p-value: {adf_res[1]:.4f}')
kpss_res = kpss(series.dropna(), regression='c', nlags='auto')
print(f'{label} — KPSS p-value: {kpss_res[1]:.4f}')
if adf_res[1] < 0.05 and kpss_res[1] > 0.05:
print(' Stationary')
else:
print(' Non-stationary — consider differencing')
# Make stationary via differencing
# df['sales_diff'] = df['sales'].diff()
# test_stationarity(df['sales_diff'], 'First difference')
Q4. What is differencing and how many times should you difference?
Differencing: y’_t = y_t – y_{t-1}. First differencing removes linear trend; second removes quadratic trend. Seasonal differencing: y’_t = y_t – y_{t-m} (m=12 for monthly). The order d in ARIMA(p,d,q). Most economic series: d=1. Use ADF after each differencing step. Over-differencing introduces unnecessary noise.
Q5. What is ACF and PACF and how do you use them to identify ARIMA parameters?
ACF (Autocorrelation Function): correlation between the series and its lagged version. Measures direct + indirect correlations. PACF (Partial Autocorrelation Function): correlation at lag k after removing shorter lags — direct correlations only. Identifying ARIMA(p,d,q): AR(p) → PACF cuts off after lag p, ACF decays. MA(q) → ACF cuts off after lag q, PACF decays. ARMA(p,q) → both decay gradually. In practice, auto_arima from pmdarima performs automatic AIC/BIC-guided search.
Q6. Explain SARIMA. What do seasonal parameters mean?
SARIMA(p,d,q)(P,D,Q)[m]: lowercase = non-seasonal AR order, differencing, MA order. Uppercase = seasonal AR, seasonal differencing, seasonal MA. m = seasonal period (12 monthly, 7 daily weekly, 4 quarterly). Seasonal differencing: y’_t = y_t – y_{t-12} removes patterns repeating every 12 months.
Prophet and Modern Forecasting
Q7. What is Facebook Prophet and how does it model time series?
Prophet decomposes: y(t) = trend(t) + seasonality(t) + holidays(t) + error. Trend: piecewise linear or logistic growth with automatic changepoint detection. Seasonality: Fourier series for multiple periodicities (yearly, weekly, daily). Holidays: user-provided dates with window effects. Designed for business time series with strong seasonality and missing data — handles gaps and outliers without requiring stationarity. Key parameters: changepoint_prior_scale (trend flexibility), seasonality_prior_scale (seasonal amplitude), seasonality_mode (additive vs multiplicative).
from prophet import Prophet
# Prophet requires 'ds' (datetime) and 'y' (value) columns
# df_prophet = df.rename(columns={'date': 'ds', 'sales': 'y'})
m = Prophet(
changepoint_prior_scale=0.05,
seasonality_prior_scale=10.0,
seasonality_mode='multiplicative',
yearly_seasonality=True,
weekly_seasonality=True,
daily_seasonality=False
)
# m.add_country_holidays(country_name='IN')
# m.fit(df_prophet[df_prophet['ds'] < '2026-01-01'])
# future = m.make_future_dataframe(periods=90)
# forecast = m.predict(future)
# fig = m.plot_components(forecast)
Q8. Advantages and limitations of Prophet?
Advantages: handles missing values natively, robust to outliers, models multiple seasonalities, explicit holiday effects, uncertainty intervals, interpretable components. Limitations: no multivariate support beyond additive regressors, poor on short series or series without clear trend/seasonality, does not capture complex non-linear dynamics. ARIMA often outperforms it on stationary series.
ML for Time Series
Q9. How do you use XGBoost/LightGBM for time series forecasting?
Convert the forecasting problem to supervised learning. Create: lag features (sales_lag_1, lag_7, lag_14, lag_28), rolling statistics (rolling_7d_mean, rolling_30d_std), time features (day_of_week, month, is_weekend, is_holiday), and target-encoded context variables. Train XGBoost on these features to predict the next period. Key challenge: use time-series cross-validation (expanding or sliding window) — never random CV which leaks future data.
Q10. What is walk-forward (time-series) cross-validation?
Standard k-fold shuffles data, leaking future into training — severe for time series. Walk-forward: Train on [t0, t1], validate on [t1, t1+h]. Then train on [t0, t2], validate on [t2, t2+h]. Continue forward. The training window can expand (expanding window) or slide (fixed window). Scikit-learn provides TimeSeriesSplit. For neural models, use a single train/val/test split where test is the final chronological period.
Q11. How does LSTM work for time series and what are its limitations?
LSTM is a recurrent neural network with gating (forget, input, output gates) that selectively remembers or forgets information over long sequences. A sliding window of T past values is fed as input; the final hidden state predicts the next h values. Limitations: requires large datasets to outperform gradient boosting with hand-crafted features; slow to train; not interpretable. Modern alternatives: Temporal Fusion Transformer (TFT) — interpretable attention-based model for multi-horizon forecasting. N-BEATS — residual stacks with basis functions. PatchTST, iTransformer — 2024-2026 SOTA.
Evaluation and Rapid-Fire Q&A
Q12. What metrics do you use to evaluate time series forecasts?
MAE: average absolute deviation — interpretable in original units, robust to outliers. RMSE: penalises large errors more — use when large errors are costly. MAPE: scale-independent percentage error — undefined at y=0, biased for asymmetric distributions. sMAPE: symmetric MAPE. MASE: MAE divided by MAE of the seasonal naive forecast — MASE < 1.0 means you beat the naive baseline. Always report MASE — if your model cannot beat seasonal naive, it adds no value.
Q13–20 Rapid Fire:
Q13. What is Holt-Winters? Triple Exponential Smoothing with equations for level, trend, and seasonality. Additive for constant-amplitude seasonality; multiplicative for growing amplitude. Fast, simple, surprisingly competitive baseline.
Q14. What is cointegration? Two non-stationary series are cointegrated if their linear combination is stationary — implies a long-run equilibrium relationship. Tested with Engle-Granger test; modelled with VECM.
Q15. How do you handle hierarchical time series? Bottom-up, top-down, or optimal reconciliation (MinT) to ensure forecasts aggregate correctly across hierarchy levels. Libraries: statsforecast, scikit-hts.
Q16. What is intermittent demand forecasting? Forecasting series with frequent zeros (spare parts). Croston's method separates demand size and inter-demand interval. TSB and ADIDA are modern alternatives.
Q17. What is the Naive seasonal baseline? Forecast next period = same period last year/week. If your model cannot beat this trivial baseline, it adds no value. Always compute MASE relative to seasonal naive as your minimum bar.
Q18. How do you detect time series anomalies? Statistical: z-score or IQR on model residuals after decomposition. ML: isolation forest, LSTM reconstruction error (high error = anomaly). Production: Facebook Prophet residual monitoring, Amazon RRCF for streaming.
Q19. What is forward-fill vs backfill in time series? Forward-fill: fill missing value with last known value — appropriate for slow-changing sensors, inventory. Backfill: fill with next known value. Never ffill across long gaps without flagging — 30 days of filled data is not real data.
Q20. What is Granger causality? A statistical test asking whether past values of series X improve prediction of series Y beyond Y's own past. X Granger-causes Y if including X's lags significantly reduces forecast error. Note: Granger causality is predictive, not mechanistic — it does not prove true causal relationships.
Conclusion
Time series forecasting interviews test both classical statistical knowledge (ARIMA, stationarity, ACF/PACF) and modern ML awareness (LightGBM with lag features, LSTM, Prophet). The strongest candidates understand when to use each: Holt-Winters for quick deployment, gradient boosting for non-linear patterns with covariates, Prophet for business series with holidays, and LSTM/TFT for long-sequence multivariate problems. See our Feature Engineering Interview Q&A for the lag and rolling feature patterns that power ML-based time series models.



