What are the most common data leakage mistakes in time series modeling, and how can they be prevented?

Quick Overview

Asks for the common ways future information leaks into time series models and how to prevent each one. It tests preprocessing and feature construction with lags and rolling windows, chronological validation with gaps, purging for overlapping labels, and point-in-time data availability.

What are the most common data leakage mistakes in time series modeling, and how can they be prevented?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

What are the most common data leakage mistakes in time series modeling, and how can they be prevented? ```hint Ask when each value is known For every feature and every preprocessing statistic, ask at what timestamp its value would actually be available in production. ``` ```hint Look at the whole workflow Leakage can also enter through how you split the data, tune hyperparameters and evaluate the model. ``` ### What a Strong Answer Covers - A definition of leakage in terms of information that is not available at prediction time - Leaks in preprocessing and feature construction, including lags, rolling windows and imputation - Leaks in the validation design: shuffled splits, tuning on the test period, overlapping labels - Data availability problems such as reporting delays, revised values, and actuals used in place of forecasts for exogenous inputs - Concrete prevention steps and a way to detect leakage that has already happened ### Follow-up Questions - You forecast 7 days ahead. Which lag features can you use, and how large should the gap between training and test windows be? - How do purging and embargo work, and when do you need them? - A model scores far better in backtests than in production. How would you check whether leakage is the cause? - A model uses a weather feature. What changes if you train on observed weather but serve with weather forecasts?

Overview: Asks for the common ways future information leaks into time series models and how to prevent each one. It tests preprocessing and feature construction with lags and rolling windows, chronological validation with gaps, purging for overlapping labels, and point-in-time data availability.

PracHub logo
General
Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

What are the most common data leakage mistakes in time series modeling, and how can they be prevented?

What a Strong Answer Covers Guidance

  • A definition of leakage in terms of information that is not available at prediction time
  • Leaks in preprocessing and feature construction, including lags, rolling windows and imputation
  • Leaks in the validation design: shuffled splits, tuning on the test period, overlapping labels
  • Data availability problems such as reporting delays, revised values, and actuals used in place of forecasts for exogenous inputs
  • Concrete prevention steps and a way to detect leakage that has already happened

Follow-up Questions Guidance

  • You forecast 7 days ahead. Which lag features can you use, and how large should the gap between training and test windows be?
  • How do purging and embargo work, and when do you need them?
  • A model scores far better in backtests than in production. How would you check whether leakage is the cause?
  • A model uses a weather feature. What changes if you train on observed weather but serve with weather forecasts?