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 Model evaluation 1 of 6
You deploy a classification model, and after a week, you notice a significant drop in accuracy from 90% to 60%. What steps do you take to diagnose and rectify the issue?
What a strong answer covers

Checks the data for concept drift; compares the incoming data distribution to the training data; evaluates model predictions against new labels if available; considers retraining the model with updated data or features.

The follow-up you would get

What tools or methods do you use to detect concept drift?

Could you have answered that?
scenario API Design 2 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 Feature engineering 3 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 Deployment 4 of 6
After deploying a machine learning model to production, the API response time increases significantly. How do you investigate the cause and what optimisations do you consider?
What a strong answer covers

Monitors the API logs to identify response bottlenecks; checks for model loading time and input data preprocessing efficiency; investigates the hardware and resource utilisation on the server; considers caching predictions for repeated requests.

The follow-up you would get

If the model is too large to cache, what alternative solutions do you explore?

Could you have answered that?
technical Debugging 5 of 6
During testing, you find that your model predictions are consistently biased towards the lower end of the target variable. How do you approach diagnosing this bias?
What a strong answer covers

Examines the training data for skewness or outlier effects; checks for data leakage or improper target encoding; evaluates the model's assumptions and performance metrics on different segments; considers alternative algorithms if necessary.

The follow-up you would get

What role does the choice of loss function play in this bias?

Could you have answered that?
technical Data access patterns 6 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?
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.