Machine Learning Fundamentals interview question · Most asked

Compare decision trees, random forests and gradient boosting.

Comparison Asked in Machine Learning Engineer interviews

Members can save this page, take notes and track progress. See membership · Sign in

Summary

A decision tree splits data with if/else rules; it's interpretable but overfits easily. A random forest averages many deep trees trained on random samples and feature subsets, which reduces variance. Gradient boosting (XGBoost, LightGBM, CatBoost) builds shallow trees one after another, each fixing the previous errors, and usually gives the best accuracy on tabular data with more tuning.

Longer Answer

Decision tree Random forest Gradient boosting
Training one tree parallel, independent trees sequential trees
Main risk overfitting larger, slower models overfitting without early stopping
Tuning depth, min samples number of trees, max features learning rate, depth, trees, regularisation
Strength explainable robust defaults top accuracy on tabular data

Tree models need no feature scaling, handle non-linear relations and mixed types, and give feature importances (prefer permutation importance or SHAP, as split-based importance favours high-cardinality features).

Key Points

  • Trees: interpretable, overfit.
  • Forests: bagging lowers variance.
  • Boosting: sequential, strongest on tabular.
  • No scaling needed; use SHAP or permutation importance.

Explanation

What interviewers look for

Understanding bagging vs boosting and why boosting dominates tabular problems.

More Machine Learning Fundamentals questions

← All Machine Learning Fundamentals questions

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake