A model performed strongly in offline evaluation but its accuracy dropped sharply once deployed. You suspect a feature-engineering issue. How do you investigate whether leakage is the cause, and how do you prevent it going forward?

technical-conceptual · Senior level · data-ml

What the interviewer is really asking

Assesses the candidate's ability to diagnose train/serve leakage — features built from information unavailable at prediction time, preprocessing fit on the whole dataset, or temporal violations — and to put guardrails in place, which is a senior responsibility.

What to say

What to avoid

Example answers

Strong: A big offline-to-online drop is the textbook leakage signature, so I'd audit features for information not available at prediction time. I'd check three things: a feature derived from the label or from events after the decision point; preprocessing — scaler, encoder, imputer — fit on the full dataset before splitting so it saw test rows; and a random split on time-ordered data instead of forward-chaining. The fix is to split first and fit every transform inside the training fold, reconstruct features as-of the prediction timestamp via a point-in-time feature store, and add a train/serve skew monitor so the next leaky feature trips an alarm instead of shipping.

Weak: Offline and online differ all the time, so I'd retrain with more data and maybe a stronger model, and tune the threshold until online accuracy comes back up. If that doesn't work I'd try a different architecture.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.