Time Series Fundamentals
Demand planning, capacity forecasting, revenue projections, anomaly detection on metrics, A/B tests on daily aggregates — a large share of data science work involves data indexed by time. Time series break the assumption almost every other method in this track relies on: that observations are independent and identically distributed. Yesterday's sales predict today's; a shuffled train/test split leaks the future into the past; a model that looks 98 % accurate in-sample can be worse than "predict last week's value" out of sample. Knowing where those traps are is most of the craft.
Interviewers use time series questions to check whether you understand why the ordinary toolkit fails, not just which library to import. Expect: "why can't you use k-fold cross-validation?", "what does stationarity mean and why do you care?", "how do you read an ACF plot?", "what do p, d, q mean?", "what is wrong with MAPE?", "how would you forecast this with gradient boosting without leaking?". This subject covers all of those, with a hand-computed exponential smoothing forecast and its evaluation, so you can reproduce the arithmetic under pressure.
Two boundaries with siblings in this track: general cross-validation theory (bias/variance of CV, k-fold, nested CV) is covered in the Bias–Variance & Cross-Validation subject — here we only cover the temporal variants that keep time order intact. And gradient boosting internals are covered in the LightGBM subject; here we cover how to feed a boosted model time-series features safely.
What makes time series different
Three properties distinguish a time series y_1, y_2, \dots, y_T from an i.i.d. sample:
1. Ordering matters. The index is not an arbitrary row id — the sequence carries information (trend, momentum, regime changes). Shuffle the rows and you destroy the very thing you are modelling.
2. Autocorrelation. Observations are correlated with their own past. The autocorrelation at lag k is
If \rho_1 = 0.9, knowing y_{t-1} tells you a great deal about y_t. Consequences: the effective sample size is much smaller than T; standard errors from ordinary regression are wrong; and random train/test splits put near-duplicates of test points into training.
3. Non-stationarity. The distribution generating the data changes over time — the mean drifts (trend), the variance grows, the seasonal pattern shifts. A model estimated on the past assumes the future looks statistically like the past; when that fails, so does the model.
A quick mental test: if the series were shuffled, would you lose anything? For customer heights, no. For daily active users, everything.