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."
Implement sampling and subarray scan
A coding interview included the following algorithm questions: 1. You are given access to a function rand01() that returns an independent sample from ...
Count super-streak segments in an event stream
You are given a time-ordered sequence of events. Each event has: - type, a string or integer event type. - ts, an integer timestamp in milliseconds or...
Reverse a Character Array In Place
Practice an in-place character-array reversal under explicit restrictions on built-in helpers and extra storage. This coding exercise tests careful in...
Implement EMA Crossovers and Root Solvers
This question evaluates time-series data manipulation and vectorized pandas operations for EMA crossovers, numerical methods and error analysis for im...
Implement Integer Square Root
Given a non-negative integer x, implement sqrt(x) and return the integer part of its square root, i.e., floor(sqrt(x)). Requirements: - Do not use a b...
Find the Next Larger Palindrome
Given a positive integer n, return the smallest integer strictly greater than n whose decimal representation is a palindrome. A palindrome reads the s...
Can one car serve all riders?
This question evaluates understanding of interval scheduling and conflict detection, testing skills in time-interval reasoning, sorting, and efficient...
Probability That One Fair Die Beats Another
Probability That One Fair Die Beats Another Two fair dice, A and B, are represented by integer arrays. Each array element is one physical face, so dup...
Write an average-income function
This question evaluates proficiency in data manipulation and basic statistical aggregation, particularly handling missing values and computing average...
Implement weighted random choice
This question evaluates understanding of weighted random sampling, probability distributions, input validation, and algorithmic time and space complex...
Evaluate a Piecewise Linear Function
This question evaluates understanding of linear interpolation, numerical reasoning with ordered 2D points, and input validation when computing values ...
Implement Factorial and Squares
Question In a live coding interview, write two Python functions and be ready to discuss their behavior. 1. factorial(n): Given a non-negative integer ...
Evaluate piecewise linear function at x
You are given a polyline defined by n 2D points \((x_i, y_i)\). Connecting consecutive points with straight line segments forms a piecewise linear fun...
Implement FizzBuzz
This question evaluates a candidate's ability to implement basic control flow, use modulo operations, iterate over sequences, and reason about time an...
Traverse an Org Chart by Level
You are given an organization's reporting structure as a flat list of employee-manager relationships. Exactly one employee is the root (the CEO) and h...
Design plant-infection algorithms
This question evaluates algorithm design and simulation skills for a data scientist role, focusing on modeling contagion spread on an m-by-n grid, eve...
Compute variance of a list in Python
Task Given a Python list of numbers (ints/floats), write code to compute its variance. Requirements - Input: nums: list[float] (length \(n\ge 1\)) - C...
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...
Determine if tree has path sum
This question evaluates understanding of binary tree data structures and traversal techniques, along with the ability to accumulate and track root-to-...
Traverse org chart level by level
This question evaluates understanding of hierarchical data modeling and tree traversal, specifically breadth-first (level-order) traversal and reconst...