Practice 45 Feature Engineering interview questions on missing values, encoding, scaling, leakage, time windows, text features, interactions, feature stores, and validation.
45 questions with answersKey Takeaways
Feature engineering is the process of creating, cleaning, transforming, and validating inputs for machine learning models. It includes handling missing values, encoding categories, scaling numeric features, creating time-window aggregates, extracting text or date features, and preventing leakage. In interviews, the best answers every feature maps to availability, predictive signal, validation, and production use.
Watch: Feature engineering for machine learning
Video: Feature engineering for machine learning (Data science tutorial, YouTube)
Test yourself and earn a certificate
6 quick questions. Score 70%+ to download your Feature Engineering certificate.
Start here. These are the definitions and first-principle checks that open most rounds.
A feature is an input variable used by a model to make predictions.
Good features are available, meaningful, tested, and relevant to the target.
Feature changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: Feature engineering for machine learning (Data science tutorial, YouTube)
Target leakage happens when a feature includes information about the label that would not be available at prediction time.
It creates inflated offline metrics.
Target leakage changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Point-in-time correctness means every feature uses only data available before the prediction timestamp.
It is critical for time-based models.
Point-in-time correctness changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Leak-safe feature path
Future data must stay out.
Imputation fills missing values using a rule such as median, most frequent, constant, or model-based fill.
The imputation rule must be learned from training data only.
Imputation changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
| Answer part | What to say | Evidence to mention |
|---|---|---|
| Definition | Imputation in one direct sentence. | Official docs or course material |
| Use case | The work where it changes a decision. | Dataset, model, query, dashboard, or pipeline |
| Risk | What breaks when it is misunderstood. | Metric, log, test result, or review note |
Categorical encoding converts categories into model-usable numeric representations.
One-hot, ordinal, target, and hashing encoders fit different cases.
Categorical encoding changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: Build machine learning pipelines with Scikit-learn (Python tutorial, YouTube)
One-hot encoding is useful for low to medium cardinality categories without ordinal meaning.
Handle unknown categories in production.
One-hot encoding changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Target encoding replaces a category with a statistic of the target for that category.
It is leakage-prone unless done with folds or time-safe logic.
Target encoding changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Scaling puts features on comparable ranges for models sensitive to magnitude.
KNN, SVM, linear models, and PCA often need scaling.
Scaling changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Log transforms can reduce skew in positive numeric variables such as income, spend, or count.
Handle zeros and negative values carefully.
Log transform changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Binning groups continuous values into ranges.
It can add stability but may lose detail.
Binning changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
An interaction feature combines variables so the model can capture relationships between them.
For example, price per unit combines amount and quantity.
Interaction feature changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A time-window feature aggregates events over a period before prediction, such as 7-day login count.
Window boundaries must be point-in-time safe.
Time-window feature changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Text features convert text into numeric input using counts, TF-IDF, embeddings, or extracted fields.
Choose method based on model and task.
Text feature changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: Scikit-Learn crash course (Python ML tutorial, YouTube)
Feature selection removes noisy, redundant, expensive, or unavailable features.
It can improve stability and reduce serving cost.
Feature selection changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
A feature store manages feature definitions, storage, reuse, and serving for training and production.
It helps reduce training-serving skew.
Feature store changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
These questions test whether you can apply the topic to real data, real code, and messy constraints.
Create recency, frequency, usage trend, support tickets, plan changes, payment issues, and engagement windows before the prediction date.
Do not use post-churn behavior.
churn features changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
# Interview check: split data, run baseline, inspect metric
from sklearn.metrics import accuracy_score
print(accuracy_score(y_true, y_pred))Use velocity, device, geolocation, merchant, amount deviation, account age, and recent failed attempts.
Features must be available before approving the transaction.
fraud features changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Check why values are missing, add missing indicators where useful, impute safely, and monitor missing rates.
Missing can be signal.
missing values changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use rare-category grouping, hashing, target encoding with leakage controls, embeddings, or domain grouping.
One-hot can explode dimensions.
high cardinality changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Extract hour, day of week, month, holiday flags, seasonality, recency, tenure, and time since last event.
Use local timezone when business logic depends on it.
date features changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Define prediction timestamp, lookback window, aggregation function, and exclude future events.
Test boundary cases.
time windows changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use length, language, keyword flags, TF-IDF, embeddings, or domain-specific extracted fields.
Clean text consistently between train and serve.
text features changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use domain review, leakage checks, missingness, correlation, permutation importance, regularization, and validation impact.
Do not select using the test set.
feature selection changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use StandardScaler for roughly normal features, RobustScaler for outliers, MinMaxScaler for bounded range needs.
Tree models usually care less.
scaling choice changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Inspect whether outliers are errors or true events, then cap, transform, flag, remove, or model separately.
Do not delete rare but important cases blindly.
outlier handling changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Watch a deeper explanation
Video: End-to-end ML pipeline on GCP (GCP tutorial, YouTube)
Use Pipeline and ColumnTransformer so feature logic is fitted on training folds and saved with the model.
This reduces leakage and serving mismatch.
feature pipeline changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Track update time, source lag, null rates, and stale value percentage for production features.
Freshness can be as important as accuracy.
feature freshness changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Document definition, owner, source, timestamp logic, allowed values, freshness, and known limits.
A feature without definition is hard to trust.
feature documentation changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Compare production distributions against training baselines by time, segment, and source.
Drift can indicate data or product changes.
feature drift changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Use one when features are reused, served online, need lineage, or must stay consistent across teams.
Small offline projects may not need it.
feature store rollout changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Advanced rounds test trade-offs, failure modes, and whether the decision can hold up under production pressure.
That feature uses future target information and leaks the answer.
Only use data known before prediction.
future leakage changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Training-serving skew can make production predictions unreliable.
Share definitions and test parity.
offline online mismatch changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
The encoder should handle unknowns or route the case through a safe fallback.
Category growth is normal.
new category changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Check source pipeline, schema change, upstream outage, and model impact.
This is a production alert.
missing spike changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Leakage may be present if encoding was fit using validation targets.
Use fold-safe or time-safe encoding.
target encoding leak changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Check leakage, collection timing, proxy variables, and correlation with target.
High importance can be a warning.
feature importance surprise changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
The split did not match time-based production use.
Use time-based validation.
bad time split changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Noise, overfitting, slower training, higher serving cost, and drift risk increase.
Select and monitor features.
too many features changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Rare extreme values may have been fraud signal.
Outlier handling needs task context.
outlier is signal changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Shared feature definition and ownership are missing.
Definitions must be explicit.
bad documentation changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Check ingestion jobs, freshness SLAs, source delays, and online store sync.
Stale features can silently hurt predictions.
feature store stale changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Resolution text may leak the label if it is written after the prediction point.
Timestamp every text source.
text leakage changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Investigate, segment impact, and watch outcomes before retraining blindly.
Not all drift is harmful.
feature drift without metric drop changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Ask about prediction time, source, leakage, missingness, encoding, drift, freshness, serving parity, and owner.
These questions prevent most feature failures.
senior review changes Feature Engineering decisions by affecting the chosen method, the failure mode, or the validation step. Reliable evidence comes from a metric, test result, query output, log, or review note.
Feature engineering has several parts. Creating features is different from selecting features, and both are different from managing features in production.
| Area | Purpose | Example | Risk |
|---|---|---|---|
| Creation | Build useful inputs | 7-day purchase count | Leaking future data |
| Transformation | Make values model-friendly | Log amount, scale age | Changing meaning silently |
| Selection | Remove weak or harmful inputs | Drop duplicate columns | Removing useful interaction signal |
| Feature store | Share and serve features | User risk score feature | Training-serving skew |
Feature engineering answer signals
Good answers focus on validity and production availability.
Prepare by taking raw data and explaining which features you would create, what each feature means, and why it is safe at prediction time.
Feature engineering interview prep flow
Most rounds reward clear reasoning more than memorized phrasing.
A strong feature engineering answer starts with prediction time. Say exactly when the model makes a prediction, what data exists at that moment, how each feature is calculated, and how you prevent leakage. production-ready answers mention point-in-time joins, feature freshness, missing value meaning, grouped validation, feature stores, drift, and how feature logic is shared between training and serving.
Feature safety depends on what is known at that exact time.
Missing can mean not collected, not applicable, delayed, or truly unknown.
Row counts, null rates, ranges, category levels, and time-window boundaries need tests.
More columns can add noise, cost, and drift risk.
6 questions, about 4 minutes. Score 70% or higher to earn a shareable certificate.
Use this Feature Engineering bank for data and modeling answers, then practice Python and Pandas tasks with Hyring's AI Coding Interviewer.
See Hyring AI Coding Interviewer