Top 5 Feature engineering Interview Questions
Browse 5 real-world technical and behavioral interview questions about Feature engineering. Review scenarios, edge cases, and architectural best practices.
A churn model scores 0.94 AUC offline and barely beats the baseline in production. One of its strongest features is populated by a process that runs after the customer has already churned. Explain what happened and how you would fix it.
The feature encodes the outcome, so the model reads the answer rather than predicting it. Offline the label and the feature come from the same snapshot, which is why validation looks excellent; in production the feature is empty at scoring time and the signal vanishes. Fix by defining features by when they were available and validating on a forward time split.
One of your features is a postcode with about 40,000 distinct values. How do you encode it?
One-hot is unusable at that width, so the options are frequency encoding, smoothed target encoding, hashing, or a library's native categorical handling. Target encoding is the strongest and the most dangerous, because it must be fitted inside each fold or it leaks the label. Use this categorical encoding answer to show the decision, trade-off, and evidence rather than a memorised definition.
Walk me through what you check for stationarity and seasonality, and what you do about what you find.
Plot the series first, then use a decomposition and an ADF or KPSS test to separate trend from seasonality from noise. Difference or transform away a trend, use Fourier terms when several seasonal periods coexist, and treat holidays and calendar structure as features rather than outliers.
A model scored well in validation and performs badly in production, with no errors anywhere. What do you check first?
Check whether training and serving compute the same features from the same definitions, because the usual cause is two implementations that disagree slightly. Nothing raises an error when they diverge - the model receives plausible numbers that mean something different from the ones it learned on.
What is target leakage, and how would you catch it before the model ships?
Target leakage happens when a feature contains information that would not be available at prediction time. Catch it by auditing feature creation times, window boundaries, post-label columns and suspiciously strong validation performance. Use this data leakage answer to show the decision, trade-off, and evidence rather than a memorised definition.