Data Scientist interview question
How do you approach feature engineering?
Start from the prediction time and domain mechanism, create only features available then, encode missingness and time carefully, fit transformations on training data, test incremental value, and monitor stability and cost.
Direct answer
What a strong answer covers
How it works
Feature engineering begins by fixing the moment of prediction and asking what is knowable then, and by understanding the mechanism in the domain that connects inputs to the outcome. Candidate features encode that mechanism: recency, frequency, ratios, changes over windows, and interactions the model family cannot learn on its own. Missingness is represented explicitly, time is handled with lags and windows aligned to the prediction date, and categorical encodings and scalers are fitted on training data only. Each feature earns its place through a measured gain on validation, and the cost of computing and monitoring it in production is part of the decision.
Example
For predicting whether a subscription renews, the useful features were logins in the last 7 and 30 days, the ratio between them as a trend, days since the last support ticket, and whether a payment had ever failed, all computed as of the renewal date minus 14 days. A feature for total lifetime logins added nothing over the windows and was dropped to keep the serving pipeline simple.
Common mistakes
- Using features that will only be available after the prediction is needed.
- Encoding categories with target statistics computed on the whole dataset.
- Keeping hundreds of features that add nothing and make the model fragile in production.
A useful answer structure
Answer from your own work.
Do not memorise a script: use only examples you can explain honestly in follow-up questions.
Open the desktop workspace and rehearse a clear answer in your own words.