Top 15 LeetCode Problems for Mobile Engineer Interviews
- Trees are overrepresented in mobile interviews relative to backend roles because interviewers spend their careers in view hierarchies
- LRU Cache (LC 146) is the single most mobile-specific problem on this list; implement the doubly linked list from scratch, not just the interface
- Design Hit Counter with a circular array maps directly to analytics and rate limiting work mobile engineers do daily
- Topological sort (LC 207) applies to feature flag dependencies and SDK initialization sequences, not just academic graphs
- Two-heap median (LC 295) signals you can reason about online algorithms and streaming data, both real constraints for mobile analytics pipelines
- Sliding window (LC 3) recurs in event stream deduplication, session windowing, and input validation on mobile forms
- The interview rubric scores narration as heavily as correctness; practice these problems out loud before your onsite
You've shipped production apps. You've handled memory warnings, background tasks, and concurrency bugs that made you question your life choices. And now you're sitting down to solve a binary tree problem in 45 minutes.
Welcome to the software engineering interview, where six years of shipping UIKit code tells the interviewer nothing, but implementing an LRU cache from scratch apparently tells them everything. Nobody said it was logical.
Mobile engineering interviews at Apple, Meta, Uber, and Google run the same format as general software engineering loops: algorithmic coding, system design, behavioral. The LeetCode problems that come up follow the same rubric. But the distribution shifts.
Trees show up more often in mobile interviews than in backend interviews. Your interviewer has spent years navigating view hierarchies, and it shapes what problems come to mind. Design-adjacent problems surface more than you'd expect too: caching, event counters, stream medians. These are not abstract exercises when memory is a first-class constraint. And there is one specific problem (the LRU cache) that appears in mobile interview reports so consistently it has become practically its own genre.
The 15 problems below are drawn from interview reports at Apple, Meta, Uber, Google, and Samsung, organized by pattern family. Work through them in order.
The Two You Cannot Skip
1. Two Sum (LC 1) | Hash Map
The simplest hash map problem. You will still get asked it, usually as a phone screen warmup. The point is not the algorithm. The point is solving it in O(n) in under two minutes and explaining why, so the interviewer can spend the rest of the session on something interesting.
Build a seen dictionary. For each number, check if target - num is already in it.
def twoSum(nums, target): seen = {} for i, num in enumerate(nums): complement = target - num if complement in seen: return [seen[complement], i] seen[num] = i
2. Reverse Linked List (LC 206) | Linked List
Asked at nearly every company as a warmup. Nail the three-pointer iterative version cold. The recursive version is elegant but eats stack space, which matters: iOS main thread gets 8MB, secondary threads get 512KB, and a stack overflow in production is a distinctly worse outcome than a slightly less elegant solution in an interview.
def reverseList(head): prev, curr = None, head while curr: next_node = curr.next curr.next = prev prev = curr curr = next_node return prev
The Three That Separate Mobile from Generic
3. LRU Cache (LC 146) | Hash Map + Doubly Linked List
This is the most mobile-relevant DSA problem in existence. You have shipped an image cache. The cache has an eviction policy. That eviction policy is almost certainly LRU. You have used this data structure for years without thinking about how it works. Now you need to build it on a whiteboard in 40 minutes while someone watches.
Apple lists it as their most consistently reported design problem. Uber asks it. Meta asks it. If you only deep-dive one problem before your mobile loop, it is this one.
The solution combines a hash map (O(1) lookup) with a doubly linked list (O(1) move-to-front). Two sentinel nodes at head and tail eliminate all edge case checks.

