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 stream random sampling in Python
You are given an unbounded stream of items that cannot be stored entirely in memory. Write Python code to maintain a uniform random sample from the st...
Design Algorithm for Longest Increasing Subsequence Length
Scenario Programming assessment and infrastructure panel Question Design an algorithm to return the length of the Longest Increasing Subsequence of an...
Determine If Two Numbers Sum to Target
Scenario Live CodeShare Python/Java question during the same LendingClub interview assessing basic algorithmic fluency. Question Given an integer arra...
Implement KNN from Scratch
Implement a k-nearest neighbors (KNN) classifier from scratch in Python without using scikit-learn's KNN implementation. Given training features X_tra...
Design streaming stats with sliding window
Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and mode. 1) Describe your update and query oper...
Build a Next-Word Predictor
Implement a simple next-word model over tokenized training sentences. You need to write two functions: 1. train(sentences): receives a list of tokeniz...
Maximize profitable pairs
You are given an array profits of n integers representing net profit per item and an integer threshold T. You may form disjoint pairs (i, j). What is ...
Compute statistics in data stream
Question Design a data structure that supports computing the current max, mean, and mode for an unbounded integer data stream. Estimate the memory usa...
Optimize Travel Costs and Generate Rotational Symmetric Numbers
Scenario You are building a travel-search engine that must 1) show customers the cheapest round-trip they can book if departure and return prices vary...
Find Smallest Missing Positive Integer in O(n) Time
Scenario LeetCode-style algorithm phone interview Question Implement a function that returns the smallest missing positive integer in an unsorted inte...
Critique Shell Script for Credit-Card Program Tech Round
Scenario Tech round for a new credit-card program: candidate is shown a 5-6 line shell script and asked to critique it Question What kind of file is "...
Implement nth Fibonacci number
Problem Write a function that returns the n-th Fibonacci number. The Fibonacci sequence is defined as: - \(F(0)=0\) - \(F(1)=1\) - \(F(n)=F(n-1)+F(n-2...
Detect earliest collision among moving cars
You are given n vehicles with kinematics parameters. A “collision” means two vehicles occupy the same position at the same time. Assume continuous tim...
Implement drawdown, single-trade profit, coin change
Implement and analyze the following three problems: 1) Maximum drawdown of cumulative PnL: "What is the maximum drawdown of a cumulative PnL (profit a...
Maximize profit from one stock trade
Problem You are given an integer array prices where prices[i] is the price of a stock on day i. You may complete at most one transaction: choose a day...
Find top-5 most similar rows across datasets
You are given two datasets with the same feature columns: - source (rows you want to match): - source_id (STRING/INT) - f1...fk (NUMERIC; may cont...
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...
Optimize invites under capacity constraints
You have n donors (n up to 100,000). For each donor i you know: p_online[i] (probability of donating if emailed), a_online[i] (expected donation condi...
Compute precision–recall curve on imbalanced data
You receive a CSV with columns: actual_label ∈ {0,1} and predicted_prob ∈ [0,1]; the positive class rate is ≈5%. a) Which evaluation metrics would you...
Implement max profit with K transactions (DP)
Given an array prices[0..n-1] of daily stock prices and an integer k, implement a bottom-up dynamic program to compute the maximum achievable profit w...