PracHub
QuestionsLearningGuidesInterview Prep
|Home/Machine Learning

Compare trees, RF, and gradient boosting

Last updated: Jul 4, 2026

Quick Overview

This question evaluates understanding of tree-based supervised learning methods—decision trees, random forests, and gradient-boosted trees—including key hyperparameters, bias–variance trade-offs, validation techniques such as out-of-bag estimation, suitability for high-dimensional sparse text features, and detection/mitigation of overfitting.

  • medium
  • Machine Learning
  • Data Scientist

Compare trees, RF, and gradient boosting

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Onsite

Explain decision trees, random forests, and gradient boosted trees. (a) List key hyperparameters for RF (n_estimators, max_features, max_depth, min_samples_leaf, bootstrap, oob_score) and for GBT (n_estimators, learning_rate, max_depth or max_leaf_nodes, subsample, min_child_weight). (b) Explain why shallow trees are typical in boosting but deeper trees can be used in RF; relate to bias–variance. (c) Define out-of-bag estimation and when it can replace a validation set. (d) For high-dimensional sparse text features, which model is preferable and why? (e) Describe how you would detect and mitigate overfitting during boosting.

Quick Answer: This question evaluates understanding of tree-based supervised learning methods—decision trees, random forests, and gradient-boosted trees—including key hyperparameters, bias–variance trade-offs, validation techniques such as out-of-bag estimation, suitability for high-dimensional sparse text features, and detection/mitigation of overfitting.

Related Interview Questions

  • Use a Fitted Line to Predict a Future Data Point - Amazon (hard)
  • Diagnose Strong Validation and Weak Production Performance - Bridgewater (medium)
  • Review a Compact GPT-Style Transformer Implementation - Mercor (medium)
  • Reason About an Intercept Shift in Logistic Regression - Lyft (medium)
  • Implement K-Means Without Numerical Libraries - Lyft (medium)
|Home/Machine Learning

Compare trees, RF, and gradient boosting

Oct 13, 2025, 9:49 PM
mediumData ScientistOnsiteMachine Learning
4
0

Decision Trees, Random Forests, and Gradient-Boosted Trees

You are interviewing for a Data Scientist role and are asked to compare common tree-based methods for supervised learning (classification/regression), list key hyperparameters, and reason about bias–variance and validation.

Tasks

(a) Explain decision trees, random forests (RF), and gradient-boosted trees (GBT). Then list key hyperparameters:

  • RF: n_estimators, max_features, max_depth, min_samples_leaf, bootstrap, oob_score.
  • GBT: n_estimators, learning_rate, max_depth or max_leaf_nodes, subsample, min_child_weight.

(b) Explain why shallow trees are typical in boosting but deeper trees can be used in RF. Relate to bias–variance trade-offs.

(c) Define out-of-bag (OOB) estimation and when it can replace a validation set.

(d) For high-dimensional sparse text features, which model is preferable and why?

(e) Describe how you would detect and mitigate overfitting during boosting.

Loading comments...

Browse More Questions

More Machine Learning•More Data Scientist•Data Scientist Machine Learning

Write your answer

Your first approved answer each day earns 20 XP.

Sign in to write your answer.
PracHub

Master your tech interviews with 8,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • AI Coding Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.