Find Look-Ahead Leakage in Order Flow Features

Last updated: November 29, 2026

Quick Overview

A colleague's model predicting five-minute price moves from order book and trade features shows a suspiciously high out-of-sample score. Walk through how you would find look-ahead leakage in the feature pipeline and how you would fix it.

SIG
Machine Learning
Machine Learning Engineer
SIG
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


A colleague's model predicting five-minute price moves from order book and trade features shows a suspiciously high out-of-sample score. Walk through how you would find look-ahead leakage in the feature pipeline and how you would fix it.

SIG builds short-horizon models from exchange data where timestamps, late corrections and bar boundaries make it easy to leak the future. The interviewer checks whether you know the common leak patterns and can design a pipeline that is point-in-time correct by construction.

What the Interviewer Expects
  • Name common leaks: centered windows, full-sample normalization, bar-close alignment, revised data
  • Check timestamps: exchange time vs. receive time vs. feature availability
  • Use point-in-time joins, as-of the decision time
  • Fit scalers and encoders only on past data
  • Run diagnostics such as shuffled-label and shifted-feature tests
  • Validate with purged walk-forward splits
Key Topics to Cover
data leakage
feature engineering
point-in-time correctness
time series validation
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you detect leakage without reading all the code?
  • What latency assumptions should features include for a model used in live trading?
  • How do overlapping five-minute labels affect validation?
  • How would you unit test a feature for point-in-time correctness?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Decision time tt; label is the mid-price move from tt to t+5t + 5 minutes. Features come from order book snapshots and trades. A feature is valid only if it could have been computed from data receive...

Approach

First look for symptoms, then audit each feature's timestamps, then rebuild with point-in-time joins. Treat a sudden jump in score as a bug until proven otherwise; for five-minute horizons, true predi...


Submit Your Answer
Markdown supported

Related Questions