← Google Interview Insights

Google·Data Scientist·Technical Phone Screen·Senior

SeniorPrefer not to say
Jun 2026

Summary

A technical screen for a Data Scientist role at Google that went deep fast. The whole thing was basically one extended ML design problem about URL classification, and they kept pushing on evaluation methodology and deployment strategy in ways I wasn't fully prepared for.

Questions Asked (6)

Q1

You have 1,000 labeled URLs (good/bad) and a large unlabeled pool where bad links are rare. How would you design features and train a logistic regression model for this?

Data ModelingTechnical Trade-offs
Author's notes

I jumped straight into feature ideas (URL length, domain age, TLD type, presence of subdomains, etc.) and got through the modeling part okay.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a rare-event classification with limited labeled data and a large unlabeled pool. Propose a semi-supervised approach: engineer robust features from URL structure and content, then use the unlabeled data to augment training via techniques like self-training or positive-unlabeled learning. Emphasize evaluation metrics suited for class imbalance and discuss trade-offs between feature complexity and model interpretability.

Pro tip: Mention that you would use the unlabeled pool to estimate the prior probability of the positive class and calibrate the model, and that you would consider using a small validation set from the labeled data to tune the decision threshold based on business costs.

1. Understand the problem and data

Clarify the definition of 'bad' links, the expected rarity, and the business impact of false positives/negatives. Assess the quality and representativeness of the 1,000 labeled URLs.

2. Feature engineering

Design features from URL structure (length, special characters, domain age, TLD), host-based features (reputation, blacklists), and content-based features (keywords, language). Consider using domain knowledge to create interpretable features.

3. Handle class imbalance and limited labels

Use techniques like class weighting, oversampling, or synthetic data generation. Leverage the unlabeled pool via semi-supervised methods such as self-training, co-training, or positive-unlabeled learning to expand the training set.

4. Train and evaluate logistic regression

Train with L1/L2 regularization to prevent overfitting. Evaluate using precision-recall curves, AUC-PR, and F1-score at a chosen threshold. Use cross-validation and consider nested CV for hyperparameter tuning.

5. Iterate and deploy

Monitor performance on a held-out set and adjust features or threshold as needed. Plan for periodic retraining and incorporate feedback from false positives/negatives in production.

Key Points to Mention

  • Class imbalance: use precision-recall instead of ROC, and consider cost-sensitive learning.
  • Semi-supervised learning: self-training with confidence threshold, or PU learning to treat unlabeled as negatives with noise.
  • Feature engineering: extract lexical, host-based, and content features; consider using pre-trained embeddings for URL tokens.
  • Regularization: L1 for feature selection, L2 for stability; tune hyperparameters via cross-validation.
  • Evaluation: use stratified k-fold, and a separate validation set for threshold tuning.
  • Scalability: logistic regression is efficient, but feature extraction on large unlabeled pool may require distributed processing.

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

Q2

With severe class imbalance in this dataset, how would you evaluate your model? Walk through your full evaluation plan.

Product Analytics & MetricsTechnical Trade-offsA/B Testing & Experimentation
Author's notes

This is where the interview got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that accuracy is misleading with severe class imbalance, then propose a metric-driven evaluation plan that aligns with the business objective. Structure your answer around choosing appropriate metrics, validating with resampling and threshold tuning, and finally testing on a holdout set with statistical rigor.

Pro tip: Always tie your metric choice back to the business cost of false positives vs. false negatives—Google interviewers love candidates who connect model evaluation to real-world impact. Mention that you'd also monitor for data drift and re-evaluate metrics over time, showing production maturity.

1. Clarify the business objective and costs

Ask or infer what the model is used for and the relative cost of FP vs. FN. This determines whether you optimize for precision, recall, or a balanced metric like F1 or AUC-PR.

2. Select imbalance-robust metrics

Choose metrics that are insensitive to class ratio: precision-recall AUC (PR-AUC), F1, Matthews correlation coefficient, or Cohen's kappa. Avoid accuracy and ROC-AUC as primary metrics.

3. Use proper validation and resampling

