Machine Learning Engineer Coding & Algorithms Interview Questions
Practice the exact questions companies are asking right now.

"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 using a provided API
Web Crawler (BFS) You are implementing a simple web crawler. Given - A starting URL startUrl. - A provided API: - List<String> getUrls(String url) w...
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 multi-head attention and LLM sampling
Task A: Multi-head attention (forward pass) You are implementing a Transformer attention layer. Given: - A sequence length L and model dimension d_mod...
Sample index from probability distribution
You are given a discrete probability distribution for an \(M\)-sided die as an array p[0..M-1], where each p[i] is non-negative. Design a function sam...
Minimize batches and allocate riders by time
Coding prompts (same interview round) 1) Minimum number of batches for time points You are given a list of event time points (integers), e.g. [1, 3, 5...
Can you reach target with distance-threshold edges?
You are given a set of unordered 2D points points[], a start point and an end point (both are included in points), and a function: `text getDistance(p...
Compute point-to-segment minimum distance
Problem Given a 2D point P(x, y) and a line segment with endpoints A(x1, y1) and B(x2, y2), compute the minimum Euclidean distance from point P to the...
Debug and optimize a card-drawing strategy
You are given a simplified card game engine with unit tests. The game is played using a table of face-up cards; each card has an integer value. On eac...
Implement an LRU Cache
Problem Design and implement an LRU (Least Recently Used) Cache that supports the following operations in O(1) average time: - get(key): - Return th...
Find shortest path in a maze grid
Maze shortest path You are given a 2D grid maze of size m x n where: - 0 represents an open cell - 1 represents a wall (cannot pass) You are also give...
Sample a string by real-valued scores
You are given: - A list of strings texts (e.g., user comments), length n. - A list of floating-point scores scores of length n, where each score can b...
Convert stack samples to execution trace
You are given sampling-profiler output: a list of Sample objects ordered by timestamp ascending. Each Sample has (t: float, stack: list[str]) where st...
Find a secret word using match feedback
You are given a list of unique words, each with the same length (e.g., 6 lowercase letters). One of these words is the secret. You can repeatedly make...
Choose K pickup locations minimizing L1 distance
Coding: K Shuttle Pickup Locations (L1) You are given the coordinates of N people on a 2D grid. You want to open K shuttle pickup locations (pickup po...
Maximize unique characters from a word list
Maximize Unique Characters From a Word List You are given a list of strings words. You may select any subset of these strings (each string used at mos...
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 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 earliest supporting version under constraints
You are given version strings formatted as {major}.{minor}.{patch}, e.g., "103.003.03". Each version either supports a feature or not. You may call is...
Find two numbers summing to target without hashmap
Problem Given an integer array nums (length n) and an integer target, return the indices (i, j) such that: - i != j - nums[i] + nums[j] == target You ...
Generate all hyperparameter combinations
You are given several groups of hyperparameter choices for an ML experiment. Each group contains one hyperparameter name and a list of candidate value...