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."
Solve linked list, tree, and grid problems
Problem A — Find cycle entry in a singly linked list You are given the head of a singly linked list. The list may contain a cycle. - Return the node w...
Implement SFT Sample Packing
This question evaluates proficiency in preprocessing for autoregressive language models, including deterministic sequence packing, construction of los...
Compute Roller Coaster Scores
This question evaluates proficiency in string parsing, floating-point arithmetic, conditional logic, and designing extensible rule-based scoring syste...
Find Minimum Compatible Version
This question evaluates binary search, monotonic predicates, careful version ordering, and cost-aware optimization of expensive compatibility checks. ...
Find K Nearest Points
This question evaluates proficiency with Euclidean distance metrics, selection algorithms, and efficient data structures for partial sorting, while re...
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...
Implement Sparse Matrix Operations
This question evaluates proficiency in sparse linear algebra, efficient algorithms, and data-structure design for numerical and machine learning workl...
Join Tables and Rank Users
You are given two analytics tables: - users(user_id, country, signup_date) - listening_events(event_id, user_id, played_at, minutes_played) Because th...
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 ...
Schedule Incremental Labeling Tasks
This question evaluates skills in designing stateful incremental schedulers, fairness and load-balancing algorithms, deterministic tie-breaking, and e...
Convert Samples into Event Intervals
This question evaluates understanding of array and sequence processing, run-length encoding concepts, and interval representation for time-ordered tra...
Implement a Referral Network
This question evaluates skills in modeling and manipulating directed acyclic graphs, implementing graph-based ranking metrics (reachability and flow c...
Implement Optimal Bucket Batching
You are given an array lengths of K document lengths and an integer G representing the number of available GPUs. A batch is assigned to one GPU, and e...
Design a Resumable Iterator with Checkpoint and Restore
Design a resumable iterator: an iterator that can serialize its current position into a compact, opaque checkpoint and later be reconstructed from tha...
Implement alert queries and spike detection
This question evaluates a candidate's skills in streaming data structures, time-windowed aggregation, in-memory analytics for high-throughput alert in...
Minimize exact layover bookings
This question evaluates algorithmic problem-solving and numeric precision handling, specifically the ability to model exact-duration sums and minimize...
Find Minimum Processing Rate
This question evaluates algorithmic problem-solving skills, discrete mathematics involving integer division and ceiling operations, and complexity ana...
Implement a Simplified DNS Resolver
This question evaluates understanding of DNS semantics (name normalization, A and CNAME records, alias chains and cycle detection), robust error handl...
Solve OA tasks on string, grid path, subarrays
This multi-part question evaluates string manipulation, constrained grid-path optimization with sequential expression evaluation, and counting of pari...
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...