What is data leakage and how do you prevent it?
Data leakage occurs when information that would not be available at prediction time leaks into training, producing overly optimistic validation scores that collapse in production. Common forms: target leakage, where a feature is a proxy for or derived from the label (e.g. a 'payment_received' flag when predicting default); train-test contamination, where preprocessing like scaling, imputation, or feature selection is fit on the full dataset before splitting, letting test statistics bleed into training; and temporal leakage, using future information to predict the past. Prevention: split data first, then fit all transformations only on the training fold, ideally inside a pipeline that is cross-validated as a unit; use time-based splits for temporal data; and scrutinize any feature that is suspiciously predictive. A model that seems too good to be true usually has leakage.