Top 15 Meta Coding Interview Problems: The Patterns That Show Up

June 6, 202611 min read
interview-prepdsaalgorithmsleetcode
Top 15 Meta Coding Interview Problems: The Patterns That Show Up
TL;DR
  • Meta's coding bar favors trees and graphs, not dynamic programming — BFS is the single most reusable pattern across multiple problem families
  • Binary Tree Vertical Order Traversal (LC 314) is the most reported Meta-specific problem in 2024-2026 candidate data; drill this one first
  • LCA of Binary Tree III (LC 1650) uses a parent-pointer trick identical to Floyd's cycle detection to find ancestors in O(h) time with O(1) space
  • Minimum Remove to Make Valid Parentheses (LC 1249) is consistently Meta-specific; memorize the stack-plus-index-set pattern
  • Quickselect is the senior-level answer for Kth Largest — Meta expects the O(n) average approach over the O(n log k) heap solution
  • The real time budget is 20 minutes per problem, not 45; practice under that constraint or the format will catch you by surprise

Most engineers prep for Meta the same way they prep for Google: grind DP, memorize Dijkstra, review system design. Then they sit down in the actual interview and get three tree traversal problems in a row.

Meta's coding bar looks different from the outside than it does from the inside. Dynamic programming is not in the question pool. Trees and graphs dominate. Speed matters more than at most companies because you're typically solving two medium-difficulty problems in roughly 35 minutes of actual coding time.

This list is built from candidate reports in LeetCode discuss, Blind, and Glassdoor covering 2024-2026, cross-referenced against the Meta company tag on LeetCode. These are the 15 Meta coding interview problems and patterns that keep coming up. Not a random sample, and not the obvious "blind 75" overlap. These are Meta-specific.


Two Problems. Twenty Minutes Each.

Meta phone screens run 45 minutes, with about 35 minutes of actual coding time after introductions. You're using CoderPad, which means your code actually runs. Live. In front of a stranger who is quietly deciding your financial future.

Onsites have two or three coding rounds at the same pace. Two problems per round is the norm. The first tests your algorithm instincts. The second tests whether you can write clean, bug-free code while your hands shake.

The takeaway: practice with a 20-minute timer per problem, not 45. That's the actual budget. 45 feels generous right up until it isn't.


Trees Are Where Meta Gets Specific

Meta asks more tree problems than any other FAANG company. Not just standard traversals. They want traversal variations that require you to track state you're not used to tracking.

1. Binary Tree Right Side View (LC 199)

BFS with a twist: only collect the last node at each level. The problem tests whether you can adapt a standard level-order traversal to record something specific per level. The mistake candidates make is reaching for DFS first and then fighting the implementation. BFS with a queue is cleaner. Track level boundaries by iterating through the queue's current length, then grab the last value before moving to the next level.

2. Binary Tree Vertical Order Traversal (LC 314)

The single most frequently reported Meta tree problem in recent candidate posts. You traverse the tree and group nodes by their horizontal column offset. Root is column 0, left children decrement, right children increment.

The key insight is that BFS preserves top-to-bottom ordering within each column automatically. If you use DFS, you have to sort nodes within each column afterward. Use a hash map from column index to a list of node values, track the min and max column seen, then reconstruct from min to max at the end.

3. Lowest Common Ancestor of a Binary Tree III (LC 1650)

This variant gives you the nodes directly with parent pointers. Each node has .val, .left, .right, and .parent. No root node is given.

The elegant solution is the linked list cycle trick: two pointers starting at each node, walking up via parent. When one pointer reaches null, redirect it to the other node's starting position. They meet at the LCA. This is the same pointer trick from Floyd's algorithm, applied to a tree. O(h) time, O(1) space. The kind of solution that makes you feel, briefly, like a genius.

4. Serialize and Deserialize Binary Tree (LC 297)

Meta asks serialization problems because they reveal how deeply you understand tree structure. BFS serialization is the most common approach: output nodes level by level, using a sentinel like null for missing children.

Deserialization is where candidates struggle. You need a queue to track which node is waiting for its children, and you consume the serialized values in the same BFS order. DFS approaches work too, but are harder to explain clearly under time pressure. And time pressure is the one thing you're guaranteed to have.


Graphs: Components, Clones, and Dependencies

After trees, graphs dominate. Meta's graph problems cluster around connected components, graph construction, and dependency ordering.

5. Number of Islands (LC 200)

Still appearing constantly across all FAANG companies. You're given a 2D grid and need to count distinct land regions.

The pattern is flood fill: DFS from every unvisited land cell, marking cells as visited in-place by setting them to '0'. The number of times you initiate a DFS from an unvisited cell is your answer. Get comfortable doing this without a separate visited set. The in-place mutation feels wrong at first. It isn't.

6. Clone Graph (LC 133)

Given a reference to a node in an undirected graph, return a deep copy. The challenge is handling cycles without infinite looping. Yes, you can get into an infinite loop here. Meta knows this.

Use a hash map from original nodes to their clones. If you've already created a clone for a given node, return it immediately instead of recursing. Meta uses this to check whether you understand reference semantics. They also get to watch you confidently walk into an infinite loop and see how long it takes you to notice.

7. Course Schedule (LC 207)

Detect whether prerequisite relationships form a cycle. If they do, the courses can't all be completed. Deeply relatable to anyone who's tried to register for anything at a university.

