Skip to content

Time Series & Forecasting Interview Questions for Data Science

30 Time Series & Forecasting questions with answers for data science roles — 10 easy, 13 medium, 7 hard.

About Time Series & Forecasting

Time series interviews test whether you can forecast sales, demand or traffic without fooling yourself. Expect questions on trend and seasonality, stationarity, ARIMA and exponential smoothing, time-based validation, forecast metrics like MAPE and MASE, holiday effects and scaling forecasts to thousands of products. Interviewers care most about leakage-free backtesting and communicating uncertainty to planners.

Sheet progressStart practicing
3 QUESTIONS FREESign up to unlock the full question bank and track your progress.Unlock every question and answer, then continue practising company-wise and package-wise.
3 questions free Unlock the rest in seconds
01

What is a time series and how is it different from ordinary tabular data?

Save to ▾
Show answer
A time series is a sequence of observations recorded at ordered time steps, such as daily sales or hourly website traffic. Unlike ordinary tabular data, rows are not independent: today's value depends on yesterday's, and the order cannot be shuffled. This changes everything downstream. You must split train and test by time, build features only from the past, and check for trend and seasonality before choosing a model.
02

What are trend, seasonality and noise in a time series?

Save to ▾
Show answer
Trend is the long-term direction of the series, such as steady growth in monthly users. Seasonality is a pattern that repeats at a fixed period, like higher sales every weekend or every festive season. Noise is the random variation left after removing trend and seasonality. Separating these parts, through decomposition, helps you understand the data and pick a model that can capture each component properly.
03

What is stationarity and why do many forecasting models need it?

Save to ▾
Show answer
A stationary series has a constant mean, constant variance and an autocorrelation structure that does not change over time. Classical models like ARMA assume stationarity because they learn fixed relationships between past and present values; if the mean keeps drifting, those relationships break. You usually make a series stationary by differencing to remove trend, seasonal differencing to remove seasonality, and a log transform to stabilise growing variance.
04

What is differencing in time series analysis?

Save to ▾
Show answer
Differencing replaces each value with the change from the previous value: y_t minus y_(t-1). It removes a linear trend and often makes a series stationary. Seasonal differencing subtracts the value one season back, such as y_t minus y_(t-7) for daily data with a weekly cycle. Avoid over-differencing, because it adds noise and negative autocorrelation. In ARIMA, the d parameter is the number of times you difference.
05

What are naive and seasonal naive forecasts, and why should you always compute them?

Save to ▾
Show answer
A naive forecast predicts that the next value equals the last observed value. A seasonal naive forecast predicts the value from the same period last season, such as last Monday for next Monday. They take seconds to build and are surprisingly hard to beat on many business series. Always report your model's error relative to these baselines; if a complex model cannot beat seasonal naive, it is not adding value.
06

What is the difference between additive and multiplicative seasonality?

Save to ▾
Show answer
With additive seasonality the seasonal swing is a fixed amount, for example weekends always add about 500 orders regardless of the overall level. With multiplicative seasonality the swing is a percentage of the level, so as the business grows the weekend spike grows too. A quick check is to plot the series: if the peaks widen as the trend rises, use multiplicative, or take a log and model it additively.
07

What is a prediction interval and why should a forecast include one?

Save to ▾
Show answer
A prediction interval gives a range in which a future value is expected to fall with a stated probability, such as 80 or 95 percent. A point forecast of 1,000 units means little without knowing whether the realistic range is 950 to 1,050 or 400 to 1,600. Planners use the interval to set safety stock and staffing. Intervals widen with the horizon because uncertainty accumulates over time.
08

Your logging system was down for four days, leaving gaps in a daily series. How do you handle them before modelling?

Save to ▾
Show answer
First make the gaps explicit by reindexing to a full daily calendar so missing days appear as NaN instead of silently disappearing. For short gaps, linear or time-based interpolation is usually fine. If there is strong weekly seasonality, fill using the same weekday from neighbouring weeks or a seasonal decomposition. Add a flag column marking imputed days, and never treat missing as zero unless zero really happened.
09

Write Pandas code to resample daily sales into weekly totals and monthly averages.

Save to ▾
Show answer
import pandas as pd df['date'] = pd.to_datetime(df['date']) s = df.set_index('date')['sales'].sort_index() # Weekly totals, weeks ending on Sunday weekly = s.resample('W-SUN').sum() # Monthly average of daily sales monthly = s.resample('MS').mean() print(weekly.head()) print(monthly.head())
10

Write Python code to decompose a monthly series into trend, seasonal and residual parts with STL.

Save to ▾
Show answer
import pandas as pd from statsmodels.tsa.seasonal import STL s = df.set_index('month')['sales'].asfreq('MS') res = STL(s, period=12, robust=True).fit() parts = pd.DataFrame({ 'trend': res.trend, 'seasonal': res.seasonal, 'resid': res.resid }) print(parts.tail()) res.plot()
11

