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."
Debug a PyTorch U-Net shape mismatch
You are given a PyTorch implementation of a U-Net-like segmentation model that should follow the original U-Net style with valid convolutions (no padd...
Determine if all courses can be completed
You are building a planner for a training program with n courses labeled 0 through n - 1. You are given a list of prerequisite pairs prerequisites, wh...
Implement an LRU Cache
Problem Design and implement an LRU (Least Recently Used) Cache that supports the following operations in O(1) average time: - get(key): - Return th...
Merge overlapping weekly time intervals
You are given a list of time intervals representing meetings. Each interval is a pair of strings in the format: - "<Day> <H>:<MM>" (24-hour time) - <D...
Find Earliest Train Route
You are given a discrete train timetable and need to find a valid route through the train network. Each train has an itinerary represented as a sequen...
Insert parentheses to minimize expression value
You are given a string expression of the form A+B, where A and B are non-empty strings of digits (no digit is '0'). You must insert exactly one pair o...
Generate all hyperparameter combinations
You are given several groups of hyperparameter choices for an ML experiment. Each group contains one hyperparameter name and a list of candidate value...
Implement a Fixed-Capacity Deque
Design and implement a fixed-capacity double-ended queue. The data structure is initialized with an integer capacity k and must support the following ...
Delete a Character From Cover
You are given a source string book and a cipher represented by a list of inclusive index intervals cover = [(l1, r1), ..., (lm, rm)]. The decoded ciph...
Find the Most Frequent Log Call
You are given a sequence of application log entries. Each entry contains the name of a function or API call made by the system. Write a function that ...
First Word Matching Each Prefix Query
You are given a list of words (the dictionary) and a list of queries, where each query is a string prefix. For each query, return the index (0-based, ...
Implement permutations and image retrieval
The coding portion included several short exercises for a vision-focused ML role: 1. Given an array of distinct integers, return all possible permutat...
Find Neighboring Records by Identifier
You are given an ordered list of records. Each record is a dictionary-like object with a unique string field called id and any number of additional at...
Convert State Stream to Events
You are given an array states where states[i] is the categorical output of a monitoring function at timestamp i. Consecutive equal values belong to th...
Solve several streaming, DAG, and DP tasks
You were asked multiple algorithmic questions. 1) Streaming longest subarray with average S You receive an infinite stream of integers (can be positiv...
Support updates and count target-sum pairs
You are given two integer arrays: - A (fixed / primary) - B (modifiable / secondary) You must process a sequence of operations of two types: 1. Update...
Find a secret word using match feedback
You are given a list of unique words, each with the same length (e.g., 6 lowercase letters). One of these words is the secret. You can repeatedly make...
Find target-heavy sliding windows
Given an integer array nums, an integer target, and a fixed window size k, solve the following two tasks: 1. Return all contiguous subarrays of length...
Implement Rate-Limited Wikipedia Crawler
Implement a rate-limited Wikipedia crawler. You may use an AI coding assistant during the interview, such as Cursor or Claude Code. You are expected t...
Implement decoder-only GPT-style transformer
Goal Implement a simplified decoder-only Transformer language model (similar in spirit to GPT) for next-token prediction. The implementation should be...