Machine Learning Engineer Coding & Algorithms Interview Questions
Practice 316 real Coding & Algorithms interview questions for Machine Learning Engineer roles. From companies including Meta, Amazon, OpenAI, 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."
Implement one-cluster k-means
This question evaluates understanding of clustering algorithms and optimization of within-cluster squared error for the special case k = 1, along with...
Generate unique permutations with duplicates
Given an array of integers that may contain duplicates, generate all unique permutations. Ensure no duplicate permutations are returned even if some v...
Count decodings of a numeric string
Given a string s of digits representing an encoded message where '1' maps to 'A', ..., '26' maps to 'Z', and '0' cannot appear alone (it must be part ...
Convert State Stream to Events
This question evaluates a candidate's ability to process sequential categorical data by identifying and summarizing consecutive runs, reason about tim...
Implement Linear Regression Training
This question evaluates understanding of linear regression, mean squared error loss, gradient computation, parameter updates, and proficiency with vec...
Find closest value to a target in a BST
Problem Given the root of a binary search tree (BST) and a floating-point number target, return the value in the BST that is closest to target. If the...
Implement a Web Crawler with BFS and DFS
Implement a simple web crawler in Python. You are given: - A starting URL. - A function get_links(url) -> list[str] that returns all outgoing links fr...
Implement a Transformer Block with SwiGLU
Implement a Transformer-style neural network block in Python using either NumPy or PyTorch. Your implementation should include: 1. Multi-head self-att...
Compute nested depth sum and grid distance
Problem A: Weighted sum of integers in a nested list You are given a nested list structure that may contain integers or other nested lists. Define the...
Generate all safe queen placements on board
You are given an integer n representing the size of a chessboard (n × n). You need to place n queens on the board so that no two queens attack each ot...
Detect cycles and order with DFS
You are given a directed graph of package dependencies represented as an adjacency list: Map<String, List<String>> deps where deps[p] lists packages t...
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...
Infer Generic Return Types
This question evaluates understanding of type systems, generic unification, recursive data structures, substitution mechanics, and robust error handli...
Board Simulation: Bottom-Insert Pieces with Uniform Row and Column Detection
Board Simulation: Bottom-Insert Pieces with Uniform Row and Column Detection You must simulate a 2-D game board with R rows and C columns. Each cell i...
Solve palindrome and list tasks
This question evaluates proficiency in string algorithms and linked list manipulation, specifically techniques for constructing the shortest palindrom...
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...
Build a Friend Recommender
This question evaluates proficiency in graph algorithms, recommendation system logic, input validation, metric design, and test-driven software implem...
Find Words Containing Other Words
This question evaluates string-processing skills, knowledge of substring matching techniques and supporting data structures, and the ability to analyz...
Solve Merge Lists and Vertical Traversal
This question evaluates proficiency with merging sorted linked lists and performing vertical traversal of binary trees, focusing on algorithms, data s...
Solve Tree Views, Columns, and Calculator
This multi-part question evaluates skills in binary tree traversal and view extraction, vertical column grouping and ordering of tree nodes, and parsi...