Machine Learning Engineer Coding & Algorithms Interview Questions
Practice 300 real Coding & Algorithms interview questions for Machine Learning Engineer roles. From companies including Meta, OpenAI, Amazon, TikTok, Pinterest.

"I got asked a hardcore MCM DP question and I saw it on PracHub as well. Solved that question in 5 minutes. Without PracHub I doubt I could solve it in 5 hours. Though somehow didn't get hired, perhaps I guess I solved it too fast? /s"

"Believe me i'm a student here jn US. Recently interviewed for MSFT. They asked me exact question from PracHub. I saw it the night before and ignored it cause why waste time on random sites. I legit wanna go back and redo this whole thing if I had chance. Not saying will work for everyone but there is certainly some merit to that website. And i'm gonna use it in future prep from now on like lc tagged"

"10 years of experience but never worked at a top company. PracHub's senior-level questions helped me break into FAANG at 35. Age is just a number."

"I was skeptical about the 'real questions' claim, so I put it to the test. I searched for the exact question I got grilled on at my last Meta onsite... and it was right there. Word for word."

"Got a Google recruiter call on Monday, interview on Friday. Crammed PracHub for 4 days. Passed every round. This platform is a miracle worker."

"I've used LC, Glassdoor, and random Discords. Nothing comes close to the accuracy here. The questions are actually current — that's what got me. Felt like I had a cheat sheet during the interview."

"The solution quality is insane. It covers approach, edge cases, time complexity, follow-ups. Nothing else comes close."

"Legit the only resource you need. TC went from 180k -> 350k. Just memorize the top 50 for your target company and you're golden."

"PracHub Premium for one month cost me the price of two coffees a week. It landed me a $280K+ starting offer."

"Literally just signed a $600k offer. I only had 2 weeks to prep, so I focused entirely on the company-tagged lists here. If you're targeting L5+, don't overthink it."

"Coaches and bootcamp prep courses cost around $200-300 but PracHub Premium is actually less than a Netflix subscription. And it landed me a $178K offer."

"I honestly don't know how you guys gather so many real interview questions. It's almost scary. I walked into my Amazon loop and recognized 3 out of 4 problems from your database."

"Discovered PracHub 10 days before my interview. By day 5, I stopped being nervous. By interview day, I was actually excited to show what I knew."

"I recently cleared Uber interviews (strong hire in the design round) and all the questions were present in prachub."
"The search is what sold me. I typed in a really niche DP problem I got asked last year and it actually came up, full breakdown and everything. These guys are clearly updating it constantly."
Compute suffix sums over waypoints
Problem You are given a batch of 2D waypoint trajectories. - Input: points with shape [B, N, 2], where points[b][i] = (x, y) is the i-th waypoint for ...
Extend a Maze Solver
You are given an existing Python maze solver and a suite of unit tests. The maze is a 2D grid that uses # for walls, . for open cells, S for the start...
Maximize concatenation length with unique chars
Coding: Maximum-length unique-character string You are given an array of strings arr. You may choose any subset of these strings and concatenate them ...
Deep copy a linked list with random pointers
Problem You are given the head of a linked list where each node has: - val: integer value - next: pointer to the next node (or null) - random: pointer...
Find Banks From Identifier Mappings
Plaid receives institution metadata from multiple sources. You are given two mappings: 1. code_to_institution: a one-to-one mapping from a bank code t...
Solve two linked list/array tasks
You are given two independent coding tasks. Task 1: Remove the N-th node from the end of a singly linked list Given the head of a singly linked list a...
Sample uniformly from a circle’s area
How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin? - Explain why naive choices (e...
Build a concurrent site crawler
Implement a small crawler in Python for a single target website. Requirements: - Input: a start URL, a maximum crawl depth, and an output CSV path. - ...
Determine Reachability in Train Schedule
You are given a train schedule represented as a list of train routes. Each route is a list of station names, where the element at index t is the stati...
Find all quadruplets summing to target
Problem Given an integer array nums (length n) and an integer target, return all unique quadruplets [a,b,c,d] such that: - a + b + c + d == target - T...
Compute the next lexicographic permutation
Problem Given an integer array nums representing a permutation of its elements, modify the array in-place to produce the next lexicographically greate...

Implement multi-head attention and LLM sampling
Task A: Multi-head attention (forward pass) You are implementing a Transformer attention layer. Given: - A sequence length L and model dimension d_mod...
Find shortest path in a maze grid
Maze shortest path You are given a 2D grid maze of size m x n where: - 0 represents an open cell - 1 represents a wall (cannot pass) You are also give...
Solve a 9x9 Sudoku puzzle
Given a partially filled 9×9 Sudoku board, fill the empty cells so that the completed board is valid. A valid Sudoku satisfies: - Each row contains di...
Solve palindrome and list tasks
You are asked to solve two coding problems. 1. Build the shortest palindrome by prepending characters: Given a string s, add characters only to the fr...
Compute point-to-segment minimum distance
Problem Given a 2D point P(x, y) and a line segment with endpoints A(x1, y1) and B(x2, y2), compute the minimum Euclidean distance from point P to the...
Implement ordering with dependency constraints
You are given n items labeled 0..n−1 and a list of precedence constraints edges[i] = [u, v] meaning u must appear before v. Return a valid ordering of...
Implement an LRU cache
Implement a fixed-capacity key-value cache with least-recently-used eviction. Support the following operations: - get(key) -> value: return the value ...
Design a time-travel key-field store with TTL
Problem Implement an in-memory “database” that stores records by key and fields within each key. Each operation is given a timestamp (integer, non-dec...
Implement K-Means and Detect Divisible Subarrays
Solve both coding tasks. Part A: Implement K-Means Clustering Implement K-means clustering for a set of points. Given: - points: a list of n points, w...