Decision Trees Q&A 20 Core Questions
Interview Prep

Decision Trees: Interview Q&A

Short questions and answers on decision trees: how they split, handle features, overfit, and how to prune them.

Splits Gini / Entropy Pruning Overfitting
1 What is a decision tree in machine learning? âš¡ Beginner
Answer: A decision tree is a model that makes predictions by recursively splitting the data based on feature values, forming a tree of decisions.
2 Why are decision trees considered easy to interpret? âš¡ Beginner
Answer: Each path from root to leaf corresponds to a simple set of if‑else rules that humans can read and understand.
3 What criteria are used to choose splits for classification trees? 📊 Intermediate
Answer: Common criteria are Gini impurity and information gain (entropy).
4 How do decision trees handle numerical features? âš¡ Beginner
Answer: They find a threshold (e.g., x <= t vs x > t) that best splits the data according to the chosen criterion.
5 How do decision trees handle categorical features? 📊 Intermediate
Answer: They split by grouping categories (e.g., {A,B} vs {C,D}); many libraries require encoding categories first.
6 Why do decision trees tend to overfit? 📊 Intermediate
Answer: If grown deep, they can create very specific rules that fit noise in the training data, hurting generalization.
7 What is pruning in decision trees? 📊 Intermediate
Answer: Pruning removes branches or limits depth of a fully grown tree to reduce overfitting and improve generalization.
8 Name three key hyperparameters to control tree complexity. 📊 Intermediate
Answer: Examples: max_depth, min_samples_split, min_samples_leaf.
9 What are some advantages of decision trees? âš¡ Beginner
Answer: They are easy to interpret, handle non‑linear relationships, can work with mixed feature types and require little preprocessing.
10 What are some disadvantages of decision trees? âš¡ Beginner
Answer: They are unstable to small data changes, prone to overfitting and can create biased splits with highly imbalanced features.
11 What is Gini impurity in simple terms? âš¡ Beginner
Answer: Gini impurity measures how often a randomly chosen sample would be incorrectly labeled if randomly labeled according to class distribution at the node.
12 What is information gain based on entropy? 🔥 Advanced
Answer: Information gain is the reduction in entropy achieved after a split; higher gain means a better, more informative split.
13 How do decision trees handle missing values? 🔥 Advanced
Answer: Some implementations use surrogate splits or treat missing as a separate branch; others require you to impute missing values first.
14 Why are decision trees sensitive to small changes in the data? 📊 Intermediate
Answer: A small change can alter the best splitting feature or threshold near the top of the tree, leading to a very different structure.
15 How do decision trees work for regression tasks? 📊 Intermediate
Answer: Regression trees predict a numeric value (usually the mean) at each leaf and use criteria like MSE reduction for splits.
16 What is the relationship between decision trees and random forests? 📊 Intermediate
Answer: A random forest is an ensemble of many decision trees, each trained on bootstrapped data and feature subsets, whose predictions are aggregated.
17 Why do we usually prefer ensembles of trees over a single deep tree? 🔥 Advanced
Answer: Ensembles like random forests or boosting reduce variance and improve accuracy while keeping many of the tree’s advantages.
18 How can you visualize and debug a decision tree model? âš¡ Beginner
Answer: You can plot the tree structure, inspect individual decision paths and examine feature importance scores.
19 Give an example use case where decision trees are a good fit. âš¡ Beginner
Answer: They work well in rule‑heavy domains like credit approval or simple risk scoring where interpretability is important.
20 What is the key message to remember about decision trees? âš¡ Beginner
Answer: Decision trees are intuitive and flexible, but need depth limits or ensembles to avoid overfitting and instability.

Quick Recap: Decision Trees

Understand how splits are chosen, how depth affects variance, and how pruning helps—you’ll be ready to discuss both trees and their ensembles confidently.