HomeBlog › Meta Coding Interview Questions

Meta Coding Interview Questions: E4, E5, E6 Bar

Faster, denser, more breadth. The two-problems-per-round format, six classic Meta questions, and what E5 vs E4 actually looks like in practice.

Meta's coding interview moves at a different pace than the other FAANGs. Most loops will ask you to solve two complete problems in a single 45-minute round - which means about 18-20 minutes per problem including discussion, coding, and follow-ups. The questions themselves are familiar LeetCode mediums; the speed is what filters candidates.

This guide covers the two-problems-per-round format, six representative problems Meta has asked across reported E4 and E5 loops since 2024, and what each level actually requires when the same problem could result in a hire at E4 and a no-hire at E5.

The format that breaks people

At Google or Amazon you typically get one problem per round, 45 minutes to think, code, optimize. At Meta you usually get two problems in 45 minutes. The interviewer brings up problem 1, you solve it in roughly 18 minutes, then they pivot to problem 2 with maybe a one-sentence transition.

This format produces three predictable failure modes:

The full interview process

StageFormatNotes
Recruiter screen30 minTenure, target team, comp expectations
Technical phone screen45 min, 1-2 coding problemsConducted on CoderPad or coderpad-equivalent
Onsite coding 145 min, 2 problemsOften "Ninja" round (mid-difficulty mediums)
Onsite coding 245 min, 2 problemsOften "Pirate" round (harder mediums, occasional hard)
System design (E5+)45 minReal-world product (News Feed, Messenger, etc.)
Behavioral / "Jedi"45 minCareer history, conflict, growth - looking for "ownership" + cross-functional examples
Hiring manager30-45 minTeam fit, why this team specifically

The "Ninja/Pirate" labels are internal nicknames Meta interviewers use. Don't bring them up; they signal you've read prep guides too aggressively. But know they exist so the round difficulty doesn't surprise you.

Problem 1: Move zeros (warm-up classic)

Question: Given an array of integers, move all zeros to the end while keeping the relative order of non-zero elements. Do it in-place, O(1) extra space.

This is so common in Meta phone screens that recruiters sometimes mention it informally. It's the "did you do basic prep?" problem.

def moveZeroes(nums):
    write = 0
    for read in range(len(nums)):
        if nums[read] != 0:
            nums[write], nums[read] = nums[read], nums[write]
            write += 1

Two-pointer technique. Time O(n), space O(1). The trap: a junior candidate writes a version that scans twice (count zeros, then fill); the senior writes the one-pass swap. Both work; the one-pass is what Meta wants.

Follow-up: "What if we also need to move all negative numbers after the zeros, in reverse order?" Now you need a three-bucket partition or stable sort with custom comparator. Show you can adapt, don't restart from scratch.

Problem 2: Subarray sum equals K

Question: Given an array of integers nums and an integer k, return the total number of continuous subarrays whose sum equals k.

The brute force is O(n^2) - try every (start, end) pair. The interviewer wants the prefix-sum-with-hashmap optimization.

def subarraySum(nums, k):
    count = 0
    prefix_sum = 0
    sums = {0: 1}  # prefix sum -> frequency
    for num in nums:
        prefix_sum += num
        if prefix_sum - k in sums:
            count += sums[prefix_sum - k]
        sums[prefix_sum] = sums.get(prefix_sum, 0) + 1
    return count

The key insight: if prefix_sum[j] - prefix_sum[i] = k, then the subarray (i+1, j) sums to k. So for each j, we check how many prefix sums of value prefix_sum[j] - k we've seen before. The {0: 1} initialization handles the subarray starting from index 0.

Why Meta loves this problem: the brute-force-to-optimal jump is conceptually meaningful (prefix sums + hashing), and the optimal solution is short. They can ask it as problem 1 in a two-problem round.

Problem 3: Random pick with weight

Question: Given an array w of positive integers where w[i] is the weight of index i, implement pickIndex() which randomly picks an index i with probability proportional to w[i].

This is a binary-search-on-prefix-sum problem. Build a prefix sum array; pick a random number in [0, total); binary-search to find which bucket it falls in.

import random
import bisect

class Solution:
    def __init__(self, w):
        self.prefix = []
        running = 0
        for weight in w:
            running += weight
            self.prefix.append(running)
        self.total = running

    def pickIndex(self):
        target = random.uniform(0, self.total)
        return bisect.bisect_left(self.prefix, target)

The conversation Meta wants: "Why prefix sum?" Because we're sampling from a discrete distribution. "Why binary search?" Because the prefix sums are sorted (weights are positive). "Why bisect_left not bisect_right?" Because we want the smallest index whose prefix sum is at least our target. Verbalize these as you code.

Problem 4: K closest points to origin

Question: Given an array of points (x, y) on a plane, return the k points closest to the origin (0, 0).

Three valid approaches; the interviewer wants you to discuss the trade-offs:

  1. Sort the whole array by distance, take first k. O(n log n).
  2. Max-heap of size k. O(n log k). Better when k is small relative to n.
  3. Quickselect (partition). O(n) average, O(n^2) worst case. Best when you need exact top-k and have control over input.
import heapq

def kClosest(points, k):
    heap = []
    for x, y in points:
        dist = -(x * x + y * y)  # negate for max-heap behavior
        if len(heap) < k:
            heapq.heappush(heap, (dist, x, y))
        elif dist > heap[0][0]:
            heapq.heapreplace(heap, (dist, x, y))
    return [[x, y] for _, x, y in heap]

Why this problem is great for Meta: the interviewer can probe at three different depths depending on time. The basic solution is sort. The optimization is heap. The expert variant is quickselect. They can grade you anywhere on that ladder without changing the question.

Problem 5: Valid palindrome II

