InterviewStack.io LogoInterviewStack.io

Decision Trees and Ensemble Methods Questions

How decision trees recursively split data. Hyperparameters: max depth, min samples split, criterion. Ensemble methods: random forests, gradient boosting. Understanding why ensembles work (combining weak learners). Trade-offs: complexity, interpretability, bias-variance. When to use trees vs. linear models.

MediumTechnical
101 practiced
Handling high-cardinality categorical features: Discuss techniques for encoding high-cardinality categorical variables for tree ensembles and linear models (target encoding, frequency encoding, hashing, one-hot), explain leakage risks, and recommend best practices for training and serving in production.
MediumTechnical
73 practiced
Coding: Implement two Python functions: gini_impurity(y) and information_gain(y_parent, y_left, y_right). Arrays y contain class labels (integers). Ensure functions are correct for binary and multi-class labels and run in O(n) time relative to input sizes.
MediumTechnical
83 practiced
Interpretability: Explain Partial Dependence Plots (PDP) and Individual Conditional Expectation (ICE) plots for interpreting feature effects in tree ensembles. Describe how correlated features affect PDPs and propose robust alternatives for interpreting effects under correlation.
EasyTechnical
123 practiced
Compare Gini impurity and Shannon entropy as split criteria for classification trees. Explain their definitions, how they influence split choices in practice, computational differences, and whether one is generally preferred over the other in production.
MediumTechnical
75 practiced
Describe how Out-Of-Bag (OOB) error is computed in Random Forests. What are the advantages and limitations of using OOB error instead of k-fold cross-validation for hyperparameter tuning and model evaluation in production?

Unlock Full Question Bank

Get access to hundreds of Decision Trees and Ensemble Methods interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.