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.
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
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- 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 PrepSample 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...