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."
Detect sequence rule and repair anomaly
Implement next_value(seq: list[int]) that detects the rule of a numeric sequence and returns a tuple (model_name, parameters, anomaly_index_or_None, n...
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...
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...
Implement min, mean, median robustly
Implement three functions in Python without using numpy/pandas: (1) my_min(nums) returning the minimum in O(n) time and O(1) space; (2) my_mean(nums) ...
Compute max island with constrained flips
Given an n×n binary grid G where 1=land and 0=water with 4-directional connectivity, return the size of the largest island achievable by flipping at m...
Debug and test a Python function in venv
Consider the Python snippet below. """ import math def accumulate(nums, start=0, cache={}): total = start for n in nums: if n % 2 == 0: nums.appen...
Implement and extend My Calendar III
Design and implement a booking system like LeetCode 732 (My Calendar III). Provide a class with methods: book(start, end) using half-open intervals [s...
Implement weighted sampling without replacement
Implement in Python a function sample_k(items, weights, k) that returns k items without replacement with probability proportional to weight. Requireme...
Find list pair with maximum overlap
You are given N labeled lists of items as a Python dict mapping list_name -> iterable of strings. Example input: {'L1': ['A','B','C'], 'L2': ['A','C',...
Implement randomized Quickselect without k-shift bug
Implement randomized Quickselect to return the k-th largest element (1-based k, 1 ≤ k ≤ n) from an unsorted integer array. Use an in-place partition t...
Compute binary-tree diameter via return-only DFS
Given the root of a binary tree, compute its diameter defined as the number of edges on the longest path between any two nodes. Implement a DFS that r...
Compute 95th-percentile call concurrency
Given N call sessions as half-open intervals [start, end) in UNIX seconds, design an algorithm to compute the 95th percentile of per-minute concurrent...
Solve subset-count and kth-factor problems
Two Independent Tasks A) Maximum Count Under Sum Constraint You are given an integer array arr and an integer budget n. Return the maximum number of e...
Implement sqrt with Newton vs binary search
Implement numerically robust square-root routines and analyze convergence Task 1 — sqrt_newton(x, tol=1e-12) Implement a Python function that returns ...
Implement fast sampling for weighted k-sided die
You must sample from a categorical distribution over k outcomes with probabilities p1..pk (sum to 1) without using built-in categorical samplers. You ...
Compute and Rank by Jaccard Similarity
Implement two functions: (1) jaccard_similarity(s1, s2) that tokenizes by splitting on any non-alphanumeric character, lowercases, treats tokens as se...
Implement blocked time-series cross-validation
Implement a panel-aware blocked time-series cross-validation splitter with an embargo. Input: DataFrame columns [loan_id, msa, month]. Requirements: (...
Refactor code and enforce robustness
Code Review and Refactor: Summing a CSV Column Context You are reviewing a short Python script that sums a numeric column from a CSV using pandas. You...
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 maximum concurrent trips from intervals
You’re given n trip intervals [start, end) in seconds, where start < end, representing when a rider’s trip starts and ends in a city on a specific day...