← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

Senior
May 2026

Summary

Google DS interview focused on a pretty deep ML question about logistic regression behavior in high-dimensional ad prediction settings. One question, but it had a lot of surface area and I don't think I covered it as cleanly as I should have.

Questions Asked (1)

Q1

For a large-scale binary classifier with hundreds or thousands of features predicting display ad performance, does logistic regression tend to underfit or overfit? Walk through the conditions driving each, how you'd detect it, and what you'd do about it.

Technical Trade-offsData ModelingProduct Analytics & Metrics
Author's notes

I jumped straight to overfitting because 'high-dimensional' feels like a trap toward regularization talk, but the interviewer pushed back and asked about underfitting too.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying that logistic regression is a relatively low-variance, high-bias model, so with hundreds or thousands of features it is more prone to underfitting than overfitting, but the actual outcome depends on sample size, feature quality, and regularization. Then systematically discuss the conditions that drive each, how to detect them, and the remedies, emphasizing that the right answer is context-dependent.

Pro tip: Frame the answer around the bias-variance trade-off and mention that with large-scale ad data, the main risk is underfitting due to the linear decision boundary, not overfitting—unless the feature-to-sample ratio is extreme or features are highly collinear. This shows you understand both theory and practical scale.

1. Clarify the model and data context

State that logistic regression is a linear model with high bias and low variance, and that its behavior depends on the number of training examples (n) relative to features (p), feature multicollinearity, and regularization strength.

2. Analyze underfitting conditions

Explain that underfitting occurs when the true relationship is non-linear, when features are weak or noisy, when regularization is too strong, or when n is very large relative to p—common in ad performance prediction where interactions and non-linearities matter.

3. Analyze overfitting conditions

Explain that overfitting can happen when p is large relative to n (e.g., thousands of sparse features with limited data), when features are highly correlated, or when regularization is too weak, leading to unstable coefficients.

4. Detection methods

Describe using learning curves (training vs. validation error), cross-validation, and monitoring coefficient magnitudes and variance. For underfitting, both errors are high and close; for overfitting, training error is low but validation error is high.

5. Remedies and trade-offs

For underfitting: add non-linear features/interactions, use polynomial terms, reduce regularization, or switch to a more flexible model. For overfitting: increase regularization (L1/L2), reduce dimensionality, gather more data, or use feature selection.

Key Points to Mention

  • Bias-variance trade-off: logistic regression is high-bias, low-variance.
  • Sample size vs. feature count (n vs. p) and the risk of overfitting when p >> n.
  • Regularization (L1/L2) and its role in controlling overfitting.
  • Non-linearity and feature interactions as primary causes of underfitting.
  • Use of learning curves and cross-validation to diagnose under/overfitting.
  • Practical remedies: feature engineering, regularization tuning, dimensionality reduction, or model switching.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.