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."
Return Every Index Pair Whose Values Sum to a Target
Return Every Index Pair Whose Values Sum to a Target Problem Implement all_pairs_sum(nums, target). Given an unordered array of integers, return every...
Reverse a Linked List in Groups of K
Implement reverse_k_group(values, k) for a singly linked list represented by the array values in traversal order. Reverse every consecutive group of e...
Process Operations for an In-Memory Key-Value Store
Process Operations for an In-Memory Key-Value Store Implement an in-memory key-value store that supports adding or replacing a value, deleting a key, ...
Implement an interactive CLI class with tests
Design and implement a command-line interactive application as a single class using OOP principles. The program should support commands: add <key> <va...
Design a robot movement command system
Robot Movement (Pair Programming) You are given an empty starter repository (only a README). Implement a small, testable robot movement module that ca...
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...
Implement a Stateful Search Autocomplete Session
Implement a Stateful Search Autocomplete Session Build an autocomplete engine from historical sentences and their usage counts. While a user types a s...
Implement Autoregressive Decoding Strategies
This question evaluates proficiency with autoregressive sequence generation, probabilistic sampling methods (greedy, top-k, top-p), softmax-based prob...
Implement local maxima, bagging, and k-means
This set of tasks evaluates algorithmic problem-solving and implementation skills across array processing (local maxima), ensemble methods (bagging cl...
Sample uniformly from a circle’s area
How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin? - Explain why naive choices (e...
Minimum Canisters to Top Up an Exact Target
This question evaluates a candidate's grasp of dynamic programming, specifically the unbounded knapsack (coin change) pattern for finding the minimum ...
First Word Matching Each Prefix Query
This question evaluates a candidate's grasp of string data structures and efficient prefix-matching techniques, core competencies in coding and algori...
Code Editor with Block Shrink and Expand (Code Folding)
Implement the core of a code editor (similar to VS Code) that supports code folding: collapsing ("shrink") and restoring ("expand") indentation-based ...
Implement local maxima, bagging, and k-means
This question evaluates skills in algorithm implementation and machine learning fundamentals—specifically streaming local maxima detection, bootstrap ...
Solve a 9x9 Sudoku puzzle
Given a partially filled 9×9 Sudoku board, fill the empty cells so that the completed board is valid. A valid Sudoku satisfies: - Each row contains di...
Implement common neural network layers in PyTorch
Implement the following neural-network building blocks from scratch in PyTorch (using only basic tensor ops such as matmul, sum, mean, var, exp, max, ...
Infer the Smallest Valid Character Order from Sorted Password Hints
Infer the Smallest Valid Character Order from Sorted Password Hints You are given password hints already sorted according to an unknown alphabet. Infe...
Find a secret word using match feedback
This question evaluates algorithmic problem-solving, combinatorial reasoning, and information-theoretic search strategies for narrowing a secret from ...
Search Monster Battle Strategies
This question evaluates algorithmic problem-solving around deterministic simulation and state-space exploration, focusing on handling transient state ...
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...