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 city skyline silhouette
Compute city skyline silhouette Compute the outer silhouette of a 2D skyline. You are given n axis-aligned rectangular buildings; each building i is (...
Count connected delivery zones
Given an m x n grid representing a service area, each cell is either 'Z' (deliverable zone) or '#' (blocked). Two 'Z' cells belong to the same zone if...
Count decodings of a numeric string
Given a string s of digits representing an encoded message where '1' maps to 'A', ..., '26' maps to 'Z', and '0' cannot appear alone (it must be part ...
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...
Validate palindrome with constraints
Given a string s, return true if s reads the same forward and backward after removing all non-alphanumeric characters and ignoring letter case. Implem...
Implement placeholder-based pattern matcher
Implement placeholder-based pattern matcher You are given: 1. A string s that may contain placeholders delimited by the % character. 2. A dictionary d...
Find max min-plus-max over all subarrays
Find max min-plus-max over all subarrays You are given an array arr of n integers. A subarray is a contiguous non-empty segment of the array. For any ...
Infer Generic Return Types
Build a small type-inference engine for a toy language. Do not parse raw strings; the input is already constructed as Python objects. Type model: - Pr...
Implement a Transformer Block with SwiGLU
Implement a Transformer-style neural network block in Python using either NumPy or PyTorch. Your implementation should include: 1. Multi-head self-att...
Solve five hard algorithm problems
The coding rounds covered the following algorithmic problems: 1. Transform one array into another using range +1/-1 operations You are given two ...
Find Shortest Clear Grid Path
Given an n x n binary grid, where 0 means open and 1 means blocked, return the length of the shortest clear path from the top-left cell to the bottom-...
Implement K-Means and Explain Convergence
Implement the K-means clustering algorithm for points in Euclidean space. Your implementation should: - take a dataset of points and a target number o...
Compute inverse-depth weighted sum of a nested list
Problem You are given a nested list of integers, where each element is either: - an integer, or - a list that follows the same rule (i.e., a nested li...
Find nearest room; extend to two users
You are given an m×n grid where 1 is a wall (impassable), 0 is an empty cell, and 2 is a meeting room. From a starting coordinate [r, c], you may move...
Implement TF-IDF scoring for documents
Problem Implement a simplified TF–IDF scorer. You are given: - A list of documents docs, where each document is a string. - A query string q. Tokeniza...
Implement weighted random city and sparse dot product
Question 1: Weighted random city picker You are given a mapping from city → population (all populations are positive integers). Implement a random gen...
Compute nested depth sum and grid distance
Problem A: Weighted sum of integers in a nested list You are given a nested list structure that may contain integers or other nested lists. Define the...
Differentiate virtual and pure virtual functions
Differentiate virtual and pure virtual functions In C++, what is the difference between a virtual function and a pure virtual function? Provide syntax...
Sample a string by real-valued scores
You are given: - A list of strings texts (e.g., user comments), length n. - A list of floating-point scores scores of length n, where each score can b...
Solve DFS grid and keypad problems
You may be asked to solve one or more DFS/backtracking problems: 1. Grid connectivity problem: Given an m x n grid where 1 represents land and 0 repre...