Estimate Safe Browsing Precision and Recall From a Stratified Label Sample

Last updated: November 29, 2026

Quick Overview

Chrome Safe Browsing scores 10 million URLs a day and you can afford expert review of only 1,400 of them. Design a stratified sample by model score, then estimate precision and recall at a threshold with uncertainty.

Google
Machine Learning
Data Scientist
Google
November 29, 2026
Data Scientist
Onsite
Machine Learning
Hard

0

0

0 solved


Chrome Safe Browsing scores 10 million URLs a day and you can afford expert review of only 1,400 of them. Design a stratified sample by model score, then estimate precision and recall at a threshold with uncertainty.

Labels for phishing and malware are expensive, and almost all traffic is benign, so random sampling would label almost no positives. The interviewer tests whether you can design a sampling plan, reweight it correctly, and see that recall is much harder to estimate than precision.

What the Interviewer Expects
  • Explains why uniform random sampling wastes the labeling budget
  • Stratifies by model score and samples each stratum at different rates
  • Computes weighted estimates of positives per stratum and overall
  • Derives precision and recall at a threshold from stratum estimates
  • Quantifies variance and reallocates budget to the stratum that dominates it
Key Topics to Cover
stratified sampling
importance weighting
precision estimation
recall estimation
label budget
How to Approach This
  1. Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
  2. Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
  3. Feature engineering is often more impactful than model selection.
  4. Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
  5. Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
  • How would you allocate the 1,400 labels across strata optimally?
  • How do you estimate recall for threats the model scores near zero, which you may never sample?
  • How would you reuse the same sample to evaluate a new model?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Explore ML Interview Prep
Sample Answer
Clarify

Ask for the daily volume, the score distribution, the expert labeling budget, and the decision threshold. Confirm labels are reliable enough to treat as truth, and that the sample is drawn from the sa...

Approach

A uniform sample of 1,400 from 10 million URLs with a base rate near 0.5 percent would contain about 7 phishing URLs, which is useless. Instead, split URLs into score strata and sample each at its own...


Submit Your Answer
Markdown supported