What do ACF and PACF plots tell you about a time series?

Save to ▾
Show answer
The ACF plot shows correlation between the series and its own lags, including indirect effects through intermediate lags. The PACF shows the correlation at each lag after removing the effect of shorter lags. For a stationary series, a PACF that cuts off after lag p suggests an AR(p) term, and an ACF that cuts off after lag q suggests an MA(q) term. Spikes at lag 7 or 12 reveal weekly or yearly seasonality.
12

What is the Augmented Dickey-Fuller test?

Save to ▾
Show answer
The ADF test checks whether a series has a unit root, which means it is non-stationary. The null hypothesis is that a unit root exists. A small p-value, say below 0.05, lets you reject the null and treat the series as stationary. It is often paired with the KPSS test, whose null is the opposite, stationarity. Using both gives a more reliable conclusion before choosing how much to difference.
13

Explain exponential smoothing and the Holt-Winters method.

Save to ▾
Show answer
Simple exponential smoothing forecasts with a weighted average of past values where weights decay exponentially, so recent points matter more. Holt's method adds a smoothed trend component. Holt-Winters adds a seasonal component as well, either additive or multiplicative. Each component has a smoothing parameter between 0 and 1 that is fitted to the data. These models are fast, easy to explain and strong baselines for retail and demand data.
14

What is SARIMA and how does it extend a plain ARIMA model?

Save to ▾
Show answer
SARIMA adds seasonal terms to ARIMA. It is written ARIMA(p,d,q)(P,D,Q)m, where the second set are seasonal AR, differencing and MA orders, and m is the season length, such as 7 for daily data with a weekly cycle or 12 for monthly data. SARIMAX further allows external regressors like price or holidays. It handles one seasonal period well but struggles with multiple seasonalities, such as daily plus yearly.
15

What is MAPE and when is it a poor metric for forecast accuracy?

Save to ▾
Show answer
MAPE is the mean of absolute errors divided by actual values, expressed as a percentage. It is easy to explain to business teams, but it breaks when actuals are zero or near zero, because the percentage explodes. It also penalises over-forecasts more than under-forecasts and weights small items heavily. For intermittent or low-volume series prefer MAE, weighted MAPE or MASE, which compares error to a naive baseline.
16

Your daily sales forecast badly misses the Diwali spike every year. How do you fix it?

Save to ▾
Show answer
The model is treating Diwali as noise because the festival moves on the calendar and a fixed yearly seasonality does not align. Add explicit holiday features: a flag for Diwali and a few days before and after, since buying starts early. Include other regional festivals and sale events too. Models like Prophet or gradient boosting with holiday features handle this well. Then backtest specifically on past festive periods to confirm the fix.
17

You must forecast demand for a new product that has only three weeks of history. What do you do?

Save to ▾
Show answer
Three weeks is too little to learn seasonality, so borrow information. Find similar past launches by category, price band and channel, and use their early sales curves as analogues. A global model trained across many products, with product attributes as features, can also forecast a cold-start item. Combine this with planned marketing spend and business judgement, show a wide interval, and update the forecast weekly as real data arrives.
18

Most of your products sell zero units on most days, with occasional sales. Which forecasting approach suits this?

Save to ▾
Show answer
This is intermittent demand, and standard models like ARIMA forecast a small constant that is useless for stocking. Croston's method and its SBA variant forecast the size of non-zero demand and the interval between sales separately. Alternatives are aggregating to weekly level, or using a global gradient boosting model with Tweedie or Poisson loss. Evaluate with MAE or MASE, not MAPE, because zero actuals break percentage errors.
19

Your forecast uses actual daily temperature as a feature and looks great in backtesting, but it performs worse in production. Why?

Save to ▾
Show answer
In backtesting you used the actual temperature for future days, which you will never know at forecast time. In production the model gets a weather forecast, which has its own error, so performance drops. This is a subtle form of leakage. Fix the backtest by using the weather forecast that was available on each forecast date, or lagged actuals, so offline results match what production can really achieve.
20

Write Python code to run an ADF stationarity test and difference the series if needed.

Save to ▾
Show answer
from statsmodels.tsa.stattools import adfuller def is_stationary(s, alpha=0.05): p_value = adfuller(s.dropna())[1] return p_value < alpha series = s.copy() d = 0 while not is_stationary(series) and d < 2: series = series.diff() d += 1 print('differencing order d =', d)
21

Write Python code to evaluate a forecasting model with expanding-window time series cross-validation.

Save to ▾
Show answer
import numpy as np from sklearn.model_selection import TimeSeriesSplit from sklearn.metrics import mean_absolute_error tscv = TimeSeriesSplit(n_splits=5, test_size=28) scores = [] for tr, te in tscv.split(X): model.fit(X.iloc[tr], y.iloc[tr]) pred = model.predict(X.iloc[te]) scores.append(mean_absolute_error(y.iloc[te], pred)) print(np.mean(scores), scores)
22

