Meta Coding & Algorithms Interview Questions

Preparing for Meta Coding & Algorithms interview questions requires focusing on algorithmic problem solving, writing production-minded code, and communicating tradeoffs under time

302 Questions 1 Company07.06.2026
Showing 20 results
Role
Meta logo
Meta
Medium
Machine Learning Engineer

Find kth smallest in sorted matrix

Given an n x n matrix where each row and each column is sorted in nondecreasing order, and an integer k (1 ≤ k ≤ n^ 2), return the k-th smallest eleme...

Coding & Algorithms
2
0
42 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Compute binary tree left-side view

Given a binary tree, return the values visible from the left side when looking from top to bottom. If multiple nodes exist at the same depth, the left...

Coding & Algorithms
4
0
50 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute top-N active customers

Maintain and return the top N customers by cumulative activity amount, where activity is defined as the sum of deposit amounts, pay amounts, and trans...

Coding & Algorithms
5
0
40 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Fill rooms with nearest gate distances

You are given an m×n integer grid representing rooms, where -1 is a wall, 0 is a gate, and INF (a large sentinel such as 2^31− 1) is an empty room. Fo...

Coding & Algorithms
1
0
26 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Convert BST to sorted doubly list

Convert a binary search tree into a sorted doubly linked list in-place. Reuse the existing tree nodes: the left pointer becomes prev and the right poi...

Coding & Algorithms
3
0
32 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Solve BST range average and merge intervals

1) Given a binary search tree and an inclusive range [L, R], compute both the sum and the average of all node values where L <= val <= R. Use the BST ...

Coding & Algorithms
5
0
52 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Merge two interval lists into a union

You are given two lists of closed intervals [start, end]. Each list is individually sorted by start and contains non-overlapping intervals. Merge the ...

Coding & Algorithms
1
0
23 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute nested depth-weighted sum

You are given a nested structure containing integers and lists (e.g., [1, [4, [6]]]). Define depth of the top-level as 1. Compute the total sum of all...

Coding & Algorithms
2
0
41 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Design LCA and find K closest points

