Machine Learning Engineer Coding & Algorithms Interview Questions
Practice 316 real Coding & Algorithms interview questions for Machine Learning Engineer roles. From companies including Meta, Amazon, OpenAI, 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."
Debug and optimize a card-drawing strategy
This question evaluates debugging and implementation skills, combinatorial search and optimization, and the ability to design and interpret simulation...
Simulate Grid Infection
This question evaluates skills in multi-source breadth-first search, synchronous simulation updates, boundary handling, and off-by-one correctness wit...
Level-Ordered Dependency Build Order
This question evaluates a candidate's ability to model dependency relationships as a graph and produce a valid topological build order. It tests knowl...
Implement K-means clustering from scratch
This question evaluates a candidate's understanding of clustering algorithms and practical implementation skills in unsupervised machine learning, inc...
Simulate Infection Spread on a Grid
This question evaluates the ability to implement and reason about discrete-time, grid-based simulations with multi-state cells and neighbor-dependent ...
Compute time to infect all cells
You are given an n × m grid representing people in a city. - Each cell is either infected (1) or healthy (0). - Two cells are neighbors if they share ...
Implement Top-p (Nucleus) Sampling in NumPy
This coding question tests practical implementation of top-p (nucleus) sampling, a core decoding strategy in large language models. It evaluates NumPy...
Implement substring search and weighted sampling
This question evaluates algorithm design and analysis skills across string processing (efficient substring search) and randomized/data-structure techn...
Complete decision tree and gradient descent functions
You are given partially implemented code and must complete key functions. Implement the missing parts with correct logic and reasonable efficiency. Ta...
Validate Nested Configuration Objects
You are given a set of custom descriptor objects that define the expected schema of a configuration object. Implement a validator that checks whether ...
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. - ...
Compute point-to-segment minimum distance
This question evaluates understanding of computational geometry and numerical robustness, testing the ability to compute Euclidean distances between a...
Convert stack samples to execution trace
You are given sampling-profiler output: a list of Sample objects ordered by timestamp ascending. Each Sample has (t: float, stack: list[str]) where st...
Track Expiring GPU Credits
This question evaluates event-replay and time-window accounting skills, including temporal data structures, priority-based consumption, out-of-order e...
Simulate Turn-Based Monster Battles
This question evaluates the ability to implement a turn-based battle simulation with correct state management, turn semantics, knockout handling, dama...
Solve five hard algorithm problems
This set of problems evaluates algorithm design and problem-solving skills across array manipulation, range-update techniques, load-balancing and part...
Implement Distributed Matrix Multiplication
This question evaluates distributed systems and parallel algorithm skills, specifically distributed matrix multiplication, data partitioning (row- and...
Streaming Entropy with Numerical Stability
This question tests a candidate's ability to implement numerically stable online algorithms for computing Shannon entropy over streaming data. It eval...
Find Maximum Unique-Character Subset
This question evaluates algorithm design and combinatorial optimization skills, specifically the ability to model disjoint-character constraints, hand...
Extend a Maze Solver
This question evaluates competence in graph search and state-space modeling, specifically BFS-based pathfinding, constrained traversal rules (directio...