Search
⌘K
Get Premium
Common Problems

Yelp

Scaling Reads
ByEvan King·Published ·
medium

Try This Problem Yourself

Practice with guided hints and real-time feedback

Understanding the Problem

🍽️ What is Yelp? Yelp is an online platform that allows users to search for and review local businesses, restaurants, and services.

Functional Requirements

Some interviewers will start the interview by outlining the core functional requirements for you. Other times, you'll be tasked with coming up with them yourself. If you've used the product before, this should be relatively straight forward. However, if you haven't, it's a good idea to ask some questions of your interviewer to better understand the system.
Here is the set of functional requirements we'll focus on in this breakdown (this is also the set of requirements I lead candidates to when asking this question in an interview)
Core Requirements
  1. Users should be able to search for businesses by name, location (lat/long), and category
  2. Users should be able to view businesses (and their reviews)
  3. Users should be able to leave reviews on businesses (mandatory 1-5 star rating and optional text)
Below the line (out of scope):
  • Admins should be able to add, update, and remove businesses (we will focus just on the user)
  • Users should be able to view businesses on a map
  • Users should be recommended businesses relevant to them

Non-Functional Requirements

Core Requirements
  1. The system should have low latency for search operations (< 500ms)
  2. The system should be highly available, eventual consistency is fine
  3. The system should be scalable to handle 100M daily users and 10M businesses
Below the line (out of scope):
  • The system should protect user data and adhere to GDPR
  • The system should be fault tolerant
  • The system should protect against spam and abuse
If you're someone who often struggles to come up with your non-functional requirements, take a look at this list of common non-functional requirements that should be considered. Just remember, most systems are all these things (fault tolerant, scalable, etc) but your goal is to identify the unique characteristics that make this system challenging or unique.
Here is what you might write on the whiteboard:
Yelp Non-Functional Requirements

Constraints

The Set Up

Defining the Core Entities

The API

High-Level Design

1) Users should be able to search for businesses

2) Users should be able to view businesses

3) Users should be able to leave reviews on businesses

Potential Deep Dives

1) How would you efficiently calculate and update the average rating for businesses to ensure it's readily available in search results?

2) How would you modify your system to ensure that a user can only leave one review per business?

3) How can you improve search to handle complex queries more efficiently?

4) How would you modify your system to allow searching by predefined location names such as cities or neighborhoods?

Final Design

What is Expected at Each Level?

Mid-level

Senior

Staff+

Purchase Premium to Keep Reading

Unlock this article and so much more with Hello Interview Premium

Schedule a mock interview

Meet with a FAANG senior+ engineer or manager and learn exactly what it takes to get the job.

Schedule a Mock Interview