Yelp 00:00:01 Find pizza within five kilometres A visitor in Times Square wants open pizza restaurants within walking distance. Design a Yelp-style local search with one explicit radius and an end-to-end latency budget. Nearby candidates and the best result are different questions. A point in Times Square, the word pizza and 5 km. the phone knows where it is; an address would be turned into a point first. Popular cells are shared by everyone nearby. Distance and smoothed rating. This order is also the fallback. Twenty places and a cursor with the last score and ID. The phone draws a list and pins. Use a stable tie-breaker with the ranking cursor and decide which results must stay stable across pages. A visitor is unlikely to care which shard found dinner, but does notice the same restaurant twice. 00:00:53 A cell boundary runs through the neighborhood Two restaurants can be steps apart and have different cell identifiers. An exact prefix match can miss a neighbor; an overly broad cell can include businesses outside the radius. Six places and you, on a grid of 49 cells. Nine cells find A and C. The radius is 2.9 cells, so this is not enough. Three more cells on each side of the middle: the whole map here. The example's distance test retains A, C and D. Their distances are approximately one, one point four and two point eight grid units. Cover every intersecting cell at the chosen resolution, then test actual distance. Ranking can only improve restaurants that retrieval did not accidentally discard. 00:01:40 A new review has several clocks The diner writes a review after lunch. Committing the review, deciding whether it is publicly eligible, and refreshing the restaurant's search aggregate may happen at different times. The author sends stars, text and photo IDs. Photos were uploaded while typing. The example review clears the illustrated checks. A pending decision can be retained for review instead of losing the submission. The author sees it at once, read from the truth. The search projection later reflects the new eligible review and updates its public aggregate under the example's freshness goal. Return the authoritative submission status to its author. State what freshness the public search profile promises and route unresolved moderation decisions to a bounded review workflow. 00:02:28 Spend the ranking budget on a shortlist Routing the user to the nearest twenty points ignores cuisine, opening hours and their actual search words. Build a fast candidate set, then spend the more expensive ranking features on that bounded set. All match pizza and are near and open. Collecting is the index's job. Prefers mid price, saved three Italian places. One batch of 200. The example ranker finishes inside the search deadline. If that budget expires, use the qualified fallback order. Test the first-stage recall as well as the second-stage ranking quality. When a ranking dependency is slow, return an eligible simpler order within the caller's deadline. 00:03:11 One five-star review is weak evidence The closest restaurant has low ratings. Another has one enthusiastic review. Compare proximity, an unsmoothed average and an average softened with a prior before combining them. Corner is 70 m away but has two stars. One review of five stars wins. Add 20 average votes of 3.8. One review becomes 3.86, Great stays 4.49, Corner becomes 2.60. The illustrative formula assigns separate weight to proximity and the smoothed rating. Changing either weight can reverse the restaurant order. The weights and prior strength are product assumptions to validate, including whether they disadvantage new businesses. Explain why the winner changed, not just which score was larger.