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."
Find two numbers that sum to target
Problem You are given an integer array nums (length n) and an integer target. Return the indices (i, j) such that: - i != j - nums[i] + nums[j] == tar...
Find lexicographically smallest string and elimination order
You remember two coding questions from an online assessment. Question 1: Return the lexicographically smallest string after a prefix/suffix reverse Yo...
Find longest substring with at least k repeats
Longest substring where each character appears at least k times You are given: - a string s consisting of lowercase English letters - an integer k Ret...
Simulate Coin Flips to Determine Fairness via Empirical Distribution
Scenario You must test whether a coin is fair by simulation. Question Write code that repeatedly simulates n coin flips, records the number of heads, ...
Design Efficient Data Structure for Median Retrieval
Scenario Senior problem-solving round assessing algorithmic thinking under time pressure. Question Design a data structure that supports inserting int...
Find Index Pairs of Matching Elements in Arrays
Scenario Marketing analytics team needs to find common elements between two sorted arrays of user IDs. Question Given two sorted integer arrays withou...
Analyze Python Functions: Improve Readability and Efficiency
Scenario Zoom interview code-review segment: interviewer shares three short Python functions used in a data-science pipeline. Question Walk through th...
Count Word Frequency and Print Top Three Words
Scenario First-round Python coding screening Question Using only basic Python, write a function that receives a list of strings and returns a dictiona...
Optimize Driver Repositioning for Minimal Pickup Time
Scenario Design and implement algorithms for ride-sharing dispatch and capacity planning. Question Given historical rider demand density and current d...
Implement and Analyze 'Merge k Sorted Lists' Algorithm
Scenario Algorithm coding challenge during the final interview round. Question Implement LeetCode 23 ‘Merge k Sorted Lists’ and explain your complexit...
Implement Python Function for Longest Unique Substring Length
Scenario Real-time text analytics service enforcing uniqueness constraints Question Implement a Python function returning the length of the longest su...
Optimize Oculus Data Streaming with Bandwidth Constraints
Scenario Algorithmic screening for Meta VR/AR teams covering Oculus data streaming and geometric optimization. Question Oculus: Given an array frame_s...
Find available reservation time slots
Problem You are building an API to show which time slots are available for booking at a restaurant. You are given: - The restaurant’s opening hours (p...
Find smallest N for 5-and-21 sums
You are given two positive integers: 5 and 21. We say a positive integer x is representable if it can be written in the form \[ x = 5a + 21b \] for so...
Implement weighted random choice
Implement a simplified version of np.random.choice without calling the built-in function. You are given an array items of length n and an optional pro...
Compute Variance from a Python List
Given a Python list of numeric values, write a function to compute the variance without using external libraries such as NumPy or pandas. Clarify any ...
Match payments to invoices by memo or amount
Scenario You are building a small reconciliation tool that matches payments to invoices. Data structures Assume you are given: - invoices: a list of i...
Compute win probability in coin-toss game
Two players, A and B, play the following game with a fair coin: - They toss the coin alternately: A tosses first, then B, then A, then B, and so on. -...
Find kth missing integer and redundant operations
You are given two independent coding tasks. Task 1: K-th missing number You are given an integer array nums (not necessarily sorted) containing distin...
Implement an LRU cache with O(1) ops
Design and code an LRU cache supporting get(key) and put(key, value) in O(1) average time with capacity N. Specify your data structures, handle update...