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 sparse vector dot product and cosine similarity
Sparse Vector Class Implement a SparseVector class for high-dimensional vectors where most entries are zero. Representation Assume each vector has: - ...
Convert a PDF to a CDF
Given a continuous random variable X with probability density function f(x), write code or describe an algorithm to construct its cumulative distribut...
Compute CDF from a PDF Function
You are given a callable function pdf(t) that returns the probability density of a normal distribution at value t. Implement a function cdf(x) that re...
Implement Plus One
Given a non-empty array of digits representing a non-negative integer, where the most significant digit comes first and each element is in [0, 9], add...
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 nodes r1..rD, each with an integ...
Add two integer strings using digit-adder
Coding Prompt You are given a helper function: - addDigits(a, b) -> (sumDigit, carry) - a and b are single decimal digits (characters '0'…'9' or int...
Design late-tolerant streaming window aggregator
You receive an unbounded stream of events: (event_time, user_id, category). Events may arrive up to 48 hours late and are not ordered by time. Design ...
Solve stock, BFS path, and merge intervals
Solve three coding problems; justify complexity and corner cases. A) Best Time to Buy/Sell Stock (one transaction): Given prices[0..n-1] (integers), r...
Compute 95th-percentile call concurrency
Given N call sessions as half-open intervals [start, end) in UNIX seconds, design an algorithm to compute the 95th percentile of per-minute concurrent...
Solve subset-count and kth-factor problems
Two Independent Tasks A) Maximum Count Under Sum Constraint You are given an integer array arr and an integer budget n. Return the maximum number of e...
Implement streaming CTR with deduplication
Implement a Python function to compute streaming, per-campaign CTR over a sliding 24-hour window with click de-duplication and late-arriving events. R...
Reverse a singly linked list robustly
Reverse a Singly Linked List In-Place Context: You are given the head of a standard singly linked list (each node has value and next). Implement and e...
Maximize profit from one or many stock trades
You are given an integer array prices where prices[i] is the price of a stock on day i (0-indexed). Answer the following two subproblems: 1. Single tr...
Count Enclosed Islands in a Grid
You are given an m x n grid representing land and water after flooding. - 0 represents land. - 1 represents water. - Two land cells belong to the same...
Solve three algorithmic tasks in Python
You are given 120 minutes to implement three independent algorithmic tasks in Python. Each task specifies the required input/output behavior, the cons...
Solve matrix add, frequency count, longest consecutive
You are asked to solve the following 3 coding tasks (in any language). Implement each as a function. 1) Add two matrices Input: Two 2D integer arrays ...
Build next-word predictor with O(1) lookup
Problem You are given a training corpus where each training example is a tokenized sentence (array of words). Example training sentences: - ["I", "am"...
Implement np.random.choice
Implement a function similar to numpy.random.choice. Function signature choice(a, size=None, replace=True, p=None) -> samples Requirements - a can be:...
Minimize moves to transform floor layouts
You are given an initial arrangement of apartments across Floors 1–4 and a target arrangement. In one move you may reposition a single apartment to a ...
Convert number words to integer
Given a line containing an English phrase representing a number in the range −999,999,999 to 999,999,999, convert it to its integer value. Supported w...