ML Interview Question Bank
Having recently spent a good portion of my time interviewing with companies for ML roles, I realised that I couldn’t find a comprehensive list of topics or questions to go through before any ML interview. Rohan and I compiled this list of questions and references as we interviewed with numerous companies for the second half of last year.
Questions
General
- What is bias-variance tradeoff? Which models exbhibit low variance?
- How can we avoid underfitting and overfitting?
- How do you deal with imbalanced data?
- What is the difference between L1 and L2 regularisation? Why does L1 drive weights to zero?
- Why do we use batchnorm?
- What is the difference between SGD and GD?
- Compare Momentum, RMSProp, Adagrad and Adam.
- How do you decide between standardization and normalization?
- What is the reparameterization trick?
- What is Xavier init and why do we use it?
- When no. of features is greater than number of examples, why do we not have a unique solution to minimize the residual sum of squares?
- What is inductive bias?
- How can we reduce the dimensionality of a large dataset? (PCA)
- Express the bias variance decomposition as MSE loss.
- What is the effect of batch size on training?
Models
- What are the drawbacks of K-means algorithm?
- How can you choose the optimal k for K-means?
- In KNN, if k=1, does it have high variance or bias?
- Compare bagging and boosting methods.
- What is weakly supervised learning?
- What are the basic assumptions to be made for linear regression?
- Why would we not pass ordinal values to a model for categories?
- What is the Kernel trick for SVMs?
- How do you do dropout in RNNs? How does it work during test time?
- What are the assumptions we make for Naive Bayes algorithm?
- What is the difference between Naive Bayes and Logistic Regression?
- In linear regression, why do we use sum of squares?
- What is the gradient boosting algorithm? Difference between Gradient boosted Decision Trees and Random Forests?
- What is the difference between SVMs and Logistic Regression? Write down the loss functions.
- What is the difference between Collaborative and content based filtering?
Evaluation
- What is Type I and Type II error?
- What is precision, recall, F1 and ROC curve?
- How do you do k-fold validation for time series data?
- How do we evaluate multi-label classification problems?
Useful References:
- Chip Huyen's book on ML interviews gives a comprehensive overview of the interview process.
- Patrick Halina has a really good Systems Design guide. I have used this as a reference for every System Design interview I have ever done.
- CS 229 Cheatsheets are useful for a quick revision of concepts.
- If you are interviewing for NLP roles, I would recommend reading the BERT paper and Transformer paper before the interview.