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."
Implement an LRU cache
This question evaluates competency in designing efficient key-value caching mechanisms, enforcing capacity constraints and eviction policies while mai...
Can you reach target with distance-threshold edges?
You are given a set of unordered 2D points points[], a start point and an end point (both are included in points), and a function: `text getDistance(p...
Implement K-Means and Explain Convergence
Implement K-means clustering in Python and explain convergence. Covers assignment and update steps, stopping criteria, empty clusters, objective funct...
Generate uniform 0–6 from biased coin
You are given a function: - int getRandom01Biased() returns 0 with probability p and 1 with probability 1-p, where p is unknown and may be any value i...
Simulate robot moves on a grid
You are given an m x n grid and a robot that starts at position (r, c) (0-indexed). You are also given a string commands consisting of characters 'U',...
Solve four OA string/array/matrix/graph tasks
This multi-part prompt evaluates proficiency in core programming competencies: string parsing and character classification, simulation/greedy processi...
Solve frequency and tree-completeness problems
These two problems evaluate competency in frequency counting and selection algorithms for identifying top-k elements and in binary tree structure anal...
Compute the next lexicographic permutation
This question evaluates understanding of permutations and lexicographic ordering, in-place array manipulation, and algorithmic reasoning about time an...
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 ...
Implement weighted random sampling with preprocessing
This question evaluates algorithm design and probabilistic reasoning for weighted random sampling, including data-structure preprocessing, time-space ...
Detect stop tokens during streaming inference
This question evaluates streaming sequence-detection and pattern-matching skills, including online buffer management and correct handling of overlappi...
Solve Two Sorted-Array Tasks
This question evaluates competency in array manipulation, handling of sorted data, search techniques and algorithmic complexity analysis, focusing on ...
Maintain a Streaming Median
You are designing a component that receives integers one at a time and must return the current median after each update. Example: - After processing [...
Find pairs with the minimum absolute difference
Given an integer array (not necessarily sorted), find the minimum absolute difference between any two distinct elements. Return all pairs of values th...
Implement K-means clustering from scratch
This question evaluates competency in clustering algorithms, numerical computation, and practical algorithm implementation, focusing on core K-means c...
Maximize Unique Letters
This question evaluates proficiency in combinatorial optimization, bit manipulation, and state-compression techniques for selecting subsets under uniq...
Delete a Character From Cover
This question evaluates proficiency in string manipulation, interval arithmetic, and data-structure updates with attention to index mapping and edge-c...
Implement a Capacity-Bounded Cache
This question evaluates a candidate's ability to design and implement an efficient capacity-bounded in-memory key-value cache, assessing understanding...
Construct connected crop layout and safe paths
This question evaluates constructive grid design and graph-based pathfinding skills, specifically the ability to produce connected labeled regions tha...
Find the First Working Version
This question evaluates understanding of search algorithms, version normalization, and monotonic predicates, along with competency in parsing and orde...