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."
Find the Minimum in a Rotated Sorted Array
Find the Minimum in a Rotated Sorted Array A strictly increasing array of distinct integers has been rotated at an unknown pivot. Return its minimum v...
Maximum Profit with Unlimited Stock Transactions
Maximum Profit with Unlimited Stock Transactions Given daily stock prices, compute the maximum profit from any number of buy-and-sell transactions. Yo...
Implement Plus One
This question evaluates proficiency in array manipulation, elementary arithmetic operations such as carry propagation, and careful handling of edge ca...
How do you escape the circle?
A dog runs continuously along the boundary of a circle of radius 1 at speed 4. You start at an arbitrary point strictly inside the circle and can run ...
Return the largest file size in a directory
Problem (Bash / File System) Implement a Bash function (or shell snippet) that returns the maximum file size (in bytes) under a given directory. Requi...
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 ...
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 several OA simulation problems
Reconstruct and solve the following coding problems from an online assessment. 1. Case-insensitive adjacent differences Given a string s, treat u...
Explain differences between Python list and tuple
In Python, what are the key differences between a list and a tuple? Cover: - Mutability and implications - Performance and memory considerations (high...
Solve movie ratings, array, release scheduler
Question This is a three-part coding screen used for a Data Scientist role at DRW. You will work through three independent array/sequence problems, ea...
Sort a Nearly Sorted Array
This question evaluates algorithm design and analysis skills, focusing on handling nearly-sorted arrays and reasoning about time and space complexity ...
Find index with positive suffix sums
This question evaluates array manipulation and algorithmic problem-solving skills, focusing on reasoning about cumulative (suffix) sums and time-compl...
Compute CDF from a PDF Function
This question evaluates a candidate's skills in numerical integration, applied numerical methods, and probability/statistics by requiring construction...
Implement stacks, streaming median, and upward path sum
Complete the following coding problems. State the time/space complexity and key edge cases for each. 1) MinStack Design a stack that supports: - push(...
Devise sequence-rule detection strategy
You are given an integer sequence with 2 ≤ n ≤ 50 terms, possibly following rules such as arithmetic/geometric progressions, alternating patterns, pol...
Compute Jaccard Similarity for Lists
Implement a Python function to compute the Jaccard similarity between two lists of strings. `python def jaccard_similarity(a: list[str], b: list[str])...
Prove reservoir sampling correctness
Design an algorithm to sample k items uniformly at random from a stream of unknown and potentially massive length N, using O(k) memory and one pass. (...
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 ...
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...
Compute Piecewise Linear Interpolation
You are given an unsorted list of distinct 2D points (x_i, y_i). When the points are sorted by x_i, connecting adjacent points forms a polyline. Given...