InterviewStack.io LogoInterviewStack.io

Machine Learning Algorithms and Theory Questions

Core supervised and unsupervised machine learning algorithms and the theoretical principles that guide their selection and use. Covers linear regression, logistic regression, decision trees, random forests, gradient boosting, support vector machines, k means clustering, hierarchical clustering, principal component analysis, and anomaly detection. Topics include model selection, bias variance trade off, regularization, overfitting and underfitting, ensemble methods and why they reduce variance, computational complexity and scaling considerations, interpretability versus predictive power, common hyperparameters and tuning strategies, and practical guidance on when each algorithm is appropriate given data size, feature types, noise, and explainability requirements.

MediumTechnical
21 practiced
Compare Support Vector Machines (SVM) and logistic regression for binary classification. Cover the differences in objective (hinge vs log-loss), margin interpretation, the role of regularization, use and cost of kernels, typical complexity in training and memory, and practical advice on when to use linear SVMs, kernel SVMs, or logistic regression in production.
EasyTechnical
23 practiced
Compare L1 (Lasso) and L2 (Ridge) regularization for linear models. Explain how each penalty affects coefficients (sparsity, shrinkage), behavior with correlated features, numerical/optimization considerations, and give guidance for choosing between L1, L2, and Elastic Net on a high-dimensional correlated dataset in production.
HardTechnical
21 practiced
You have an ensemble of heterogeneous models (tree-based, neural nets, linear) and limited validation data. Design an automated pipeline to learn stacking/ensembling weights in production that copes with concept drift, maintains low inference latency, and prevents leakage. Justify choices for meta-learner, regularization on weights, retraining cadence, and online vs batch updates.
MediumTechnical
26 practiced
Explain gradient boosting with decision trees: describe the stage-wise additive model, how gradients (pseudo-residuals) are computed and fitted by new trees, the roles of learning rate (shrinkage), number of leaves/depth, row/feature subsampling, and regularization terms. Contrast XGBoost, LightGBM, and CatBoost on algorithmic choices and production trade-offs.
EasyTechnical
27 practiced
Explain how decision trees choose splits for classification and regression. Describe impurity measures (Gini, entropy, MSE), how thresholds for continuous features are selected, handling of missing/categorical values, and common stopping/pruning strategies (max depth, min samples leaf, cost-complexity pruning) used in production systems.

Unlock Full Question Bank

Get access to hundreds of Machine Learning Algorithms and Theory interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.