Meta Machine Learning Engineer Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Demonstrate leadership and ensure data compliance
Behavioral & Leadership: Leading Through Reorg While Shipping ML + Ensuring Data Compliance Context You are the ML lead during a reorganization that r...
Design a recommendation system
System Design: Large-Scale Home-Feed Recommendation System Problem Design a large-scale recommendation system for a consumer app's home feed. Describe...
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...
Describe handling intense time pressure
Behavioral & Leadership (Onsite): Thriving Under Time Pressure and Multitasking Prompt Tell me about a time you had to deliver high‑quality work under...
Implement bounds, minimum, pathfinding, and moving average
Solve the following data-structures problems: ( 1) Given two sorted integer lists A and B, merge them into a single non-decreasing array. Then, for a ...
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...
Merge two sorted arrays in-place
You are given two nondecreasing arrays A and B, where A has enough trailing empty slots to hold all elements of B. Merge B into A in-place so that A r...
Maximize one stock trade profit
You're given an array prices of length n where prices[i] is the stock price on day i. You may complete at most one transaction (buy once, then sell la...
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...
Detect cycles and order with DFS
You are given a directed graph of package dependencies represented as an adjacency list: Map<String, List<String>> deps where deps[p] lists packages t...
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...
Design scalable media storage and delivery
System Design: Global UGC Photos and Short Videos Store/Delivery Context Design a globally distributed system to store and deliver user-generated phot...
Return k smallest elements using heap
Given an unsorted array nums of up to 1,000,000 integers and an integer k (1 <= k <= nums.length), return the k smallest elements in ascending order. ...
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...
Generate unique permutations with duplicates
Given an array of integers that may contain duplicates, generate all unique permutations. Ensure no duplicate permutations are returned even if some v...
Implement exponentiation and link tree neighbors
Solve two independent tasks. Task A — Fast exponentiation: Implement fastExponent(x, n) that returns x raised to the integer power n, where x is a dou...
Design nearby place recommendations
Real‑Time Nearby Places Recommendation System Context Design a mobile feature that recommends nearby places (e.g., restaurants, shops, attractions) to...
Design a scalable MoE pretraining pipeline
Design a Large-Scale MoE Pretraining Pipeline (Bilingual LLM, 1T Tokens, 256×A100-80GB) Context You are designing a pretraining pipeline for a decoder...
Architect an asynchronous RL post-training system
System Design: Asynchronous RLHF/RLAIF Post-Training for a Production Chat LLM Context You operate a chat LLM that already serves real user traffic. Y...
Solve matrix components, median, and traversals
1) Binary matrix component: Given an m x n grid of 0s (background) and 1s (objects), return the size of the largest connected component where connecti...