Find Near-Duplicate Listings With Embeddings and Locality-Sensitive Hashing

Last updated: November 29, 2026

Quick Overview

Sellers sometimes create duplicate listings of the same product with slightly different titles and images. Explain how you would find candidate duplicates across a catalog of hundreds of millions of items without comparing every pair.

Amazon
Machine Learning
Machine Learning Engineer
Amazon
November 29, 2026
Machine Learning Engineer
Technical Screen
Machine Learning
Medium

0

0

0 solved


Sellers sometimes create duplicate listings of the same product with slightly different titles and images. Explain how you would find candidate duplicates across a catalog of hundreds of millions of items without comparing every pair.

Duplicate listings fragment reviews and confuse shoppers, so catalog quality teams at Amazon need scalable matching. The interviewer checks whether you combine learned embeddings with an efficient candidate generation step and a precise verification step.

What the Interviewer Expects
  • Learn embeddings where duplicates are close
  • Avoid the all-pairs comparison with LSH or ANN
  • Explain random hyperplane LSH and its collision probability
  • Verify candidates with a pairwise classifier
  • Measure precision and recall of the pipeline
Key Topics to Cover
Locality-sensitive hashing
Embeddings
Entity matching
Approximate nearest neighbors
Cosine similarity
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 choose the number of bits and tables?
  • How do you avoid merging variants (size 9 versus size 10)?
  • Would you use ANN indexes like HNSW instead of LSH?
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 what defines a duplicate (same product, same variant), available signals (title, images, brand, UPC), and the cost of a false merge versus a missed duplicate. A false merge is worse because it cor...

Approach

Train a multimodal encoder (title plus image) with contrastive loss on known duplicate pairs. Use random hyperplane LSH: each bit is the sign of a projection onto a random vector, so items with small ...


Submit Your Answer
Markdown supported