Write Python code to fit a Holt-Winters model and forecast the next 12 months.

Save to ▾
Show answer
from statsmodels.tsa.holtwinters import ExponentialSmoothing s = df.set_index('month')['sales'].asfreq('MS') train, test = s[:-12], s[-12:] model = ExponentialSmoothing( train, trend='add', seasonal='mul', seasonal_periods=12 ).fit() forecast = model.forecast(12) mae = (forecast - test).abs().mean() print(forecast.round(1), 'MAE:', round(mae, 1))
23

Tell me about a time your forecast was badly wrong. How did you handle it?

Save to ▾
Show answer
Situation: my weekly demand forecast under-predicted a category by 30 percent for a month. Task: explain the miss and stop it recurring. Action: I compared forecast and actuals by region and found a new distribution channel had launched that the model knew nothing about. I told the planning team quickly, added channel as a feature and set up a weekly error review. Result: error returned to normal and planners trusted the alerts.
24

What is the difference between recursive and direct multi-step forecasting?

Save to ▾
Show answer
In recursive forecasting you train a one-step model and feed each prediction back as an input to predict the next step, so errors compound over the horizon. In direct forecasting you train a separate model for each horizon, such as one for t+1 and another for t+7, which avoids compounding but costs more and may give inconsistent forecasts. Hybrid and multi-output approaches sit in between and are common in production.
25

What is hierarchical forecasting and why is reconciliation needed?

Save to ▾
Show answer
Hierarchical forecasting produces forecasts at several levels, such as SKU, store, city and national totals. If you forecast each level independently, the store forecasts will not add up to the city forecast. Reconciliation adjusts them to be consistent. Bottom-up sums the lowest level, top-down splits the total by proportions, and methods like MinT combine all levels optimally. Consistent numbers matter because finance, supply chain and stores plan from different levels.
26

You need forecasts for 50,000 SKUs every week. Would you build one model per series or one global model?

Save to ▾
Show answer
One classical model per SKU is simple and interpretable but expensive to maintain, and it fails for short or sparse series. A global model, such as LightGBM trained on all SKUs with lags, calendar and product features, learns shared patterns and handles new items better. In practice I would use a global model as the main engine, keep statistical models for a few high-value series, and compare both in a rolling backtest.
27

Your training history includes a lockdown period when demand collapsed and then rebounded. How do you treat it?

Save to ▾
Show answer
That period is a structural break, not normal behaviour, and letting a model learn from it raw will distort trend and seasonality. Options are to add an indicator feature so the model attributes the drop to the event, to replace the period with values from a counterfactual estimate, or to train only on data after the recovery if enough history exists. Compare options with backtests on recent normal periods and document the choice.
28

For a warehouse, a stockout costs five times more than holding extra stock. How should the forecast change?

Save to ▾
Show answer
A forecast of the mean is the wrong target when costs are asymmetric. Forecast a quantile instead. The optimal quantile here is about 5 divided by 5 plus 1, roughly the 83rd percentile, which is the newsvendor critical ratio. Train with quantile or pinball loss, or use prediction intervals from a probabilistic model. Evaluate with pinball loss and the actual stockout and holding cost, not just MAE.
29

Write a Python function to compute MASE for a seasonal forecast.

Save to ▾
Show answer
import numpy as np def mase(y_train, y_true, y_pred, m=7): # Scale: in-sample error of seasonal naive y_train = np.asarray(y_train) scale = np.mean(np.abs(y_train[m:] - y_train[:-m])) err = np.mean(np.abs(np.asarray(y_true) - np.asarray(y_pred))) return err / scale # MASE below 1 beats seasonal naive
30

How would you convince a planning team that uses spreadsheet moving averages to adopt a new forecasting model?

Save to ▾
Show answer
Situation: planners relied on a 4-week moving average and distrusted models. Task: move them to a better forecast without forcing it. Action: I ran both methods side by side for eight weeks, showed error and stockout cost in rupees, kept their override option and explained forecasts with simple drivers like holidays and price. Result: the model cut error by about 20 percent, planners adopted it category by category, and overrides fell steadily.

Frequently asked questions

How important is Time Series & Forecasting in Data Science interviews?

Time series interviews test whether you can forecast sales, demand or traffic without fooling yourself. Expect questions on trend and seasonality, stationarity, ARIMA and exponential smoothing, time-based validation, forecast metrics like MAPE and MASE, holiday effects and scaling forecasts to thousands of products. Interviewers care most about leakage-free backtesting and communicating uncertainty to planners.

How should I use the Time Series & Forecasting sheet?

Go top to bottom — easy to hard. Answer before opening each answer, tick what you solved and save misses to Last-Minute Revision.