The full breakdown with implementations in every major language is in the LRU cache guide.
4. Design Hit Counter (LC 362) | Circular Array
Design a counter that returns how many hits occurred in the past 300 seconds. Use a circular array of size 300. Each slot stores a (timestamp, count) pair. On each hit, if the stored timestamp matches current_second % 300, increment. Otherwise reset.
This is a proxy for analytics, rate limiting, and event windowing, all of which mobile engineers build constantly. Uber, Datadog, and several mobile platform teams have reported hit counter variants in their loops. The problem is suspiciously useful for something that sounds like a throwaway design exercise.
def hit(self, timestamp: int) -> None: idx = timestamp % 300 if self.times[idx] != timestamp: self.times[idx] = timestamp self.counts[idx] = 1 else: self.counts[idx] += 1
5. Serialize and Deserialize Binary Tree (LC 297) | Tree + Recursion
Apple's most reported hard-tier problem. Encode a tree to a string, decode it back. The execution forces you to reason about tree structure, null representation, and format invariants simultaneously.
The interview signal is almost entirely in your explanation, not just the code. Either BFS (level-order, explicit null markers) or preorder DFS (first element is always root, recurse left then right) is acceptable. Know one completely. Say it out loud before you code it.
Why Mobile Engineer Interviews Have More Tree Problems
UIKit's view hierarchy is a tree. Android's ViewGroup is a tree. React Native's component tree is a tree. SwiftUI's view body is also a tree, just a more functional one that doesn't technically admit it.
When your interviewer has spent five years debugging layout passes on deeply nested view hierarchies, tree problems surface naturally. Expect at least one per round at any major mobile loop.
6. Binary Tree Level Order Traversal (LC 102) | BFS
The foundational BFS tree problem. You want breadth-first here because each level needs to be collected separately. For BFS versus DFS, this is the clearest case.
Snapshot the queue length at the start of each outer loop iteration. Process exactly that many nodes. That snapshot is one level.
for _ in range(len(queue)): # snapshot the level size before processing node = queue.popleft() level.append(node.val) if node.left: queue.append(node.left) if node.right: queue.append(node.right)
7. Diameter of Binary Tree (LC 543) | DFS Postorder
The diameter is the longest path between any two nodes, and it does not have to pass through the root. That is the trap most candidates fall into.
The function returns height to the parent, but updates a global maximum as a side effect. Two things happening in one function. Mixing them up is the most common first-attempt bug.
def dfs(node): if not node: return 0 left, right = dfs(node.left), dfs(node.right) self.diameter = max(self.diameter, left + right) return 1 + max(left, right)
Graphs Show Up in Disguise
8. Number of Islands (LC 200) | Grid DFS/BFS
An island grid is an implicit graph. Each '1' cell is a node; edges connect adjacent cells. Run a DFS from every unvisited land cell.
The outer loop is not optional. Skipping it counts only one connected component. Mark visited cells as '0' in place to avoid allocating a separate visited array.
9. Word Search (LC 79) | DFS + Backtracking
For each cell matching the first character, run a DFS in all four directions. Before the recursive call, mark the current cell visited (set to '#'). After the call returns, restore it.
The restore step is the entire point of the problem. Without it, later branches see cells as already visited when they are not. The undo is what makes this backtracking rather than a plain traversal. If you forget to restore, your DFS will eat cells it shouldn't and you'll spend ten minutes confused about why the output is wrong.
10. Course Schedule (LC 207) | Topological Sort
Given prerequisites, can you complete all courses? Cycle detection in a directed graph. Use Kahn's BFS: build in-degree counts, seed a queue with zero-in-degree nodes, process until empty.
If processed_count != n, a cycle exists. This pattern applies directly to feature flag dependency resolution, build system ordering, and SDK initialization sequences. Mobile engineers hit topological sort in production more often than the LeetCode tag suggests. They just don't call it that.
Streams and Ranges Are Daily Mobile Work
11. Longest Substring Without Repeating Characters (LC 3) | Sliding Window
A left pointer, a right pointer, a set tracking characters in the current window. Expand right freely. Contract left when a duplicate enters.
The shrink condition is the whole problem. When you see a duplicate at right, advance left until the duplicate is gone, then add the new character. The pattern recurs in event stream deduplication, session windowing, and input validation on mobile forms.
12. Merge Intervals (LC 56) | Intervals
Sort by start time. Walk forward. Merge the current interval into the last output interval if they overlap.
for interval in intervals: if result and result[-1][1] >= interval[0]: result[-1][1] = max(result[-1][1], interval[1]) # max is not optional else: result.append(list(interval))
Without max(), a contained interval like [2, 5] inside [1, 10] silently truncates the merged end to 5. The bug is silent and tests often miss it. This is the kind of subtle mistake that shows up in interview feedback as "candidate missed a containment edge case."
Three Problems That Signal Data Infrastructure Chops
13. Coin Change (LC 322) | 1D Bottom-Up DP
The canonical bottom-up DP problem. Build a dp array of size amount + 1, initialized to infinity, with dp[0] = 0. For each amount from 1 to target, try every coin and take the minimum.
This problem teaches the bottom-up DP mental model. Solve it, then adapt the same template to Climbing Stairs and Jump Game. Once you can write all three from memory, you understand the pattern rather than the specific answer.
14. Kth Largest Element in an Array (LC 215) | Min-Heap
Maintain a min-heap of size k. Push every element; whenever size exceeds k, pop the smallest. The top of the heap at the end is the kth largest.
O(n log k) time, O(k) space. Quickselect gives O(n) average but the heap solution is faster to implement correctly under pressure, which is the relevant metric when you're also supposed to be narrating everything out loud.
15. Find Median from Data Stream (LC 295) | Two Heaps
Two heaps: a max-heap for the lower half, a min-heap for the upper half. Keep them balanced (size difference at most 1). The median is the top of the larger heap, or the average of both tops.
Uber explicitly reports stream median variants in the context of surge pricing and driver ETA distributions. This problem signals that you can reason about online algorithms and streaming data, both real constraints for any mobile engineer building analytics pipelines.
Three Weeks. Do It in This Order.
| Week | Problems | Focus |
|---|---|---|
| 1 | Two Sum, Reverse Linked List, LRU Cache, Sliding Window | Foundations + the most important one |
| 2 | Tree BFS/DFS (102, 543, 297), Grid/Graph (200, 79, 207) | Trees and graphs, the mobile-heavy zone |
| 3 | Merge Intervals, Coin Change, Kth Largest, Median Stream, Hit Counter | Intervals, DP, heap, design |
On at least a third of these problems, practice out loud before running the code. Mobile interviews are voice-based, 45-minute sessions. The problems you solved silently at home feel completely different when you have to narrate them in real time. SpaceComplexity runs voice-based mock interviews with rubric-graded feedback covering exactly these patterns. A few sessions before your onsite is worth the reps.
For more on what platforms weight which skills, the iOS engineer DSA guide and the Android developer interview guide go deeper on platform-specific expectations alongside the algorithmic prep.
Before You Close This Tab
- Trees are overrepresented in mobile interviews relative to backend roles. Plan for at least one tree problem per round.
- LRU Cache is the single most mobile-specific problem on this list. Implement it from scratch, including the doubly linked list, not just the interface.
- Design Hit Counter, Median from Data Stream, and Serialize/Deserialize Binary Tree signal that you can build data infrastructure, not just solve puzzles.
- Correct code with zero verbal explanation does not clear the rubric. Practice narrating your solution before you submit it.
Further Reading
- LeetCode problem set with company-tagged filters for Apple, Meta, and Uber
- Wikipedia: Cache replacement policies for the theory behind LRU and other eviction strategies
- Apple Developer Documentation: UIKit for context on why iOS interviewers gravitate toward tree problems
- Android Developer Documentation: Layouts and ViewGroups for the Android view hierarchy structure
- GeeksForGeeks: Topological Sorting for a clean walkthrough of both Kahn's BFS and DFS-based approaches