Employ stratified k-fold cross-validation to preserve class ratios. Consider techniques like SMOTE, class weighting, or undersampling only within training folds to avoid leakage.

4. Tune decision threshold and calibrate

Optimize the probability threshold on a validation set based on the business metric. Calibrate probabilities (e.g., Platt scaling) if needed for downstream decisions.

5. Evaluate on holdout and plan for monitoring

Report final metrics on an untouched test set with confidence intervals. Set up monitoring for data drift and periodic re-evaluation of the threshold and metrics.

Key Points to Mention

  • Precision-Recall AUC (PR-AUC) is more informative than ROC-AUC for severe imbalance.
  • Stratified sampling and cross-validation to maintain class distribution.
  • Threshold tuning based on business costs (e.g., cost-sensitive learning).
  • Avoid resampling before splitting to prevent data leakage.
  • Use of confusion matrix and derived metrics (precision, recall, F1) for interpretability.
  • Monitoring and retraining strategy to handle drift in imbalanced settings.

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

Q3

How would you choose a decision threshold for this classifier given that misclassification costs are asymmetric?

Technical Trade-offsProduct Analytics & Metrics
Author's notes

Framed it around expected cost minimization.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the business context and quantifying the asymmetric costs of false positives and false negatives. Then, explain that the optimal threshold minimizes expected cost, which can be derived from the cost matrix and the model's predicted probabilities. Finally, discuss how to validate and adjust the threshold using a validation set and business constraints.

Pro tip: Emphasize that the threshold should be chosen based on the expected cost, not just accuracy, and that you would communicate the trade-offs to stakeholders using a cost curve or profit curve.

1. Clarify business context and costs

Ask about the specific costs associated with false positives and false negatives, and how they impact business metrics. Ensure you understand the problem's asymmetry.

2. Formalize expected cost

Define the expected cost as a function of the threshold: E[cost] = C_FP * P(FP) + C_FN * P(FN). Use the model's predicted probabilities to compute P(FP) and P(FN) for any threshold.

3. Optimize threshold on validation set

Using a validation set, compute the expected cost for a range of thresholds and select the one that minimizes it. Consider using a cost curve to visualize the trade-off.

4. Validate and adjust for business constraints

Check if the optimal threshold meets any business constraints (e.g., minimum recall or precision). If not, adjust the threshold to satisfy constraints while minimizing cost.

5. Communicate and monitor

Explain the chosen threshold and its implications to stakeholders. Set up monitoring to track performance and costs over time, and re-evaluate if costs or data distribution change.

Key Points to Mention

  • Cost matrix and expected cost minimization
  • Using predicted probabilities and threshold tuning
  • Validation set for threshold selection
  • Business constraints and trade-offs (e.g., precision-recall)
  • Cost curves or profit curves for visualization
  • Monitoring and re-evaluation over time

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

Q4

What approaches would you use to handle class imbalance during training, and what are the tradeoffs?

Technical Trade-offsData Modeling
Author's notes

Covered class weighting in the loss function versus resampling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing class imbalance as a problem that depends on the business metric and data distribution, then present a structured menu of approaches (data-level, algorithm-level, and evaluation-level) with their tradeoffs. Emphasize that the best approach is often a combination, validated through proper cross-validation and metric selection.

Pro tip: At Google, interviewers value pragmatic solutions: mention that you first check if imbalance is actually a problem (e.g., if the metric is precision/recall or AUC, it might not be) and that you always compare against a simple baseline like class weights before trying complex methods.

1. Clarify the problem and metric

Ask about the business objective, the evaluation metric, and the extent of imbalance. This determines whether and how to address it.

2. Data-level approaches

Discuss resampling techniques: oversampling (e.g., SMOTE), undersampling, or a combination. Mention their tradeoffs: oversampling can lead to overfitting, undersampling can discard useful information.

3. Algorithm-level approaches

Explain cost-sensitive learning: class weights, focal loss, or adjusting decision thresholds. These often preserve data distribution and are easy to implement.

4. Evaluation and validation

Stress the importance of using appropriate metrics (e.g., precision-recall AUC, F1) and techniques like stratified cross-validation to avoid misleading results.