Kahn's algorithm (BFS with in-degree counting) is usually cleaner to explain: add all nodes with in-degree 0 to a queue, process them, decrement neighbors' in-degrees, then check whether all nodes were processed. If the count doesn't match the total, there's a cycle.


Arrays: The Warm-Up Tier

These show up early in a Meta round to calibrate your baseline. They feel simple. Some of them have teeth.

8. 3Sum (LC 15)

Find all unique triplets that sum to zero. Sort the array, then for each element use two pointers converging from both ends.

The hardest part is deduplication. After finding a valid triplet, skip over duplicate values for both pointers before continuing. Candidates often produce duplicates because they miss this step, then spend five minutes debugging output that's almost right but not quite.

9. Valid Palindrome (LC 125)

Ignore non-alphanumeric characters, lowercase everything, check if it reads the same both ways. Two-pointer approach, O(n) time, O(1) space. Meta uses this as a calibration problem: it checks that you handle edge cases like empty strings and all-space inputs without being prompted.

If your solution fails on the empty string, the interviewer notes it. They don't have to say anything.

10. Container With Most Water (LC 11)

Given heights of vertical lines, find the pair that traps the most water. Always move the pointer on the shorter line inward. The reasoning: moving the taller line can only decrease width while the shorter line (the bottleneck) doesn't improve.

This "why does it work?" reasoning is exactly what Meta interviewers want to hear out loud. Not just the code. The logic behind why this particular greedy choice is safe.


Parentheses: Meta's Favorite String Pattern

11. Minimum Remove to Make Valid Parentheses (LC 1249)

One of the most frequently cited Meta-specific problems in recent candidate reports. The problem sounds fiddly. It is fiddly. You just need to be systematic about it.

Use a stack to track indices of unmatched open parentheses, and a set to collect indices that need removal. When you see (, push its index. When you see ), pop from the stack if non-empty, otherwise mark that ) for removal. All remaining indices in the stack are unmatched opens. Rebuild the string skipping marked indices.

12. Longest Substring Without Repeating Characters (LC 3)

Classic sliding window. Maintain a window with no repeated characters using a hash map from character to its most recent index.

The bug that gets candidates is forgetting to clamp the left pointer. If the repeated character's previous index is before the current window's left boundary, don't move left. The fix: left = max(left, prev_index + 1). Miss this and your window starts shrinking in the wrong direction. Quietly. Incorrectly.


Linked Lists: One Pointer Trick, One Code Quality Check

13. Merge k Sorted Lists (LC 23)

Use a min-heap initialized with the first node from each list. Pop the minimum, add it to the result, push that node's .next back into the heap.

This tests whether you can use a heap for continuous minimum extraction, not just a one-time sort. O(n log k) where n is total nodes and k is the number of lists. Practice using Python's heapq with tuples or Java's PriorityQueue with a custom comparator, because you can't compare node objects directly. Nothing drives this home like realizing it 12 minutes into a round.

14. Add Two Numbers (LC 2)

Two numbers as reversed linked lists. Add digit by digit, handling carry. The implementation is simple but the edge cases aren't: continue the loop when one list is exhausted but carry is still non-zero.

Meta uses this as a code quality check. No algorithmic insight required. Just many, many ways to get the carry logic wrong.


The One Heap Problem Worth Drilling

15. Kth Largest Element in an Array (LC 215)

Two approaches: min-heap of size k (O(n log k)) or quickselect (O(n) average).

Quickselect is what Meta wants from a senior-level candidate. The partition step is identical to quicksort's. After partitioning, recurse into only one side. Using a heap is not wrong. It just signals "I know the tool" rather than "I know the technique." At a senior level, that distinction matters.


How to Prepare for Meta Coding Interview Problems

ProblemPatternLeetCode #
Binary Tree Right Side ViewBFS / Level order199
Binary Tree Vertical Order TraversalBFS + column tracking314
LCA of Binary Tree IIIParent pointer trick1650
Serialize and Deserialize Binary TreeTree construction297
Number of IslandsFlood fill / DFS200
Clone GraphBFS + hash map133
Course ScheduleTopological sort207
3SumSort + two pointers15
Valid PalindromeTwo pointers125
Container With Most WaterGreedy two pointers11
Minimum Remove Valid ParenthesesStack + index set1249
Longest Substring No RepeatSliding window3
Merge k Sorted ListsMin-heap23
Add Two NumbersLinked list simulation2
Kth Largest ElementQuickselect215

One pattern cuts across almost everything on this list: BFS. Level-order traversal, flood fill, clone graph, topological sort with in-degree counting. Meta leans on BFS more than most companies. If your BFS is slow or buggy, that hurts you across multiple problem families at once.

LC 314 is the most frequently reported Meta-specific problem in 2024-2026 candidate data. If you have time to drill only one tree problem, drill that one.

Practice talking while coding. Meta interviewers explicitly score testing as a separate dimension. State your edge cases before you code, trace through your solution once at the end.

For voice-based mock interview practice that simulates the pace and pressure of a real Meta round, SpaceComplexity gives you rubric-based feedback across all four dimensions Meta actually scores: communication, problem-solving, code quality, and testing.

See also the full Meta software engineer interview guide, the Meta onsite interview breakdown, and the binary tree interview problems list for deeper coverage of the tree patterns here.


Further Reading