Meta Software Engineer Coding & Algorithms Interview Questions

Practice 218 real Coding & Algorithms interview questions for Software Engineer roles at Meta.

218 Questions 1 Company07.06.2026
Showing 20 results
Role
Meta logo
Meta
Hard
Software Engineer Locked

Guide a mouse to find cheese with APIs

This question evaluates the ability to reason about graph exploration and stateful API interaction in an unknown 2D grid, assessing competencies in se...

Coding & Algorithms
3
0
45 people solved
Nov 12, 2025
Meta logo
Meta
Medium
Software Engineer

Determine if subarray sums to target

You are given an array of non-negative integers and a non-negative integer target. Determine whether there exists a contiguous subarray (continuous se...

Coding & Algorithms
7
0
59 people solved
Nov 11, 2025
Meta logo
Meta
Medium
Software Engineer

Find K-th Largest and Longest Vacation

Solve the following two coding problems. 1. Find the k-th largest element Given an integer array nums and an integer k, return the element that wou...

Coding & Algorithms
3
0
29 people solved
Nov 1, 2025
Meta logo
Meta
Medium
Software Engineer

Design an in-memory database with TTL and history

Design and implement an in-memory key–field–value store with monotonic timestamps. Keys and fields are strings; values are integers. Provide these API...

Coding & Algorithms
9
0
100 people solved
Sep 6, 2025
Meta logo
Meta
Medium
Software Engineer

Implement power and balance-parentheses algorithms

Design and implement two algorithms: 1) Fast exponentiation: Implement a function pow(x, n) that returns a real number x raised to an integer exponent...

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

Implement BST vertical traversal and list conversion

Given the root of a binary search tree (BST): 1) Implement vertical order traversal: assign the root column 0, left child column −1, right child colum...

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

Design an O(1) recency-evicting cache

Design and implement a fixed-capacity in-memory cache that supports get(key) and put(key, value) in average O( 1) time. When capacity is exceeded, evi...

Coding & Algorithms
7
0
99 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
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

Explore more Meta Software Engineer interview questions

Real questions from candidate reports, grouped by topic.

Other Meta Software Engineer categories
Browse all