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."
Determine Whether an Integer Is a Palindrome
Determine Whether an Integer Is a Palindrome Implement is_palindrome_number(value). Return true when the base-10 digits of a non-negative integer read...
Maintain a Fixed-Window Rolling Mean in Constant Time
Maintain a Fixed-Window Rolling Mean in Constant Time Implement rolling_means(values, window) for signed integer values, returning a double-precision ...
Maximize Points by Buying Cost-Multiplier Cards
This question evaluates a candidate's ability to reason about optimal ordering and subset selection under a multiplicative-then-subtractive scoring ru...
Optimize CUDA GEMM with tiling and coalescing
CUDA Execution Model, Memory Hierarchy, and GEMM Kernel Design You are interviewing for a Data Scientist / GPU-software role at NVIDIA. The interviewe...
Match readings with latest same-city humidity
Problem You are given two time-sorted lists of sensor readings: - Temperature records: (time, city, reading) - Humidity records: (time, city, reading)...
Compute Theme Similarity
This question evaluates understanding of set-based similarity metrics (the Jaccard coefficient) and practical coding skills for transforming and compa...
Compute the Product of an Array Except Self
The interview report preserved the input-output example but not every original restriction. The following is a self-contained version of the reported ...
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...
Optimize Matrix-Chain Multiplication
Implement minimum_matrix_chain_cost(dimensions). There are n = len(dimensions) - 1 matrices. Matrix A_i has shape dimensions[i-1] x dimensions[i] for ...
Implement TF–IDF with sparse matrices
Implement TF–IDF from Scratch (Python + NumPy/SciPy) You are given a list of documents (plain strings). Implement a TF–IDF vectorizer from scratch — n...
How do you sample uniformly from an infinite stream?
This question evaluates understanding of streaming algorithms, randomized sampling and probability, and algorithmic space–time trade-offs involved in ...
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...
Compute and plot a precision–recall curve
You are given model outputs for a binary classifier: - y_true: an array of 0/1 ground-truth labels of length n. - y_score: an array of predicted score...
Optimize assembly-line scheduling with changeovers
You are scheduling a simplified car-assembly line with two parallel stations S1 and S2. Each job must be processed on exactly one station, processing ...
Return all combinations that sum to target
This question evaluates combinatorial search and algorithmic problem-solving skills, focusing on recursion/backtracking, unbounded item usage, and enf...
Explain Shell Script for Python Virtual Environment Setup
Explain Shell Script for Python Virtual Environment Setup Scenario Shell script for setting up a Python virtual environment during a tech screen Quest...
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 a high-throughput web crawler safely
Design and code (pseudocode acceptable) a multi-threaded web crawler that favors breadth-first discovery while continuously running analysis tasks on ...
Infer and justify non-trivial sequence patterns
Pattern Recognition: Next Terms and Missing Value Identify the rule governing each sequence or row and compute the missing value(s). Justify each answ...
Implement CUDA-tiled matrix multiplication and explain architecture
CUDA FP32 GEMM Design Task Implement a high-performance CUDA kernel for matrix multiplication C = A · B where: - A is m×k, B is k×n, C is m×n - Data t...