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."
Compute optimal matrix multiplication order
Given an array dims[0..n] where matrix i has dimensions dims[i-1] × dims[i] (for i = 1..n), compute the minimum number of scalar multiplications neede...
Solve stock and banana problems
Solve both coding problems below. 1. Maximum single-transaction stock profit: Given an array prices where prices[i] is the stock price on day i, retur...
Implement an extensible prefix tree
Implement a prefix tree (trie) supporting insert(word), search(word), startsWith(prefix), countPrefix(prefix), and erase(word). Optimize for time and ...
Solve stock-pattern trading and substring elimination
Part A — Stock trading by pattern signals: - Input: an integer array prices (length n) of daily stock prices; an array buyPattern and an array sellPat...
Solve prefix, array, and string problems
The interview included several coding problems: 1. First index matching a prefix: Given a sorted array of lowercase strings such as ["a", "apple", "ap...
Validate normalized palindromes with variants
Implement a function isNormalizedPalindrome(s) that returns true if s reads the same forward and backward after removing non‑alphanumeric characters a...
Implement sqrt and parity-based array rearrangement
You are given two independent coding tasks. --- Task 1: Implement Square Root Without Math Library Implement a function that computes the square root ...
Determine frog reachability across stones
You are given a sorted array of distinct integers stones representing stone positions in a river, where stones[0] = 0. A frog starts on stone 0; its f...
Determine and print expression to reach target
You are given four numbers and a target T (e.g., 24). Using +, −, ×, ÷ and parentheses, and using each number exactly once, determine whether you can ...
Check diagonal and compute window statistics
Question Given a square matrix, determine whether all elements on its main diagonal are identical. LeetCode 346. Moving Average from Data Stream – des...
Count subarrays summing to target
Question LeetCode 560. Subarray Sum Equals K – Given an integer array nums and an integer k, return the total number of continuous subarrays whose sum...
Check Whether a String Is Built by Repetition
Given a non-empty string s, determine whether it can be constructed by repeating one of its non-empty proper substrings two or more times. A proper su...
Find Minimum Processing Rate
You are given an array piles, where piles[i] is the number of items in the i-th pile, and an integer h representing the maximum number of hours availa...
Build Ranked Feed With Photo Batching
You are given a list of feed objects. Each object has: - id: a unique string - type: one of Normal, Video, or Photo - score: a numeric ranking score C...
Wrap Matching Substrings in Bold Tags
During a machine learning engineer phone screen, the coding task was: You are given a string text and a list of strings patterns. Return a new string ...
Track Expiring GPU Credits
Implement a GPU credit tracking system that processes time-stamped events arriving out of order. Operations: - add_credit(amount, start_time, duration...
Analyze sales with groupby
You are given three pandas DataFrames representing a food delivery marketplace: - orders(order_id, product_id, quantity, unit_price, status) - product...
Find Words Containing Other Words
Given a list of lowercase strings, return all words that contain at least one other distinct word from the same list as a contiguous substring. Exampl...
Optimize a Fifteen-Sum Card Strategy
You are given a simulator for a card game with 36 cards: ranks 1 through 9 in four suits. The table starts with 16 random cards. A move removes any 3 ...
Solve matrix rotation and 1-D illumination
Question LeetCode 48. Rotate Image – rotate an n×n matrix 90° clockwise (extra space allowed). Find the point(s) with the maximum number of illuminate...