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."
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...
Implement Cosine Similarity Function for String Vectors
Scenario Technical phone screen in Python; assess ability to implement similarity metric. Question Implement a Python function that computes the cosin...
Simulate Radioactive Decay to Validate Analytical Solution
Scenario Same radioactive-decay problem, but now validate the analytical answer via simulation during the interview. Question Share screen and write r...
Determine Length of Longest Unique Substring
Scenario Online assessment: coding portion that follows the SQL questions. Question Implement a function that, given a string s, returns the length of...
Check if a numeric string is divisible by 8
Question You are given a very large non-negative integer represented as a decimal string s (it may be too large to fit in standard 64-bit integer type...
Implement Jackknife and Random Choice
Write Python code for two implementation tasks without using np.random.choice directly: 1. Jackknife-style resampling. Given a one-dimensional collect...
Find index with positive suffix sums
Given an unsorted integer array \(A\), find an index \(i\) such that every cumulative sum starting from \(i\) to the end of the array is strictly posi...
Design plant-infection algorithms
Consider an m x n grid where each cell contains one plant. Some plants are initially infected and all other plants are healthy. Time advances in whole...
Compute Fibonacci Numbers
Write a function that returns the nth Fibonacci number. Definitions and requirements: - Use zero-based indexing: fib(0) = 0, fib(1) = 1. - For n >= 2,...
Solve sliding window, graph top-k, and greedy tasks
You have three coding tasks. Task 1 — Sliding window on strings: Given a string s and an integer k, find one longest substring of s that contains at m...
Compute maximum beauty of a string
Given a string s, define the beauty of each letter a–z as a distinct integer between 1 and 26, case-insensitive. The beauty of a string is the sum ove...
Detect k events in a sliding window
Implement an algorithm that, for each user, determines whether there exists a set of at least k ACH credit events from distinct device_ids within any ...
Implement sliding-window rate limiter with dual thresholds
Implement getRequestStatus(urls: List[str]) -> List[str]. The i-th entry in urls represents a single incoming request at timestamp t = i seconds (t st...
Optimize bread-factory pipeline for max profit
You can assemble a production line by choosing modules of three types: Mixers, Ovens, Packers. Each module i has (type, build_cost_i, throughput_i uni...
Implement streaming k-way merge with constraints
Implement a function merge_k(iterators, N) that returns the first N items of the global ascending order from k sorted, potentially unbounded iterators...
Review checkout code for defects and privacy
You are reviewing a supermarket checkout implementation. Identify and prioritize issues and fixes across: (a) monetary correctness (avoid floating poi...
Fix failing tests and refactor code
You're given a small Python repo. After creating and activating a clean virtual environment, installing requirements, and running "pytest -q", two tes...
Implement list overlap and dense-ranked word frequencies
Part A — Multiset overlap count Implement count_overlap(a: List[int], b: List[int]) -> int that returns the size of the multiset intersection of a and...
Compute average unique pins per user
Task: Average Unique Pins Per User You are given a mapping from user IDs to their lists of pin IDs. Implement a function that computes the mean number...
Merge words by head-tail chaining
Given a list of lowercase words, merge them into a single string by repeatedly chaining words where the last character of the current string equals th...