AI Interview Prep

AI Interview Prep

RAG Interview Questions #12 - The LSH Recall Paradox

Why throwing more memory at missing neighbors quietly balloons your latency instead of fixing your search, and the data-dependent reality that actually rescues your retrieval.

Hao Hoang's avatar
Hao Hoang
Jul 16, 2026
∙ Paid

You’re in a Staff ML Engineer interview at Pinterest and the interviewer asks:

“Your LSH index is missing 30% of true neighbors. You doubled the number of hash tables and recall barely moved. What’s actually happening?”

Don’t say: “I’d add more tables and tune the number of hash functions.” You just described the knob, not the failure. Interview over.

Here’s what’s really going on.

LSH doesn’t retrieve neighbors. It bets on collisions.

Recall per query is roughly 1 − (1 − p₁ᵏ)ᴸ, where p₁ is the collision probability for a true neighbor, k is the hash functions concatenated per table, and L is the table count.

Notice what L can and can’t do:

  • L is a linear lever. Double it → double the memory, double the candidate set, double the query cost. You buy recall with latency.

  • k is an exponential lever. If k is too high, p₁ᵏ collapses toward zero, and you’d need exponentially many tables to compensate. Adding L to fix a bad k is arithmetic against geometry. You lose.

But the deeper failure is the one nobody mentions:

AI Interview Prep is a reader-supported publication. To receive new posts and support my work, consider becoming a free or paid subscriber.

User's avatar

Continue reading this post for free, courtesy of Hao Hoang.

Or purchase a paid subscription.
© 2026 Hao Hoang · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture