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 monotonic-array linear interpolation
Question Implement a function interpolate(array_x, array_y, x) that returns the linearly interpolated y-value for a query x-value, given paired data p...
Implement Stratified Sampling by Country
You are given a large in-memory Python list named records, where each element is a dictionary with at least the following keys: - country: str - devic...
Compute bus-on-time and dice-sum probabilities
You are asked two basic probability questions. A) Catching a bus to arrive before a movie A person is going to the cinema. The movie starts in L minut...
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 DFS with cycle detection and topo order
Implement DFS (recursive and iterative) with topo sort, cycle detection, and timestamps You are given a directed graph G with N nodes labeled 1..N and...
Implement robust k-means with k-means++ initialization
Implement from scratch in Python (no scikit‑learn) a function kmeans(X, k, max_iter=300, tol=1e-4, random_state=0) that returns (centroids, labels). R...
Check anagrams under real-world constraints
Given two strings s and t, determine whether they contain exactly the same multiset of characters (e.g., 'abc' and 'cab' → true; 'aab' and 'ab' → fals...
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...
Implement bootstrap mean and variance
Given an array of N numeric values, implement a function that uses bootstrap resampling to estimate the sampling distribution of the mean. The functio...
Implement nested template string substitution
You are given a dictionary (map) from keys to string templates. Templates may reference other keys using placeholders of the form %KEY%. Example dicti...
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 Shell Script for Python Virtual Environment Setup
Scenario Shell script for setting up a Python virtual environment during a tech screen Question Explain what each line of the provided shell script do...
Generate Synthetic Clickstream Data with Python Function
Scenario The analytics team needs to generate synthetic click-stream records to test a new reporting pipeline before real traffic arrives. Question Wr...
Implement Buffer Parsers and Generic Map Class
In C++, complete the following two independent implementation tasks. 1. Sequential buffer reader You are given a raw byte buffer and a current poin...
Optimize switching puzzle solution
Consider a switching puzzle on an m×n grid of lights where toggling a cell flips its state and that of its orthogonal neighbors (Lights Out variant). ...
Count Interior Islands After Flooding
You are given an m x n binary grid representing land and water. - 1 = land - 0 = water An island is a maximal group of land cells connected 4-directio...
Find missing numbers in sequences
You are given several number sequences (integers and/or rational numbers). Each sequence contains exactly one missing term written as ?. For each sequ...
Find longest uniform substring after k replacements
Given a string s (ASCII, length up to 2e5) and integer k (0 ≤ k ≤ |s|), return the length of the longest substring that can be turned into all the sam...
Maximize products bought under budget
Given N products and M customers, for each customer find the list of distinct products they can buy without exceeding their budget such that the numbe...
Implement longest subarray summing to k
Given an integer array nums (length ≤ 200,000; values may be negative) and integer k, return the maximum length and the [l, r] indices of a contiguous...