Yelp Coding Interview Questions
25 Yelp coding interview problems with full optimal solutions — 15 easy, 7 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Yelp interviewer values, and a FAQ section.
Showing 15 problems of 25
- #1easyfoundational
1. Two Sum
Find two array indices whose values sum to a target — Yelp's warmup before scaling the same hash lookup to matching business IDs against a review-score target.
- #2easyfoundational
2. Valid Parentheses
Verify a string of brackets is well-formed using a stack — Yelp uses this to test the same nesting validation it runs on user-submitted query strings for advanced search filters.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted linked lists into one sorted list — Yelp uses this as the conceptual cousin to merging two relevance-sorted review feeds before final ranking.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Compact a sorted array in-place — Yelp's stand-in for collapsing duplicate review entries from the same user before downstream ranking.
- #5easyfoundational
5. Remove Element
Filter out target values from an array in-place — Yelp uses this to test the same buffer-compaction logic that strips flagged reviews from a result page.
- #6easyfoundational
6. Search Insert Position
Binary-search a sorted array for an insert index — Yelp's gateway to the same lower-bound logic that places a new review at its correct rank-sorted slot.
- #7easyfoundational
7. Plus One
Increment a big integer stored as a digit array — Yelp uses it to gauge how cleanly you handle carry-propagation, the same edge case in totaling review counts past 9.
- #8easyfoundational
8. Merge Sorted Array
Merge nums2 into nums1 in-place — Yelp's analog for combining two sorted batches of incoming reviews into a single chronological feed without extra memory.
- #9easyfoundational
9. Binary Tree Inorder Traversal
Return the inorder traversal of a binary tree — Yelp treats this as the warmup for sorted enumeration over the BST that backs nearby-business range queries.
- #10easyfoundational
10. Same Tree
Check whether two binary trees are structurally identical — Yelp uses this as the canonical recursion warmup before diving into category-tree comparison tasks.
- #11easyfoundational
11. Maximum Depth of Binary Tree
Compute the maximum depth of a binary tree — Yelp uses this to gauge whether candidates can recurse cleanly over a category-tree before walking deeper geo-indexing problems.
- #12easyfoundational
12. Best Time to Buy and Sell Stock
Find the maximum profit from a single buy and sell of a stock — Yelp uses this single-pass min-tracking pattern to test how candidates handle review-ranking score deltas over time.
- #13easyfoundational
13. Valid Palindrome
Determine whether a string is a palindrome after stripping non-alphanumerics and lower-casing — Yelp uses this to test two-pointer fluency before scaling to review-fraud near-duplicate detection.
- #14easyfoundational
14. Single Number
Find the unique element in an array where every other element appears twice — Yelp uses this XOR trick to test whether candidates can spot an O(1)-space win before scaling to dedup in review pipelines.
- #15easyfoundational
15. Majority Element
Find the element that appears more than n/2 times in an array — Yelp uses Boyer-Moore voting to test whether candidates can find an O(1)-space majority before scaling to dominant-keyword detection across reviews.