← Microsoft Interview Insights
This felt like a warmup but I still fumbled the practical part a little.
Start by defining bias and variance clearly, then explain how they relate to underfitting and overfitting through the bias-variance tradeoff. Finally, provide practical techniques to reduce each, emphasizing that the goal is to find a balance that minimizes total error.
Pro tip: Mention that in practice, you often diagnose bias vs. variance by comparing training and validation error curves, and that modern deep learning sometimes challenges the traditional tradeoff by allowing models to be both low bias and low variance with enough data and regularization.
Bias is the error from erroneous assumptions in the learning algorithm, leading to underfitting. Variance is the error from sensitivity to small fluctuations in the training set, leading to overfitting.
Describe how increasing model complexity decreases bias but increases variance, and vice versa. The optimal model balances both to minimize total error.
Underfitting occurs when the model is too simple (high bias, low variance), while overfitting occurs when the model is too complex (low bias, high variance).
Use more complex models, add more features, reduce regularization, or use ensemble methods like boosting.
Use more training data, apply regularization (L1/L2), use dropout, simplify the model, or use ensemble methods like bagging.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
The confusion matrix part is where I actually felt confident.
Start by clearly defining each metric in terms of TP, FP, TN, FN, then explain why accuracy is misleading for imbalanced data. Walk through the formulas for each metric and discuss how to choose the right one based on business objectives and class distribution.
Pro tip: Mention that the choice of metric should align with the cost of false positives vs false negatives, and consider using precision-recall AUC or F-beta for imbalanced datasets.
Define accuracy, precision, recall, and F1 in terms of TP, FP, TN, FN. Explain that accuracy is (TP+TN)/(TP+FP+TN+FN), precision is TP/(TP+FP), recall is TP/(TP+FN), and F1 is the harmonic mean of precision and recall.
Discuss that accuracy is misleading when classes are imbalanced because a naive model predicting the majority class can achieve high accuracy but fail to capture the minority class. Give an example, such as 99% accuracy on a dataset with 1% positives.
Show how to compute each metric from the confusion matrix values. Emphasize that precision and recall are more informative for imbalanced data, and F1 balances both.
Explain that the choice depends on the problem: if false positives are costly, optimize precision; if false negatives are costly, optimize recall; if both matter, optimize F1 or a weighted variant like F-beta. Also consider using PR-AUC or ROC-AUC.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.
Blanked for a second on the assumptions part.
Start by defining a confidence interval as a range of plausible values for a population parameter, then explain the standard normal approximation method for a proportion using the formula p̂ ± z*√(p̂(1-p̂)/n). Discuss the assumptions (random sampling, independence, and large sample size) and mention alternatives like Wilson score interval, Clopper-Pearson, and bootstrap when assumptions are violated.
Pro tip: Emphasize that for ML evaluation, the test set is a finite sample and the CI quantifies uncertainty due to sampling; also note that if the test set is not randomly sampled from the target population, the CI may not be valid regardless of method.
Explain that a 95% CI is a range that would contain the true parameter in 95% of repeated samples, not a probability about the parameter itself.
For accuracy p̂ on n samples, the normal approximation CI is p̂ ± 1.96 * sqrt(p̂(1-p̂)/n), assuming n is large enough.
Assumptions: independent samples, random sampling from the population, and np̂ ≥ 10 and n(1-p̂) ≥ 10 for normal approximation.
When assumptions fail (small n or extreme p̂), use Wilson score interval, Clopper-Pearson exact interval, or bootstrap resampling.
Highlight that in ML, the test set is often a holdout, so independence may be violated if samples are correlated; consider clustered or stratified sampling.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.