Mid-level interview questionAsked at LinkedIn · interview write-up
Explain how random forests reduce variance, and why correlation between the trees limits what averaging can buy you.
Model answer
Deep trees have low bias but high variance, so averaging many helps. For B trees, each with variance σ² and pairwise correlation ρ, the average has variance ρσ² + (1 − ρ)σ²/B. More trees shrink only the second term; ρσ² is a floor.
So forests attack correlation: bootstrap samples, plus a random subset of features at each split, so one dominant feature doesn't make every tree alike. Fewer features per split lowers ρ but weakens each tree.
Practise the rest
35 Training questions, 492 in all, each with a model answer. Free.
More from LinkedIn interview questions.
More Training interview questions
- Implement masked cross-entropy in NumPy that stays numerically stable, with label smoothing and a temperature.
- Build a pipeline that finds math documents in web crawls and scores their quality.
- Explain KL divergence for language models: which direction is which, what happens when supports don't match, and how it's used as a regulariser.
- When would you use mean squared error versus cross-entropy? And what is LoRA?
- Explain Adam and its bias correction, and why AdamW decouples weight decay.
- Explain policy types in RL and modern policy-gradient methods such as TRPO, PPO and GAE, then compare linear attention and grouped-query attention.