Part A — LCA with parent pointers: You are given two nodes a and b in a rooted tree where each node has a parent pointer (you may or may not have dire...

Coding & Algorithms
2
0
24 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Compute left and right views once

Given the root of a binary search tree, output two lists: the nodes visible from the left side and the nodes visible from the right side, from top to ...

Coding & Algorithms
4
0
32 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Reverse between equal-value nodes in list

Given the head of a singly linked list and a target value v, locate the first two nodes whose values equal v (call them A and B, with A before B) and ...

Coding & Algorithms
3
0
36 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Count subarrays equal to target

Given an integer array nums and an integer k, return the number of contiguous subarrays whose sum equals k. Provide an algorithm better than O(n^ 2), ...

Coding & Algorithms
2
0
23 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Navigate unknown grid to locate target

You control a mouse in an unknown 2D maze. You do not know the maze dimensions or your absolute coordinates. The interface exposes move() → bool (atte...

Coding & Algorithms
2
0
24 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Find top-K frequent values with tiebreaks

Question Given an integer array nums and an integer k, return the k values with the highest frequency. The array can contain up to 10^6 elements. When...

Coding & Algorithms
5
0
40 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Find kth smallest pair sum with heaps

You are given two nondecreasing arrays A (length n) and B (length m) of non-negative integers and an integer k (1 <= k <= n*m). Return the k-th smalle...

Coding & Algorithms
3
0
48 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Find connected region sizes in matrix

Given an m x n grid of characters grid and a target character ch, implement: ( 1) sizeOfRegion(grid, r0, c0, ch) -> int that returns the size of the 4...

Coding & Algorithms
5
0
57 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning Engineer

Optimize ribbon piece length by binary search

Given an array lengths of positive integers and an integer k, you may cut each element into pieces of integer length L > 0. Find the maximum L such th...

Coding & Algorithms
3
0
48 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Machine Learning EngineerIntern

Implement scaled dot-product attention

Task In this interview you are asked to hand-write the forward pass of attention from the mathematical formula (no need to run code). Implement single...

Coding & Algorithms
3
0
44 people solved
Sep 2, 2025
Meta logo
Meta
Medium
Software Engineer

Implement sparse vector dot product

Question Design a SparseVector class for vectors of integers in which most entries are zero, and support an efficient dot product between two such vec...

Coding & Algorithms
2
0
39 people solved
Aug 14, 2025
Meta logo
Meta
Medium
Software Engineer

Compute BST range sum

Given the root of a binary search tree and two integers low and high (inclusive), compute the sum of values of all nodes with low <= val <= high. Prov...

Coding & Algorithms
3
0
29 people solved
Aug 14, 2025

Frequently Asked Questions

How difficult are Meta Coding & Algorithms interview questions?
Meta Coding & Algorithms questions are typically rated medium to hard and often grow tougher as you progress through rounds. Early screens usually aim to confirm correct problem solving and implementation ability, while onsite interviews expect robust algorithmic thinking, time and space optimality, and clear communication under pressure. Interviewers evaluate how you approach unfamiliar problems, move from brute force to optimized solutions, handle edge cases, and articulate complexity trade‑offs. Preparation should target speed, pattern recognition, and producing clean, testable code that can be reasoned about aloud during the interview.
Where in Meta's interview process do Coding & Algorithms questions appear, and how are they evaluated?
Coding and algorithms questions commonly appear in phone screens, technical online assessments, and the core onsite/virtual loop; they may be mixed with product or design conversations depending on role. Evaluations focus on problem decomposition, correctness, algorithmic efficiency, and code quality. Interviewers listen for clear problem statements, thoughtful trade‑offs, and how you validate solutions against edge cases and constraints. For more senior roles, emphasis shifts to selecting the right abstractions and reasoning about large inputs and performance. Communication, testing, and the ability to iterate from a simple approach to an optimized one are all part of the score.
How should I plan my interview preparation timeline for Meta Coding & Algorithms roles?
A disciplined timeline usually spans six to twelve weeks depending on experience and starting point. Begin with two to three weeks of fundamentals: solidify data structures, complexity analysis, and core algorithms. Follow with four to six weeks of focused practice on medium and hard problems, rotating topics and timing yourself, while documenting patterns and common mistakes. In the final two weeks, emphasize mock interviews, timed coding rounds, and refining communication and testing habits. Regularly review incorrect solutions to identify recurring gaps, and incorporate at least a few live mock interviews to habituate speaking through your thought process.
What key subtopics within Coding & Algorithms should I focus on for Meta interviews?
Concentrate on arrays and strings, trees and graphs (including BFS/DFS), hash maps, two‑pointer and sliding window techniques, recursion and backtracking, dynamic programming, and sorting/search algorithms. Also prepare on complexity analysis, space‑time tradeoffs, handling NULLs and edge cases, and writing robust test cases. For higher levels, emphasize understanding of algorithmic scalability, memory layout implications, and performance tuning. Equally important are clear coding style, readable variable names, and the ability to explain why a chosen data structure or algorithm best fits the constraints of the problem.
What standout tips, common pitfalls, and final advice for Coding & Algorithms interviews at Meta?
Start each problem by asking clarifying questions and describing a brute‑force approach before optimizing. Verbally outline your plan, write clean code with basic tests, and explain complexity at the end. Common pitfalls include diving into coding without validating edge cases, ignoring constraints, and failing to communicate assumptions. Avoid overfitting to memorized problems; instead, internalize patterns so you can adapt. Use mock interviews to sharpen pacing and feedback. Finally, remain calm if stuck: state hypotheses, try small examples, and iterate—interviewers value structured thinking and recoveries as much as perfect first attempts.

Explore more Meta Coding & Algorithms interview questions

Real questions from candidate reports, grouped by role, topic and company.

By role
Other categories at Meta
Coding & Algorithms questions at other companies
Browse all