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."
Solve frequency and tree-completeness problems
Problem A: Return the k most frequent values You are given an integer array nums and an integer k. Task: Return the k distinct values that occur most ...
Compute time to infect all cells
You are given an n × m grid representing people in a city. - Each cell is either infected (1) or healthy (0). - Two cells are neighbors if they share ...
Implement a resumable data loader
Problem: Resumable DataLoader You are implementing a mini data-loading component for model training. Design a ResumableDataLoader that iterates over a...
Implement alert queries and spike detection
You are building an in-memory alert analytics component. Each alert has: - timestamp (integer seconds since epoch) - severity (one of a small fixed se...
Find Minimum Compatible Version
You are given a list of software versions sorted in ascending numeric order and an expensive predicate is_compatible(version). Return the minimum vers...
Simulate Turn-Based Monster Battles
Simulate a turn-based battle between two teams of monsters. Base problem: - Team A and Team B are ordered lists of monsters. - Each monster has at lea...
Schedule Incremental Labeling Tasks
You are building a data-labeling platform. Each day, a batch of task IDs arrives. A task ID may reappear on later days because the platform may reques...
Maximize Unique Letters
Given a list of lowercase words, choose any subset of words such that: - no selected word contains a repeated character internally, and - no character...
Build Friend Recommendations
You are given a social graph and a User class that stores a user id and the set of direct friends for each user. Complete a recommendation module with...
Find longest palindromic substring
Given a string s, return the longest contiguous substring of s that is a palindrome. Input - A single string s. Output - A string representing the lon...
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...
Find shortest transformation steps in a word graph
You are given two strings begin and end of the same length, and a list words of distinct strings (also same length). You can transform one string into...
Implement K-means and solve interval/frequency tasks
Task 1 — Describe/implement K-means clustering Given: - A data matrix X with shape (n_samples, d). - An integer k (number of clusters). Explain (or wr...
Compute winning probability on 1D dice walk
You are on an infinite 1D number line starting at position 0. Repeatedly roll a fair die that returns an integer uniformly at random from 1 to K (incl...
Implement a Sparse Matrix Class
Implement a SparseMatrix class for matrices that contain mostly zero values. Your class should support the following operations: 1. Construction and s...
Implement rotating homepage title selector
Implement an in-memory service that chooses which movie or show title to display on a user's homepage billboard. Each title has a relevance score for ...
Design LFU cache with distributed extension
Problem You are asked to design and implement a data structure that behaves like an in-memory cache with a Least Frequently Used (LFU) eviction policy...
Build a Friend Recommender
You are given a simple social-graph codebase where each user has only an id and a collection of current friends. Starting from existing functions and ...
Solve Merge Lists and Vertical Traversal
Two coding tasks were mentioned for a 40-minute round: 1. Merge multiple sorted linked lists: You are given an array of k singly linked lists, where e...
Solve Three Algorithmic Problems
Three coding questions were mentioned: 1. Second-largest distinct permutation Given an array of integers that may contain duplicates, consider all ...