PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Machine Learning/Snapchat

Explain Random Forest randomness and implications

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's understanding of Random Forest ensemble mechanics—sources of randomness, their effects on bias and variance, hyperparameter impacts, evaluation choices (OOB vs cross-validation), feature-importance bias, and class-imbalance strategies—within the Machine Learning domain for binary classification.

  • hard
  • Snapchat
  • Machine Learning
  • Data Scientist

Explain Random Forest randomness and implications

Company: Snapchat

Role: Data Scientist

Category: Machine Learning

Difficulty: hard

Interview Round: Onsite

Random Forest rigor: 1) Enumerate all sources of randomness (bootstrap sampling, feature subsampling at each split, random tie-breaking, randomized split points) and explain the effect of each on bias and variance. 2) For a dataset with 100k rows, 100 features, and a 5% positive rate, propose n_estimators, max_depth, and max_features; justify how max_features controls tree correlation. 3) Compare out-of-bag (OOB) error to 5-fold cross-validation; when can they disagree and why? 4) Why are impurity-based importances biased toward continuous or high-cardinality features? Propose and justify a corrected approach (e.g., permutation importance with stratified shuffles and repeated runs). 5) Outline strategies for class imbalance (class_weight, threshold moving, balanced subsampling) and discuss consequences for probability calibration and decision thresholds.

Quick Answer: This question evaluates a candidate's understanding of Random Forest ensemble mechanics—sources of randomness, their effects on bias and variance, hyperparameter impacts, evaluation choices (OOB vs cross-validation), feature-importance bias, and class-imbalance strategies—within the Machine Learning domain for binary classification.

Related Interview Questions

  • Explain Overfitting and Transformer Attention - Snapchat (medium)
  • Discuss ML Project Tradeoffs - Snapchat (medium)
  • Model an ads ranking system - Snapchat (medium)
  • Explain BatchNorm, optimizers, and L1/L2 - Snapchat (medium)
  • Explain CLIP, contrastive losses, and retrieval limits - Snapchat (medium)
Snapchat logo
Snapchat
Oct 13, 2025, 9:49 PM
Data Scientist
Onsite
Machine Learning
3
0

Random Forest — Rigor and Practical Choices

Context: You are building a binary classifier with a Random Forest. The dataset has 100,000 rows, 100 features, and a 5% positive rate. Answer the following:

  1. Sources of Randomness
  • Enumerate the sources of randomness in Random Forests (e.g., bootstrap sampling, feature subsampling at each split, random tie-breaking, randomized split points). For each, explain its typical effect on bias and variance.
  1. Hyperparameters for the Given Dataset
  • Propose reasonable values for n_estimators, max_depth, and max_features for the dataset above.
  • Justify how max_features controls correlation among trees and the bias–variance trade-off.
  1. OOB Error vs 5-Fold Cross-Validation
  • Compare out-of-bag (OOB) error with 5-fold cross-validation (CV).
  • When can they disagree and why?
  1. Feature Importance Bias
  • Explain why impurity-based importances are biased toward continuous or high-cardinality features.
  • Propose a corrected approach (e.g., permutation importance with stratified shuffles and repeated runs) and justify your design.
  1. Class Imbalance Strategies
  • Outline strategies for class imbalance (e.g., class_weight, threshold moving, balanced subsampling).
  • Discuss consequences for probability calibration and decision thresholds.

Solution

Show

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Machine Learning•More Snapchat•More Data Scientist•Snapchat Data Scientist•Snapchat Machine Learning•Data Scientist Machine Learning
PracHub

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

Product

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

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL 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.