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."
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...
Implement trie-based autocomplete
Problem Design an autocomplete data structure using a trie. You must support: 1. insert(word: string) -> void 2. search(word: string) -> bool (exact m...
Write SQL to rank top products per category
You are given two tables: products - product_id (int, primary key) - category (string) order_items - order_id (int) - product_id (int) - quantity (int...
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...
Find a String Containing Another
Given a list of strings, determine whether any string in the list contains another string from the same list as a contiguous substring. Return one str...
Check if adding edge creates cycle in digraph
You work with a system that stores items and directed relationships between them (for example, item A points to item B). The relationships form a dire...
Design room progression with leaderboard
Design a data structure to simulate a sequence of rooms where players solve tasks and can move only to the next room once finished. Support the follow...
Compute minutes since last train departure
You are given a daily train timetable as a list of departure times (24-hour format HH:MM). Given the current time (also HH:MM), find the most recent d...
Minimize exact layover bookings
You are given a layover length X in hours and a list of available experience durations, where every value has exactly one decimal place. You want to s...
Solve shipping capacity and expression insertion
Problem A: Minimum shipping capacity You are given an array weights where weights[i] is the weight of the i-th package. Packages must be shipped in or...
Solve Four Coding Assessment Tasks
Complete the following four independent coding tasks. 1. Find the day a cumulative visit target is reached You are given an array visits, where visits...
Implement SFT Sample Packing
Implement a preprocessing function for supervised fine-tuning data for an autoregressive language model. You are given a list of tokenized training sa...
Implement BST Iterator and Ticket Queue
The coding interviews mentioned two algorithm/data-structure tasks: 1. Implement a binary search tree iterator. You are given the root of a binar...
Solve Two String Problems
The interview included two coding questions: 1. Exactly one edit apart Given two strings s and t, determine whether they are exactly one edit apart...
Compute moving average over last N stream
You are given an integer N and an unbounded stream of integers arriving one by one. After each new integer arrives, output the average of the last N i...
Count People Reaching the Boundary
You are given a 1-dimensional line segment with a right boundary at position L. There are N people with initial positions p1, p2, ..., pN, and there i...
Design O(1) random-sampling set
Design a data structure that supports insert(x), remove(x), and get_random() that returns a uniformly random element among the present items, all in e...
Find target using robot movement API
You control a robot in an unknown 2D grid. The grid layout and boundaries are unknown, and you cannot access the map directly. Some cells are blocked ...
Design an Editable Text Buffer
The interview question was asked in three progressive stages. Design an in-memory text editor. 1. Basic text buffer Implement a data structure that ...
Solve frequency and tree-completeness problems
Problem A: Return the k most frequent values You are given an integer array nums and an integer k. Task: Return the k distinct values that occur most ...