Q1. Explain the bias-variance trade-off.
Short answer: High bias underfits, high variance overfits; you tune model complexity to balance both.
Strong answer: Bias is error from overly simple assumptions (underfitting); variance is sensitivity to training-data noise (overfitting). Increasing model complexity lowers bias but raises variance. You balance them via regularization, cross-validation, more data and appropriate complexity to minimize total generalization error.
Likely follow-up: How does regularization affect this trade-off?
What the interviewer is checking: Core ML theory.
Common mistake: Optimizing training accuracy while ignoring generalization.
Q2. How do you handle an imbalanced dataset?
Short answer: Resample, reweight, use the right metrics, and pick threshold by business cost.
Strong answer: Address imbalance with resampling (oversample minority/SMOTE or undersample majority), class weighting, and choosing metrics beyond accuracy (precision/recall, F1, PR-AUC). Tune the decision threshold to the cost of false positives vs negatives. Accuracy is misleading when one class dominates.
Likely follow-up: Why is accuracy a poor metric for a 99:1 imbalance?
What the interviewer is checking: Practical modeling judgment.
Common mistake: Reporting high accuracy on a skewed dataset.
Q3. What is overfitting and how do you prevent it?
Short answer: The model memorizes training data; prevent with regularization, more data and validation.
Strong answer: Overfitting is when a model fits noise in training data and generalizes poorly. Prevent it with regularization (L1/L2, dropout), more/augmented data, simpler models, early stopping, and cross-validation to detect it. The gap between training and validation performance is the tell.
Likely follow-up: How does early stopping help?
What the interviewer is checking: Generalization understanding.
Common mistake: Trusting training accuracy without a validation set.
Q4. How do you choose evaluation metrics for a model?
Short answer: Match the metric to the task and business cost — not just accuracy.
Strong answer: For classification use precision/recall/F1/ROC-AUC/PR-AUC depending on imbalance and error costs; for regression use RMSE/MAE/R². Ranking uses NDCG/MAP. Always tie the metric to the business objective and the cost of each error type, and evaluate on held-out data.
Likely follow-up: When do you prefer PR-AUC over ROC-AUC?
What the interviewer is checking: Evaluation maturity.
Common mistake: Defaulting to accuracy for every problem.
Q5. Explain the difference between supervised, unsupervised and reinforcement learning.
Short answer: Supervised uses labels, unsupervised finds structure, RL learns from rewards.
Strong answer: Supervised learning maps inputs to labeled outputs (classification/regression). Unsupervised finds structure without labels (clustering, dimensionality reduction). Reinforcement learning trains an agent via rewards from interacting with an environment. The choice depends on whether you have labels and whether it is a sequential-decision problem.
Likely follow-up: Give a real use case for each.
What the interviewer is checking: Foundational ML taxonomy.
Common mistake: Confusing clustering with classification.
Q6. How would you deploy and monitor an ML model in production?
Short answer: Serve via API/batch, version it, and monitor drift, latency and accuracy.
Strong answer: Package the model with its preprocessing, serve via a real-time endpoint or batch job, version it in a registry, and monitor input drift, prediction distributions, latency and (when labels arrive) live accuracy — with alerts and a retraining/rollback path. Offline metrics don’t guarantee production performance.
Likely follow-up: What signals tell you a deployed model is degrading?
What the interviewer is checking: Production ML awareness.
Common mistake: Treating deployment as the finish line with no monitoring.
Q7. What is feature engineering and why does it matter?
Short answer: Transforming raw data into informative features that improve model performance.
Strong answer: Feature engineering creates, transforms and selects inputs (scaling, encoding, aggregations, domain features) so models can learn effectively. For classical ML it often matters more than the algorithm. Guard against data leakage (using future/label-derived info) and ensure the same transforms run in training and serving.
Likely follow-up: What is data leakage and how do you avoid it?
What the interviewer is checking: Practical modeling skill.
Common mistake: Leaking target information into features.