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."
Simulate Infection Spread on a Grid
You are given an m x n grid representing cells in a population. Each day, all state changes happen simultaneously. Infection neighbors are the 8 surro...
Implement Layer History and Grid Counting
The coding portion of this loop covered two independent tasks. Implement each cleanly, handle the edge cases, and analyze the time and space complexit...
Implement Multi-Head Attention from Scratch in NumPy
Implement multi-head scaled dot-product attention from scratch using only NumPy. This is the core building block of a Transformer block, and you must ...
Simulate Monster Team Battles
Design and implement a battle simulator. Data model: - Team: a team name and an ordered list of monsters. - Monster: a monster name, a type, current h...
Streaming Entropy with Numerical Stability
Streaming Entropy with Numerical Stability You are processing a very large, possibly unbounded, stream of category labels (for example, token IDs emit...
Solve OA tasks on string, grid path, subarrays
You are given three independent coding tasks. Task 1: Reverse the middle if ends are vowels Given a string s (ASCII letters), if both the first and la...
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 a Referral Network
Implement a referral network in three parts. You are building an in-memory model of a directed referral graph. An edge A -> B means user A referred us...
Implement a Simplified DNS Resolver
Implement a simplified DNS resolver in Python. You are given an in-memory DNS zone and must complete a small resolver step by step. The goal is not to...
Solve Expression and Tree-List Problems
The coding portion included two algorithm problems: 1. Generate expressions with left-to-right evaluation Given a string num containing only di...
Implement a simplified memcached server
Implement a simplified in-memory key-value store that speaks a small text protocol inspired by memcached. The server stores keys and raw byte values i...
Hierarchical Access Control for an Advertising Platform
Design an access-control system for an advertising platform. Advertisers are organized into a hierarchy of groups. A group may contain other groups (s...
Solve meeting scheduling and robot cleaning tasks
You are given two independent coding problems. --- Problem 1: Prioritized Meeting Scheduling You are asked to schedule meetings in a single meeting ro...
Implement stack variants and path-sum check
Coding tasks Solve the following algorithmic problems. 1) MinStack Design a stack supporting: - push(x), pop(), top() - getMin() returning the minimum...
Maximize sum with no adjacent elements
Given an array of non-negative integers nums, choose a subset of elements such that no two chosen elements are adjacent in the original array. Return ...
Solve Seven Python Image and Data Tasks
You are given a Python 3 online assessment with seven independent coding tasks. For each task, implement a function named solution with the specified ...
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...
Implement a Spreadsheet With Formulas
Design and implement a small spreadsheet engine. Part 1: Basic cells Implement a Spreadsheet class that supports: - set_cell(cell_id, value): set a ce...
Implement 2D convolution forward pass
Problem Implement the forward pass of a 2D convolution (conv2d) from scratch (no deep learning libraries). You are given: - Input tensor x with shape ...
Implement Top-p (Nucleus) Sampling in NumPy
Implement top-p (nucleus) sampling for next-token selection in a language model, using only NumPy. Given a vector of raw logits over a vocabulary, top...