Day 108 of 133

Design search ranking (Amazon/Google) + DSA review

Relevance vs freshness vs diversity; LTR; long-tail queries.

DSA · NeetCode Binary Search

  • Search A 2d MatrixDSA · Binary Search

    Interview questions to prep

    1. State your loop invariant precisely — what must be true on every iteration?
    2. Why does the loop terminate, and how do you avoid infinite loops on the search-space update?
    3. Walk through edge cases: empty array, target smaller than min, target larger than max, duplicates.

ML System Design · Search ranking

  • Design Google/Amazon search rankingML System DesignEugene Yan

    Interview questions to prep

    1. Walk me through designing Amazon's product search.
    2. How do you balance relevance, freshness, and diversity in search ranking?
    3. How would you handle long-tail queries with no historical data?
    4. How would you adapt this design to LinkedIn Recruiter search where query intent, candidate freshness, and recruiter feedback matter?
    5. What changes when ranking marketplace/search results for language-understanding-heavy queries with sparse historical clicks?
  • Interview questions to prep

    1. Compare pointwise, pairwise, and listwise LTR — when does each fit?
    2. Why does pairwise LTR usually beat pointwise on click-data, even though pointwise is simpler?

References & further reading