Data Scientist Coding & Algorithms Interview Questions
Practice 312 real Coding & Algorithms interview questions for Data Scientist roles. From companies including Amazon, Google, Pinterest, Uber, Capital One.

"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 streaming autocomplete under tight memory
Build an autocomplete service: Input: a list of up to 5,000,000 UTF-8 words (may include accents and hyphens), each with an integer popularity score t...
Implement multiplication without using the multiplication operator
Implement int multiply(int a, int b) without using * or /. You may use +, −, bitwise operators, and shifts. Requirements: - Handle negatives, zero, an...
Write mini-batch gradient descent
Implement a generic mini-batch gradient descent routine: inputs are differentiable loss L(θ; x), initial θ0, batch size b, steps T, and learning-rate ...
Optimize assembly-line scheduling with changeovers
You are scheduling a simplified car-assembly line with two parallel stations S1 and S2. Each job must be processed on exactly one station, processing ...
Implement min, mean, median robustly
Implement three functions in Python without using numpy/pandas: (1) my_min(nums) returning the minimum in O(n) time and O(1) space; (2) my_mean(nums) ...
Design airport dispatch with ETA uncertainty
You control airport pickups with streaming ETAs for arriving flights and live driver locations/queues. Design an online dispatch algorithm that minimi...
Implement randomized Quickselect without k-shift bug
Implement randomized Quickselect to return the k-th largest element (1-based k, 1 ≤ k ≤ n) from an unsorted integer array. Use an in-place partition t...
Solve two-pointer, sliding-window, and string tasks
Solve the following three coding tasks: 1) Two-pointer in-place de-duplication: Given a non-decreasing integer array nums and an integer k >= 1, modif...
Design streaming new-vs-returning monthly metrics
Streaming design: Monthly NEW vs RETURNING request shares (event-time, with late/out-of-order and duplicates) Context You receive a high-volume event ...
Implement TF–IDF with sparse matrices
Implement TF–IDF from Scratch (Python + NumPy/SciPy) You are given a list of documents (plain strings). Implement a TF–IDF vectorizer from scratch — n...
Analyze DFS, BFS, and A* trade-offs
Given a weighted graph with nodes {S,A,B,C,D,G} and edges: S–A(2), S–B(5), A–C(2), B–C(1), C–D(2), D–G(1), B–G(20). Heuristic for A*: h(A)=4, h(B)=3, ...
Implement K-means and run two iterations
Given points P={(0,0),(0,2),(2,0),(2,2),(8,8),(8,10),(10,8),(10,10)} and k=2, (1) initialize centroids with k-means++ using seed=42 and Euclidean dist...
Design and explain robust web APIs for ML inference
Design an HTTP API for Image-Based Model Predictions Context: Design an HTTP REST API that serves predictions for image inputs (e.g., classification, ...
Increment Digit Array
Given a non-empty array of digits representing a non-negative integer, add one to the integer and return the resulting array of digits. Assumptions: -...
Implement composition and mixin utilities
Solve the following two Python tasks. Part A: Implement function composition Implement a Python function compose(*funcs) that: 1. Accepts any number o...
Explain list vs tuple in Python
Question In Python: 1. What are the key differences between a list and a tuple? 2. When would you prefer using a tuple over a list? 3. What are the pe...
Answer ancestor-walk queries on a rooted tree
Problem (Tree / Parent Array Queries) You are given a rooted tree with n nodes labeled 1..n, represented by a parent array par[1..n]: - par[i] is the ...
Optimize Station Sequence for Maximum Car Output in Simulation
Scenario The Car-Building mini-game lets you sequence chassis, engine, and paint stations with limited buffers. Question Describe a strategy to maximi...
Compute probability of random arithmetic progression triple
You have the integers from 1 to 30 inclusive. You randomly choose 3 distinct numbers without replacement, and all 3-element subsets are equally likely...
Find two numbers that sum to target
Problem You are given an integer array nums (length n) and an integer target. Return the indices (i, j) such that: - i != j - nums[i] + nums[j] == tar...