Random forests train many decision trees and average their predictions. Two sources of randomness:
Bagging: Each tree trains on a bootstrap sample (random subset with replacement)
Feature randomness: Each split considers only a random subset of features
Why it works: Reduces variance without increasing bias. Individual trees overfit differently, but errors cancel out.
Feature importance: Measure how much each feature reduces impurity across all trees.
Interview tip: Know the difference between bagging (reduces variance) and boosting (reduces bias).