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 the Smallest String After One Decrement
You are given a string s consisting only of lowercase English letters. You must perform exactly one operation: 1. Choose one non-empty contiguous subs...
Implement a Spreadsheet With Formulas
This question evaluates understanding of data structures and algorithms for dependency management, expression parsing and evaluation, and detection of...
Write pseudocode for a ReAct-style loop
Coding prompt (pseudocode) Write pseudocode (does not need to compile) for a ReAct-style agent loop that alternates between reasoning and actions. Req...
Implement a simplified memcached server
This question evaluates a candidate's ability to implement a TCP-based in-memory key-value store, exercising skills in network I/O, protocol parsing, ...
Simulate Plant Infection Spread
This question evaluates graph traversal and grid-based simulation skills, including modeling a 2D grid as a graph, propagation dynamics with obstacles...
Solve several streaming, DAG, and DP tasks
This multi-part question evaluates proficiency in streaming and online algorithms, DAG-based scheduling and parallelism reasoning, and constrained dyn...

Implement multi-head attention and LLM sampling
This question evaluates implementation and conceptual understanding of Transformer multi-head scaled dot-product attention and next-token sampling for...
Implement a web crawler using a provided API
This question evaluates understanding of web crawling mechanics, URL/hostname filtering, graph traversal concepts, and concurrent fetching, assessing ...
Solve Seven Python Image and Data Tasks
This multi-part Python assessment evaluates image and data processing competencies including array and matrix manipulation (center crop, rotation), nu...
Maximize grid-path expression and count sawtooth subarrays
Problem 1: Maximize a valid expression along a grid path You are given an m x n grid grid. Each cell contains either: - an operator: '+' or '-', or - ...
Build Friend Recommendations
This question evaluates proficiency with graph data structures, set operations, uniform random sampling, counting mutual connections, and deterministi...
Simulate bubble elimination and maximize common prefix
You are given two independent coding tasks (as in a multi-question OA). Solve each. Task A — Grid “bubble/candy” elimination simulation You are given ...
Find Top K Largest Elements
This question evaluates a candidate's skill in algorithmic selection and data-structure usage for extracting top-k elements from large arrays, emphasi...
Implement Layer History and Grid Counting
This question evaluates a candidate's proficiency in mutable state management and reversible operations through implementing an undo/redo layer editor...
Simulate Monster Team Battles
This question evaluates a candidate's ability to model stateful simulations and implement deterministic battle mechanics with clean data structures an...
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...
Determine if chasing points will meet
You are given N points in 2D, indexed 0..N-1, forming a cycle. - At time t = 0, point i is at coordinates (xi, yi). - All points move simultaneously a...
Implement PyTorch training loop
Implement a basic PyTorch training loop You are given a PyTorch neural network model, a DataLoader that yields (inputs, targets) batches, an optimizer...
Differentiate virtual and pure virtual functions
Differentiate virtual and pure virtual functions In C++, what is the difference between a virtual function and a pure virtual function? Provide syntax...
Debug Tensor Conversion Bugs
You are given a small tensor utility library used in distributed numerical code. The implementation has several bugs related to aliasing, array conver...