Data Science Interview Preparation Notes
1. Bias-Variance Tradeoff
In predictive modelling, bias refers to the error introduced when a model makes overly simplistic
assumptions about the underlying data, while variance refers to how much the model's predictions change
when trained on different subsets of data. A model with high bias tends to underfit, missing important
patterns, whereas a model with high variance tends to overfit, capturing noise as if it were signal.
The practical goal during model selection is to find a sweet spot where both bias and variance are kept
reasonably low. Techniques such as cross-validation, regularization (L1/L2), and ensemble methods
(bagging, boosting) are commonly used to manage this tradeoff.
2. Evaluation Metrics
For classification problems, accuracy alone can be misleading, particularly with imbalanced datasets.
Precision measures how many predicted positives are actually correct, recall measures how many actual
positives were captured, and the F1-score balances the two. ROC-AUC is useful for evaluating a
classifier's ability to distinguish between classes across thresholds.
For regression problems, common metrics include Mean Absolute Error (MAE), Mean Squared Error
(MSE), and R-squared. MAE is more robust to outliers, while MSE penalizes larger errors more heavily
due to squaring.
3. Handling Missing Data
• Deletion: removing rows or columns with missing values, appropriate only when the missingness is
minimal and random.
• Mean/median/mode imputation: simple but can distort variance and correlations.
• Model-based imputation: using regression or k-nearest neighbours to estimate missing values based
on other features.
• Flagging missingness: adding a binary indicator column so the model can learn from the pattern of
missingness itself.
4. Feature Engineering Basics
Good feature engineering often has more impact on model performance than algorithm choice. Common
techniques include creating interaction terms, binning continuous variables, encoding categorical variables
(one-hot, target encoding), and extracting date-time components such as day-of-week or seasonality
indicators.
Domain knowledge plays a critical role here: understanding what drives the outcome in a business or
scientific context often reveals feature transformations that a purely statistical approach would miss.
5. Common Interview Questions to Practice
• Explain the difference between supervised and unsupervised learning with examples.
• How would you detect and handle multicollinearity in a regression model?
• Walk through how you would design an A/B test for a new product feature.
• What steps would you take if your model performs well in training but poorly in production?
• How do you decide between a simpler interpretable model and a complex black-box model?