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."
Implement a Web Crawler with BFS and DFS
Implement a simple web crawler in Python. You are given: - A starting URL. - A function get_links(url) -> list[str] that returns all outgoing links fr...
Maintain a Streaming Median
You are designing a component that receives integers one at a time and must return the current median after each update. Example: - After processing [...
Find shortest word transformation with caching
Find shortest word transformation with caching You are given a start word and an end word of equal length, and a dictionary of valid words. In one mov...
Implement k-th largest in a number stream
You are designing a small library to monitor statistics over a stream of integers. Implement a data structure that, given an integer k and an initial ...
Write a generator for substring pattern matches
Problem Write a generator that scans a string and emits a value whenever a substring matches a given pattern. Input - A string s - A string pattern (n...
Simulate Plant Infection Spread
Given an m x n grid representing farmland: - 0 = empty cell - 1 = healthy plant - 2 = infected plant - 3 = obstacle Every minute, each infected plant ...
Simulate Plant Infection With Controlled Burning
You are given an R by C grid of plants. Each plant is initially healthy, infected, recovered, or dead. A plant has up to four orthogonal neighbors. De...
Implement calculator and graph connectivity
Answer the following coding problems: 1. Implement an arithmetic expression evaluator. Given a string containing non-negative integers, spaces, +, -, ...
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...
Implement Distributed Matrix Multiplication
You are given a simplified distributed-computing setup that simulates communication between devices using Python threads and message queues. A helper ...
Find first non-repeating character
Given a string s, return the first character that appears exactly once in the string (i.e., the leftmost non-repeating character). - If no such charac...
Implement substring search and weighted sampling
Two coding questions were asked in the onsite. 1. Substring search: Given two strings text and pattern, return the starting index of the first occurre...
Find kth smallest in sorted matrix
Given an n x n matrix where each row and each column is sorted in nondecreasing order, and an integer k (1 ≤ k ≤ n^ 2), return the k-th smallest eleme...
Implement cocktail shaker sort and analyze
Implement the cocktail shaker sort (bidirectional bubble sort) for an array of integers. Optimize it with early termination and shrinking bounds, and ...
Assign bookings to minimum tennis courts
You are given a list of tennis court bookings. Each booking has a start time and an end time. Task Return an assignment plan that: 1. Assigns each boo...
Implement inventory allocation with backorders
Implement inventory allocation with backorders Design and implement a function to process an event stream for an e-commerce marketplace. Input: ( 1) i...
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...
Implement stack and interval algorithms with tests
Implement three coding tasks and design your own unit tests for each. 1) Validate Bracket String with a Stack - Input: a string s containing only '(',...
Find second-minimal word segmentation count
Find second-minimal word segmentation count Given a string s and a dictionary D of non-empty words, define a 'segmentation' as splitting s into a sequ...
Compute Minimum L-Moves on Infinite Grid
Compute Minimum L-Moves on Infinite Grid On an infinite 2D grid, a chess-like piece moves in L-shapes: from (x, y) it can go to (x±1, y± 2) or (x±2, y...