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."
Find shortest word transformation with caching
Find shortest word transformation with caching You are given a start word and an end word of equal length, and a dictionary of valid words. In one mov...
Compute total covered interval length
Compute total covered interval length Given a list of integer intervals [l, r) (half-open), compute the total length covered by at least one interval....
Constant-Time Insert, Remove, and Uniform Random Sampling
A data-sampling service maintains a dynamically changing pool of integer example IDs. Examples are continuously added and retired, and the service mus...
Solve prefix, array, and string problems
This set of problems evaluates proficiency in string and array algorithm design—covering prefix search, subsequence matching, and maximal-area computa...
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...
Implement Multi-Head Attention from Scratch in NumPy
This coding question tests a machine learning engineer's understanding of Transformer internals by requiring a from-scratch NumPy implementation of mu...
Highest Average-Salary Team in an Org Chart
This question evaluates a candidate's ability to traverse tree-structured data and perform subtree aggregation, applying recursive or bottom-up DFS te...
Merge Overlapping Time Ranges
This question evaluates a candidate's ability to work with interval merging, a core array and sorting problem in technical interviews. It tests unders...
Hierarchical Access Control for an Advertising Platform
This question tests practical application of graph traversal and access control system design using a directed acyclic group hierarchy. It evaluates a...
Determine if all courses can be completed
This question evaluates graph-theoretic dependency modeling and cycle-detection competency, measuring the ability to represent course prerequisites as...
Check Whether a String Is Built by Repetition
This question evaluates string manipulation and pattern recognition skills, focusing on detection of repeated substring patterns, string periodicity, ...
Implement a Sparse Matrix Class
This question evaluates the ability to design and implement efficient sparse data structures and perform matrix operations, testing knowledge of spars...
Find Neighboring Records by Identifier
This question evaluates understanding of ordered data traversal and efficient lookup design, assessing competency with data structures, indexing and r...
Solve Decimal Coin Change
Given a list of coin denominations represented as decimal values and a target amount represented as a decimal value, return the minimum number of coin...
Count Good Subsequences With Equal Character Frequencies
A subsequence is formed by deleting zero or more characters from a string without changing the order of the remaining characters. A non-empty subseque...
Implement Streaming Word Counter
Implement a class that records word frequencies from a stream of text. The class should support the following operations: 1. add_text(text: str) -> No...
Find a Black-Box Convex Function Minimum
You are given access to a black-box function F(x): each call returns the function value at a real number x. You are also given a search interval [a, b...
Implement a Referral Revenue Tracker
Implement an in-memory revenue tracking system for customers in a referral network. Each customer has their own direct revenue. A customer may also ha...
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...
Design In-Memory QPS Counter
Implement an in-memory traffic counter. You need to support two operations for each logical key, such as an endpoint, customer, or service name: - rec...