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...
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...
Implement an LRU cache
Implement a fixed-capacity key-value cache with least-recently-used eviction. Support the following operations: - get(key) -> value: return the value ...
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 ...
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...
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...
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...
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...
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...
Solve DFS grid and keypad problems
You may be asked to solve one or more DFS/backtracking problems: 1. Grid connectivity problem: Given an m x n grid where 1 represents land and 0 repre...
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...
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...
Generate uniform 0–6 from biased coin
You are given a function: - int getRandom01Biased() returns 0 with probability p and 1 with probability 1-p, where p is unknown and may be any value i...
Debug a PyTorch U-Net shape mismatch
You are given a PyTorch implementation of a U-Net-like segmentation model that should follow the original U-Net style with valid convolutions (no padd...
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 uniformly from a circle’s area
How would you generate a point (x, y) uniformly at random from the area of a circle of radius R centered at the origin? - Explain why naive choices (e...
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...
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...