Give an example of feature engineering that made a model better.
Machine learning basics · Intermediate 1
Short answer
Turn raw data into signals the model can use. For a food delivery time model, a raw timestamp helps little, but hour of day, day of week, whether it is a festival day, distance from restaurant to customer and the restaurant's recent average preparation time capture what really drives delay. Check each feature on validation data and watch for leakage.
Deeper answer
Good answers name the domain reasoning, not just the technique. Common transforms: extracting parts of dates, ratios such as amount over the customer's average, counts and aggregates over a time window, text length or keyword flags, and encodings for categories, such as target encoding fitted inside training folds.
Then prove value: compare validation scores with and without the feature, and look at feature importance. Be careful that aggregates use only past data at prediction time. Tree models need less scaling and fewer interaction features than linear models, which is worth saying if you mention model choice.
What a strong answer covers
- Gives a concrete domain example
- Explains the transform: dates, ratios, aggregates or encodings
- Reasons from what drives the target
- Validates the gain and avoids leakage
Answer it out loud in the mock interview about 1.5 min
Follow-ups to expect
- How would you encode a category with thousands of values?
- How do you know a new feature really helped?
Common mistakes
- Listing techniques with no domain reason
- Building aggregates that include the future
Learn it
- How would you tell whether a new model really performs better in an A/B test?
- Explain the bias-variance trade-off.
- What is the difference between a random forest and gradient boosting?
- How does k-means work, and how do you choose k?
- What is data leakage, and how do you prevent it?
- How do you know whether you have enough training data?
- How do you handle a heavily imbalanced classification problem, such as fraud detection?
- What is the difference between linear and logistic regression?
- How do you deal with missing values in a dataset?
- Walk me through an ML project you did, end to end.
- What is overfitting, and how do you spot it?
- Explain precision and recall with an example.
- What do L1 and L2 regularisation do?
- What is the difference between supervised and unsupervised learning?
- Why do we split data into training, validation and test sets?
- What is the difference between training and inference?