Bootstrap a Confidence Interval for a Google Lens Classifier's Accuracy

Last updated: November 29, 2026

Quick Overview

A Google Lens product recognition model scores 90 percent top-1 accuracy on a 2,000 image test set collected from 300 users. Build a confidence interval for that accuracy and explain how clustering by user changes it.

Google
Machine Learning
Data Scientist
Google
November 29, 2026
Data Scientist
Technical Screen
Machine Learning
Medium

0

0

0 solved


A Google Lens product recognition model scores 90 percent top-1 accuracy on a 2,000 image test set collected from 300 users. Build a confidence interval for that accuracy and explain how clustering by user changes it.

Google teams expect offline metrics to come with uncertainty before anyone argues about a 1 point difference. The interviewer checks whether you know the bootstrap, can implement it, and recognize that correlated examples (many images from one user) shrink the effective sample size.

What the Interviewer Expects
  • Explains the percentile bootstrap and why it applies to arbitrary metrics
  • Implements resampling correctly with replacement
  • Recognizes that images from the same user are correlated
  • Uses a cluster (user-level) bootstrap to get honest intervals
  • Compares to the normal approximation and states when they agree
Key Topics to Cover
bootstrap
confidence intervals
cluster sampling
effective sample size
evaluation uncertainty
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 many bootstrap replicates do you need?
  • How would you get a confidence interval for the difference between two models on the same test set?
  • When does the percentile bootstrap fail?
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 how the test set was collected (several photos per user, sometimes of the same product), whether accuracy is top-1 or top-5, and what decision depends on the interval, for example whether the mode...

Approach

The bootstrap estimates the sampling distribution of a metric by resampling the test set with replacement many times and recomputing the metric. The 2.5th and 97.5th percentiles give a 95 percent inte...


Submit Your Answer
Markdown supported