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 array merge, tree view, and maze tasks
Solve the following coding tasks. 1) Merge two sorted arrays in-place You are given two integer arrays A and B, each sorted in non-decreasing order. -...
Implement recent-requests counter
You are designing an in-memory component for a web service that needs to track how many requests ("hits") it has received in the last 5 minutes. Imple...
Find shortest path in a grid with obstacles
You are given a 2D grid of size m x n representing a maze. Each cell in the grid is either empty (0) or blocked (1). You are also given two coordinate...
Implement URL Shortening Codec
Implement a small in-memory URL-shortening component in a pair-programming interview. Expose two methods: shorten(long_url: str) -> str, which returns...
Search a word in a grid
Given a 2D grid of characters and a target word, determine if the word can be traced by moving up, down, left, or right, using each cell at most once....
Implement binary search lower/upper bounds
Question Given a non-decreasing sorted integer array nums of length n and a target value, implement two functions using binary search: 1. lower_bound(...
Implement and use a version comparator
Implement and use a version comparator You are given up to 100,000 version-like identifiers (e.g., "1.0", "01.2.0", "2.0.0-alpha", "1.10.3"). Implemen...
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 ...
Find length of longest common subsequence
Given two strings s and t, return the length of their longest common subsequence. A subsequence is obtained by deleting zero or more characters withou...
Find the Smallest String After One Decrement
You are given a string s consisting only of lowercase English letters. You must perform exactly one operation: 1. Choose one non-empty contiguous subs...
Implement LRU cache and copy random list
Coding questions (two parts) Part A — Deep copy a linked list with random pointers You are given the head of a singly linked list where each node has:...
Determine if chasing points will meet
You are given N points in 2D, indexed 0..N-1, forming a cycle. - At time t = 0, point i is at coordinates (xi, yi). - All points move simultaneously a...
Find and count target-sum subarrays
Find and count target-sum subarrays Given an integer array nums and an integer target, implement: ( 1) a function that returns true if any non-empty c...
Implement cluster status tracker
Implement a cluster status tracker. Design a class with methods: update(nodeId, status, timestamp) to record node status updates that may arrive out o...
Determine if a string can be segmented
Given a string s and a list of strings wordDict, determine whether s can be segmented into a sequence of one or more dictionary words. - You may reuse...
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...
Compute Roller Coaster Scores
You are given a list of roller coaster descriptions. Each description is a string in the format: <CoasterType> <MaxSpeed> <BumpsPerSecond> <LiftType> ...
Detect stop tokens during streaming inference
Problem: Stop-token / stop-sequence detection in streaming generation During LLM inference you receive tokens incrementally (streaming). Implement log...
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 K-means clustering from scratch
Task: Implement K-means clustering (from scratch) Write a function to perform K-means clustering on a set of points. Input - A dataset X with shape (n...