5. Tradeoffs and selection

Summarize tradeoffs: computational cost, risk of overfitting/underfitting, impact on calibration, and business costs of false positives/negatives. Recommend an iterative approach.

Key Points to Mention

  • Resampling methods: SMOTE, random oversampling/undersampling, and their impact on bias-variance tradeoff.
  • Cost-sensitive learning: class weights, focal loss, and threshold tuning.
  • Evaluation metrics: precision-recall curve, F1, AUC-ROC vs. AUC-PR, and why accuracy is misleading.
  • Tradeoffs: oversampling may cause overfitting; undersampling may lose information; class weights may affect probability calibration.
  • Ensemble methods: balanced bagging, EasyEnsemble, or using tree-based models with class weights.
  • The importance of validating on a representative test set and considering business costs of errors.

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

Q5

How would you check for data leakage in this setup, and what would you monitor once the model is in production?

Root Cause AnalysisSystem Design
Author's notes

Leakage check was pretty standard: make sure any feature derived from the label (like domain reputation scores that might already encode bad/good judgments) isn't sneaking in.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining how you would detect data leakage during model development, focusing on temporal and feature leakage. Then, describe the monitoring strategy for production, including data drift, concept drift, and performance metrics. Emphasize the importance of setting up alerts and dashboards for early detection.

Pro tip: Mention that you would simulate production conditions during cross-validation, such as using time-based splits, and that you would monitor not just model performance but also input data distributions and feature importance stability.

1. Understand the data and pipeline

Map out the data flow from source to model to identify potential leakage points, such as features computed using future data or target encoding.

2. Detect leakage during development

Use techniques like time-based validation, checking feature-target correlation, and examining feature importance for suspiciously high values.

3. Validate with holdout and adversarial tests

Create a holdout set that mimics production conditions and use adversarial validation to check if the model can distinguish between training and validation data.

4. Set up production monitoring

Monitor data drift, concept drift, and model performance metrics; set up alerts for anomalies and track feature distributions.

5. Establish feedback loops and retraining

Define a process for investigating alerts, retraining models, and updating the monitoring system based on new data.

Key Points to Mention

  • Temporal leakage: using future data in training
  • Feature leakage: features that are proxies for the target
  • Data drift: changes in input distribution over time
  • Concept drift: changes in the relationship between features and target
  • Performance monitoring: tracking metrics like AUC, precision, recall
  • Alerting and dashboards: setting thresholds and visualizing trends

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

Q6

Describe how you'd validate this model offline before deploying it, and what a staged rollout would look like.

A/B Testing & ExperimentationSystem DesignTechnical Trade-offs
Author's notes

Shadow deployment first: run the model in parallel without acting on its outputs, just log what it would have flagged.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by outlining offline validation metrics that mirror online success, then describe a staged rollout with clear gates and monitoring. Emphasize how you'd detect and mitigate issues at each stage, tying back to business impact.

Pro tip: Define your evaluation metrics and guardrails before training, and use a holdout set that mimics production data distribution. In staged rollouts, always have a rollback plan and pre-register your analysis to avoid p-hacking.

1. Define offline evaluation metrics

Select metrics that correlate with online business metrics (e.g., AUC, precision@k, calibration) and set guardrail metrics (e.g., latency, fairness). Ensure they are computed on a representative holdout set.

2. Conduct offline validation

Use techniques like cross-validation, time-based splits, and backtesting to assess model performance and stability. Compare against baselines and check for overfitting, bias, and robustness.

3. Design staged rollout

Plan a phased deployment: start with a small canary (e.g., 1% traffic), then ramp up gradually. Define success criteria and guardrails for each stage, and include A/B testing to measure causal impact.

4. Monitor and iterate

Set up real-time monitoring for model performance, data drift, and business metrics. Be prepared to rollback or retrain if issues arise, and document learnings for future iterations.

Key Points to Mention

  • Offline-online metric correlation and validation
  • Holdout set construction and potential leakage
  • A/B testing and statistical significance
  • Canary deployment and gradual traffic ramp-up
  • Guardrail metrics and rollback triggers
  • Monitoring for data drift and model degradation

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