Question: Given a string s, return true if it can be a palindrome after deleting at most one character.

Two-pointer with a single chance to skip. When the pointers disagree, try skipping the left character OR the right character, and check if either resulting substring is a palindrome.

def validPalindrome(s):
    def isPalindrome(left, right):
        while left < right:
            if s[left] != s[right]:
                return False
            left += 1
            right -= 1
        return True

    left, right = 0, len(s) - 1
    while left < right:
        if s[left] != s[right]:
            return isPalindrome(left + 1, right) or isPalindrome(left, right - 1)
        left += 1
        right -= 1
    return True

The trap: candidates try to recursively allow "at most one skip" and write a more general dp solution. That works but uses more time than the 18 minutes you have in a two-problem round. The two-pointer with explicit skip is faster to write and easier to explain.

Problem 6: Continuous subarray sum (multiple of K)

Question: Given an integer array nums and an integer k, return true if nums has a continuous subarray of size at least two whose sum is a multiple of k.

Prefix sum with modulo. Two prefix sums with the same remainder modulo k means the subarray between them sums to a multiple of k.

def checkSubarraySum(nums, k):
    seen = {0: -1}  # remainder -> earliest index
    prefix = 0
    for i, num in enumerate(nums):
        prefix += num
        rem = prefix % k if k else prefix
        if rem in seen:
            if i - seen[rem] >= 2:
                return True
        else:
            seen[rem] = i
    return False

The size-at-least-two constraint matters. If you don't check i - seen[rem] >= 2, you return true for single-element multiples of k. Many candidates miss this on first pass. The interviewer will ask "is [6] a valid answer for k=6?" - if you say yes, you've failed the edge case check.

Patterns Meta asks more than other FAANG

PatternFrequency at MetaFrequency at Google
Prefix sum + hashmap~25% of loops~10%
Two pointers / sliding window~20%~20%
BFS / DFS on trees and grids~20%~25%
Heap / priority queue~15%~10%
Binary search on answer~10%~15%
Dynamic programming~10%~20%

Meta over-indexes on prefix sum patterns; Google over-indexes on dynamic programming. If your prep time is constrained and you have a Meta loop, prioritize the 15 LeetCode patterns from our pattern guide with extra weight on prefix sum and hashing.

The Meta Top 75

An informal community-maintained list of the 75 problems Meta has asked most often, updated quarterly by recruiters and candidates posting to Blind. If you only have 2 weeks before your loop, drill this list. The names rotate but the patterns don't - if you can solve any 60 of the 75 cold, you'll recognize 90% of what comes up in your loop.

Public versions live on LeetCode under tags like "Meta" or "Facebook." Filter by company "Meta," sort by frequency descending, take top 75. The list overlaps significantly with the Top 50 Most-Asked, so prioritize that subset first.

What E4 vs E5 vs E6 looks like in the same problem

Imagine the interviewer asks "Move Zeros." How the grading differs by target level:

Common pitfalls specific to Meta

A 21-day prep plan for a Meta onsite

  1. Days 1-7: Drill the LeetCode "Meta Top 75" list. Solve 10 per day, three times each (spaced repetition). At day 7 you've drilled the top 75 once and the top 20 three times.
  2. Days 8-12: Two-problems-per-session practice. Solve random medium pairs back-to-back with a 45-minute timer. This builds the context-switching muscle.
  3. Days 13-15: System design (if E5+). Drill the four classics: design News Feed, design Messenger, design Instagram, design WhatsApp.
  4. Days 16-18: Behavioral prep. Have one story per Meta cultural value (Move Fast, Be Bold, Focus on Impact, Be Open, Build Social Value). Run a solo mock.
  5. Days 19-20: Rest or light review. Cold problems day before tend to introduce panic, not improvement.
  6. Day 21 (onsite): 8 hours of sleep, dressed comfortable, water and a snack between rounds.

Pace yourself in the two-problem rounds with live AI support

CoPilot Interview surfaces structured solutions in about 4 seconds during real Zoom and Teams calls. Free for Windows and macOS, invisible on screen-share.

Download free

FAQ

How many coding rounds does Meta have?

Onsite is two coding rounds, each 45 minutes and containing TWO problems back-to-back. So you'll solve four problems total in two rounds. Plus one system design round (for E5+), one behavioral round, and a hiring manager screen earlier in the loop. The two-per-round format is unique to Meta and is the source of most candidate stress.

What is the Meta Top 75 list?

An informal but well-validated list of the 75 LeetCode problems Meta has historically asked most often. It is maintained by community recruiters and updated quarterly. If you only have time to drill one list before a Meta loop, this is it. Most Meta interview problems still come from or closely resemble this list.

What is the difference between Meta E4, E5, and E6?

E3 is new grad. E4 is mid-level engineer, expected to solve LeetCode mediums in 20 minutes with optimal Big-O. E5 is senior, the most common level for industry hires - same coding bar as E4 plus owns a system design round. E6 is staff, leads multi-team initiatives, system design round is more architectural; coding bar relaxes slightly because the role is less hands-on. Most external hires from FAANG-equivalent companies target E5.

How do I prepare for the two-problems-per-round format?

Practice splitting 45 minutes into 18+18+9 (problem 1, problem 2, buffer/follow-ups). Solve in batches of two related medium problems back-to-back without breaks. The skill is not just solving fast - it's context-switching cleanly so problem 2 isn't slowed down by mental fatigue from problem 1.

Does Meta use a hiring committee or a Bar Raiser?

Meta uses a hiring committee, not a Bar Raiser. After your loop, all interviewers submit written feedback and one or two committee members review the packet. The committee can request a debrief from any interviewer if signal is unclear. Decisions are typically made within 5-10 business days of the onsite.