Top 15 Uber Coding Interview Problems, Ranked by Frequency
- Graph problems account for 28-32% of Uber coding rounds — BFS, DFS, topological sort, and Union-Find cover five of fifteen problems on this list
- Bus Routes requires modeling routes as nodes, not stops; candidates who apply stop-level BFS hit an exponential state space and fail
- Design Hit Counter maps directly to Uber's rate-limiting pipelines; know the circular array solution and be ready for the distributed follow-up
- Cheapest Flights Within K Stops breaks standard Dijkstra; use Bellman-Ford with a depth limit or BFS on (city, stops_remaining) states instead
- Machine coding rounds extend standard problems with TTL expiration, concurrency, or geospatial scale — prepare the base solution and both follow-ups
- 68% of Uber's coding problems are Medium, 17% Hard; phone screens lean Easy-Medium, onsites push Medium-Hard with roughly one Hard per two rounds at L5+
- Uber interviewers are instructed not to ask verbatim LeetCode problems — expect ride-share, GPS, and pricing-flavored variants, not exact copies
You open the Uber app. You're waiting for your ride, burning 8 minutes you could have spent on LeetCode. The irony is that while you track a little car crawling across a graph, you're about to be tested on graphs. Specifically, Uber's.
Uber moves drivers, payments, and GPS coordinates at scale. Graph traversal accounts for nearly a third of coding round questions. Sliding windows and heaps dominate the rest. Knowing this makes your prep faster than grinding a generic list.
These 15 problems are ranked by frequency across 300-plus documented interview reports from LeetCode Discuss, Blind, and industry aggregators through early 2026.
All 15 Uber Coding Interview Problems, Ranked
| # | Problem | LC | Difficulty | Pattern |
|---|---|---|---|---|
| 1 | Bus Routes | 815 | Hard | Multi-source BFS |
| 2 | Design Hit Counter | 362 | Medium | Sliding window / circular array |
| 3 | Alien Dictionary | 269 | Hard | Topological sort |
| 4 | Number of Islands | 200 | Medium | DFS / BFS on grid |
| 5 | Cheapest Flights Within K Stops | 787 | Medium | Modified Bellman-Ford |
| 6 | LRU Cache | 146 | Medium | HashMap + doubly linked list |
| 7 | Find Median from Data Stream | 295 | Hard | Two heaps |
| 8 | Top K Frequent Elements | 347 | Medium | Heap / bucket sort |
| 9 | Evaluate Division | 399 | Medium | Weighted graph DFS |
| 10 | Merge Intervals | 56 | Medium | Sort + greedy sweep |
| 11 | Course Schedule II | 210 | Medium | Topological sort (Kahn's) |
| 12 | Serialize and Deserialize Binary Tree | 297 | Hard | BFS / preorder encoding |
| 13 | Word Break | 139 | Medium | Bottom-up 1D DP |
| 14 | Minimum Window Substring | 76 | Hard | Sliding window + frequency map |
| 15 | Longest Subarray Abs Diff ≤ Limit | 1438 | Medium | Monotonic deque |
About 68% of Uber's documented coding questions are Medium, 17% Hard, and 15% Easy. Phone screens land Easy-to-Medium. Onsite rounds push Medium-Hard, with one Hard appearing in roughly every other L5-plus coding round.
1. Bus Routes (LC 815)
Here's what kills candidates: they model bus stops as nodes. Makes sense. Stops exist. You visit them. You BFS between them. The problem is a single stop can be on multiple routes, so the state space blows up.
The key insight is that your graph nodes are bus lines, not bus stops. Each route is a node. Two routes are connected if they share a stop. Multi-source BFS from all routes containing the source until you reach a route containing the destination.
The abstraction shift that separates the candidates who advance from the ones who TLE.
Uber is testing whether you can reframe the graph before you code. Everyone knows BFS. The credit comes from seeing the right nodes.
2. Design Hit Counter (LC 362)
This is a machine-coding problem that's also just a real system. Uber counts events in rolling time windows constantly: rate limits, surge signals, API quotas.
The naive solution stores every timestamp and scans backward 5 minutes on every call. Fine for a toy. Not for millions of requests per second. The production solution is a circular array of 300 buckets, one per second in the last 5 minutes, where stale buckets reset on write.
The follow-up is always "how do you distribute this across servers?" Be ready with approximate counters and consistent hashing. They will ask.
3. Alien Dictionary (LC 269)
Given a sorted word list in an alien language, reconstruct the character ordering. Adjacent word pairs give directed edges (the first mismatched character implies an ordering). Then topological sort on the resulting DAG.
The hard part is building the graph, not the sort. The edge case that gets people: a longer word preceding a prefix of itself makes the input invalid. Miss that check and you build a graph that confidently lies to you.
4. Number of Islands (LC 200)
Standard DFS flood-fill on a grid. Mark visited cells, count connected components. Feels like a warmup until the follow-up arrives.
Uber often pairs this with Number of Islands II (LC 305), which adds islands dynamically and expects a Union-Find solution for near-constant time per query.
If you only practiced DFS, you'll stall when the interviewer says "now the grid is being updated in real time." Learn Union-Find with path compression before your Uber loop.
5. Cheapest Flights Within K Stops (LC 787)
Standard Dijkstra fails here because the constraint is hops, not just cost. Dijkstra happily finds the cheapest path while quietly exceeding your stop limit. You need Bellman-Ford with a depth limit: exactly K+1 relaxation passes, one per allowed hop.
def findCheapestPrice(n, flights, src, dst, k): prices = [float('inf')] * n prices[src] = 0 for _ in range(k + 1): temp = prices.copy() for u, v, w in flights: if prices[u] != float('inf') and prices[u] + w < temp[v]: temp[v] = prices[u] + w prices = temp return prices[dst] if prices[dst] != float('inf') else -1
The temp = prices.copy() is not optional. Without it, a single relaxation pass can sneak in more hops than allowed by using values already updated in the same pass. This was cited by name in a November 2025 SDE2 Bangalore report.
6. LRU Cache (LC 146)
O(1) get and put. HashMap for lookup, doubly linked list for ordering. Know this cold before your Uber onsite.
For machine-coding rounds, Uber extends LRU with TTL expiration or frequency-based eviction. One documented L4 round was built entirely around a TTL cache where entries expire after a configurable time window. The full implementation walkthrough covers the sentinel node trick that wipes out most boundary-check bugs.
7. Find Median from Data Stream (LC 295)
Maintain a max-heap for the lower half and a min-heap for the upper half. Rebalance after every insert so they differ by at most one. The median is the top of the larger heap when counts are unequal, or the average of both tops when even.
Lower half in a max-heap, upper half in a min-heap. The median lives at the boundary.
Uber uses real-time percentile computation for surge pricing and driver scoring. This problem earns its spot.
8. Top K Frequent Elements (LC 347)
The heap-based O(n log k) solution is the expected answer. The bucket sort O(n) solution earns discussion credit and shows you understand that frequencies are bounded by input length.
The follow-up transitions this into a sliding-window problem: "What if the input is an infinite stream?" Prepare both answers.
9. Evaluate Division (LC 399)
You're given equations like A/B = 2.0 and B/C = 3.0, and you need to answer A/C = ?. Model each equation as a bidirectional weighted graph edge and answer queries via DFS path product.
A/C = (A/B) * (B/C). Traverse the chain, multiply the weights. Uber uses ratio propagation like this in currency conversion across markets.
10. Merge Intervals (LC 56)
Sort by start. Sweep. If the current interval's start is at or before the previous end, merge by taking the max of both ends. Taking the second interval's end unconditionally breaks when the first completely contains the second.
Solve Insert Interval (LC 57) in the same session. The follow-up is almost always LC 57.
11. Course Schedule II (LC 210)
Return a valid topological ordering given prerequisite edges. Uber asks LC 207 as warmup, then LC 210 as the actual problem. Candidates who only drilled 207 get caught flat-footed when the interviewer says "now give me the order."
Use Kahn's BFS (track in-degrees, peel off zero-in-degree nodes) or DFS with three-color cycle detection. The topological sort breakdown covers both variants side by side.
12. Serialize and Deserialize Binary Tree (LC 297)
Convert a binary tree to a string and back. BFS level-order serialization with null markers gives a clean comma-delimited format you can split and rebuild in one pass.
Preorder with null markers also works and is slightly simpler. This appears at L4 and above because it stacks traversal fluency on top of string parsing, which is its own bug category under time pressure.
13. Word Break (LC 139)
Given a string and a dictionary, can you segment it into dictionary words? Bottom-up DP: maintain a boolean array where dp[i] = true if s[0..i] is breakable, scanning left to right.
The Trie variant earns discussion credit if you can explain when it wins (large dictionary relative to string length).
14. Minimum Window Substring (LC 76)
Smallest substring containing all characters of t. The "have vs. need" counter is what makes this tractable: expand right until satisfied, contract left until unsatisfied, track how many character frequencies are currently met.
The mental model: "have" counts how many distinct characters in t have hit their required frequency. When have equals need, you have a valid window. Candidates reinvent this from scratch under pressure and lose 10 minutes. The sliding window template shows the exact structure.
15. Longest Subarray Abs Diff ≤ Limit (LC 1438)
Longest subarray where max minus min stays within limit. Maintain two monotonic deques simultaneously, one for the running max, one for the running min, and shrink the window when the difference exceeds the limit.
A naive approach recalculates max and min on every shrink and lands in O(n squared). Keeping two deques in sync is easy to tangle under pressure, which is what makes this harder than standard sliding window.
The Problems They Won't Lift from LeetCode
Uber interviewers are explicitly told not to ask verbatim LeetCode problems. Expect domain-flavored variants.
Nearest K drivers. Given driver GPS coordinates and a rider location, return the K closest. Heap-based top-K, follow-up asks for a quadtree or geohash at scale. Essentially LC 973 wearing an Uber t-shirt.
Trip state machine. Implement the ride lifecycle: requested, accepted, en route, arrived, in progress, completed. Reject invalid transitions. Candidates who reach for a giant if-elif block do not advance.
Job scheduler with concurrency. Schedule tasks respecting dependency ordering, thread-safe. Confirmed in an SDE2 onsite. The concurrency dimension makes it considerably harder than plain topological sort.
Start With Graphs
Graph problems account for 28-32% of Uber's coding questions. Five of the fifteen problems on this list are graph problems. If you have limited prep time, go deep on BFS, DFS, topological sort, and Union-Find before anything else. That single category covers almost a third of what you'll see.
More importantly, practice saying your graph abstraction out loud before you code. Bus Routes fails when candidates jump to stop-level BFS. The interview credit comes from saying "I'm modeling routes as nodes, not stops" before writing a line. That sentence tells the interviewer more about your reasoning than the BFS itself.
Machine-coding rounds require clean design under time pressure. Voice-based mock interviews where you explain decisions out loud are the fastest way to build that fluency. SpaceComplexity runs realistic, rubric-based DSA mock interviews with the follow-up questions Uber's interviewers actually ask, including the "how would you scale this?" extensions that catch even well-prepared candidates.
For format, timing, and what each round scores, see the Uber onsite interview breakdown.
Further Reading
- Uber Engineering Blog: technical depth on the systems behind the problems they ask
- LeetCode Discuss: Uber Interview Experiences: raw candidate reports, datestamped
- Wikipedia: Topological Sorting: formal treatment of the DAG ordering problems that appear on this list
- Wikipedia: Bellman-Ford Algorithm: correctness and layer-by-layer relaxation behind LC 787
- Wikipedia: Cache Replacement Policies: theory behind LRU, LFU, and TTL variants Uber's machine-coding rounds test