Data Scientist Coding & Algorithms Interview Questions
Practice 335 real Coding & Algorithms interview questions for Data Scientist roles. From companies including Amazon, Google, Two Sigma, Pinterest, Uber.

"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."
Validate Unit-Test Coverage and Identify Missing Scenarios
Validate Unit-Test Coverage and Identify Missing Scenarios Scenario Tech round: reviewing an existing unit-test that exercises the class from Part 2 Q...
Design streaming stats with sliding window
Design streaming stats with sliding window Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and m...
Find maximum follow depth using recursion
You are given a directed follows relationship representing a social graph: - Each record (follower_id, followee_id) means follower_id follows followee...
Count Same-Day Registered Posters
You are given two tables: `text users - user_id: unique identifier for a user - registered_at: timestamp when the user registered posts - post_id: uni...
Compute maximum score using up to 3 categories
Problem A library runs a summer reading program. Each book a student reads earns a certain number of points, and each book belongs to a category. A st...
Match alphanumeric patterns in a stream
Given a reference 7–8 character alphanumeric code and four candidate codes, select the exact match as quickly as possible. Design a system that: - Eff...
Implement Safe Average Function
Write a Python function average(values) that returns the arithmetic mean of a list of numbers. Requirements: - If values is empty, return 0. - The inp...
Review Preprocessing Code and Tests
This question evaluates a candidate's competency in data-science engineering tasks including code review, data preprocessing techniques (outlier handl...
Implement merge sort and largest 1-rectangle
The coding round included two algorithm questions: 1. Implement merge sort for an array of integers. Return the sorted array and explain its time and ...
Compute delivery order via BFS
Compute delivery order via BFS A city road network is an unweighted, undirected graph G(V, E) with a depot node s and D delivery requests located at n...
Explain coding solution and alternatives
Explain coding solution and alternatives Explain the logic behind your solution to a previous coding problem (e.g., the second coding task in this int...
Count closed islands in a grid
This question evaluates grid traversal and connected-component detection skills, focusing on 4-directional adjacency and boundary-condition reasoning ...
Compute Variance from a Python List
Given a Python list of numeric values, write a function to compute the variance without using external libraries such as NumPy or pandas. Clarify any ...
Solve queue switch and coin change puzzles
This entry contains two separate interview-style quantitative/algorithmic questions. --- 1. Queue switching decision problem You are standing in a sin...
Implement piecewise linear interpolation for time-to-empty
Time-to-Empty from a Discharge Curve (Piecewise Linear Interpolation) Implement a function time_to_empty(checkpoints, current_soc) that returns the nu...
Implement robust k-means with k-means++ initialization
Implement from scratch in Python (no scikit‑learn) a function kmeans(X, k, max_iter=300, tol=1e-4, random_state=0) that returns (centroids, labels). R...
Design and secure a REST inference API
Design a REST API for Image Inference with Grad-CAM You are designing a public REST API for an image-inference service that accepts large images and r...
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...
Implement np.random.choice
This question evaluates understanding of random sampling algorithms, probability distributions (uniform and weighted), handling of weights and edge-ca...