Interview practice

Data Scientist / ML Engineer

2–5 years · Mid — Python · Statistics · scikit-learn · Feature engineering · Model evaluation · Deployment

0–2 years 2–5 years 5–8 years 8+ years
technical Feature engineering 1 of 6
You have a dataset with 10,000 rows and a target variable that is 95% zeroes and 5% ones. What approaches do you take to handle feature selection and engineering for this imbalanced dataset?
What a strong answer covers

Considers using techniques like SMOTE for oversampling or random undersampling; assesses feature importance using models like Random Forest; applies dimensionality reduction techniques like PCA if necessary; evaluates features based on their predictive power using cross-validation.

The follow-up you would get

What metric do you choose to evaluate model performance on this imbalanced dataset?

Could you have answered that?
technical Data access patterns 2 of 6
You are working with a large dataset that requires frequent access during model training. What strategies do you use to optimise data access patterns?
What a strong answer covers

Utilises data partitioning or sharding to improve access speeds; leverages in-memory data structures or databases; implements efficient data loading techniques such as lazy loading; evaluates batch processing to reduce overhead.

The follow-up you would get

How do you handle feature engineering in a streaming data scenario?

Could you have answered that?
scenario Data Validation 3 of 6
You deployed a model that uses real-time data for predictions, but you're receiving unexpected results. The data source has been updated, but the model has not been retrained. What do you do first?
What a strong answer covers

Check data pipeline logs for discrepancies; validate incoming data against expected schema and distribution; assess model performance metrics on historical versus new data; identify any changes in feature engineering due to the data update; decide on immediate retraining or fallback plan.

The follow-up you would get

The updated data includes new categories not present in the training set. How do you handle this categorisation issue?

Could you have answered that?
scenario API Design 4 of 6
You are responsible for an API that serves model predictions, but users are experiencing timeouts. What immediate actions do you take to diagnose the issue?
What a strong answer covers

Check API request logs for response times and error rates; profile the model's inference time to identify bottlenecks; assess the server load and resource allocation; review the data preprocessing steps for inefficiencies; evaluate if caching can be implemented for frequent requests.

The follow-up you would get

After optimising, response times improve but fluctuate. How do you ensure consistent performance moving forward?

Could you have answered that?
technical Model validation 5 of 6
You are validating a regression model that outputs predictions with a high variance, indicating overfitting. What strategies do you employ to address this issue?
What a strong answer covers

Considers regularisation techniques like Lasso or Ridge regression; evaluates the complexity of the model and simplifies if necessary; conducts k-fold cross-validation to ensure robustness; looks into feature selection to remove multicollinearity.

The follow-up you would get

What impact does feature scaling have on regularised models?

Could you have answered that?
scenario Model Monitoring 6 of 6
Your model has been live for a month, and you notice a gradual decline in performance metrics. Walk me through your investigation process.
What a strong answer covers

Review model performance metrics over time to identify trends; check for concept drift using statistical tests; compare recent input data distributions to training data; evaluate external factors influencing predictions; determine if retraining is necessary and plan for data collection.

The follow-up you would get

You discover significant changes in user behaviour affecting the model's primary features. How do you adjust your strategy to mitigate this?

Could you have answered that?
That is this set.

Load six more — you will get questions you have not seen first.

Give me six more →

Say your answer out loud before revealing. Reading the answer first feels like learning and is not.