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 string-based rounding without floats
Coding You are not allowed to parse the input into a built-in floating type (to avoid overflow and precision issues). Work directly on strings. 1) Imp...
Implement a Capacity-Bounded Cache
Implement an in-memory key-value cache with a fixed capacity. The cache must support the following operations in constant time on average: - get(key):...
Maximize sum of non-adjacent values
Problem You are given an integer array nums representing the amount of money available at each house along a street. If you take money from house i, y...
Find Maximum Unique-Character Subset
Given a list of words, choose a subset such that no character appears more than once across the entire chosen subset. Return one optimal subset, not j...
Compute a moving average on a stream
Design a data structure to compute the moving average over the last N values from a stream. Input/Operations - Initialize with an integer window size ...
Generate all safe queen placements on board
You are given an integer n representing the size of a chessboard (n × n). You need to place n queens on the board so that no two queens attack each ot...
Solve Tree Views, Columns, and Calculator
The interview note referenced three separate coding tasks. Solve each task independently. Task 1: Binary tree side views Given the root of a binary tr...
Debug and optimize a card-drawing strategy
You are given a simplified card game engine with unit tests. The game is played using a table of face-up cards; each card has an integer value. On eac...
Implement K-Means and compare with GMM
Implement K-Means clustering from scratch for a dataset X of shape (n_samples, n_features) and a target number of clusters k. Your implementation shou...
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...
Find First Local Minimum
Given an integer array nums, find the index of the first local minimum. A local minimum is an element that is smaller than its immediate neighbors: - ...
Find Windows Containing a Target
You are given a list of windows, where each window is represented as an inclusive integer interval [start, end], and an integer target. Return all win...
Rotate matrix and find max lamp coverage
1) Square-matrix rotation with extra space: Given an n x n integer matrix, return a new matrix that is the 90-degree clockwise rotation of the input. ...
Extend counter to per-client rate limiting
You are extending the recent-requests counter to support per-client rate limiting. Each request now includes a clientId identifying the caller. You mu...
Implement solutions to several coding tasks
You are given several independent coding interview tasks. Solve each with the required time/space complexity. Problem 1: Find the minimum in a rotated...
Implement Depth-First Search Traversal
Given a graph represented as an adjacency list and a starting node, write a depth-first search function that returns the nodes visited in DFS order. Y...
Find K Nearest Points
Given an array of 2D points points, where points[i] = [x_i, y_i], and an integer k, return any k points whose Euclidean distance to the origin (0, 0) ...
Find Maximum Path Sum in N-ary Tree
You are given the root of an N-ary tree. Each node contains an integer value and a list of zero or more children. A path is a sequence of nodes where ...
Return all root-to-leaf tree paths
Given the root of a binary tree, return all root-to-leaf paths. - A leaf is a node with no children. - A path should be represented as a string with n...
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 ...