Model Selection, Tuning, and Generalization Questions
Choosing and tuning models so they generalize to unseen data rather than memorizing the training set. Covers the bias-variance tradeoff and its decomposition, diagnosing over- and under-fitting from learning curves, and regularization techniques such as L1/L2 penalties, dropout, and early stopping, alongside cross-validation strategies and grid, random, and Bayesian hyperparameter search. Emphasizes a principled, reproducible process for selecting model complexity and tuning against a real compute-versus-accuracy budget rather than ad-hoc trial and error.
You receive a new tabular regression task. Describe the sequence of baseline models you'd try before reaching for anything complex, and what you'd learn from each step before moving to the next.
Describe how you would implement k-fold-cross-validated grid search from scratch in Python, without using scikit-learn's GridSearchCV: what does your code need to loop over, and where exactly does the cross-validation fit relative to the grid loop?
After running a Bayesian hyperparameter search you have hundreds of trials logged. Describe how you'd analyze the results beyond just picking the single best trial: what would you look at to understand which hyperparameters actually mattered?
When would you prefer an ensemble of models over a single model in production, and when would the latency and memory cost not be worth it? For a service with a strict p99 latency budget, how would you decide, and what quantitative check would you run before committing to an ensemble that improves offline accuracy?
You can either increase training data by 3x or increase model capacity (more layers/trees), but not both, to close a validation gap you're seeing. How do you decide which lever to pull, and what evidence would change your answer?
Unlock Full Question Bank
Get access to all Model Selection, Tuning, and Generalization interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.