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."
Implement sliding-window device anomaly
Streaming detection algorithm: Implement a function process_logins(stream) that consumes a time-ordered stream of login events (user_id, ts, device_id...
Implement lower_bound on unknown-size sorted array
Lower Bound in Unknown-Length Nondecreasing Array via API Setup You are given a non-decreasing integer array A of unknown length n. You cannot access ...
Implement minimum window substring with counts
Implement min_window_with_counts(s, t) Task Write a function: - min_window_with_counts(s: str, t: str) -> tuple[int, int] that returns the inclusive (...
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...
Find duplicates in a list efficiently
Given a Python list that can contain integers (possibly negative) and may be very large, write code and explain approaches to find all values that app...
Implement Director awards with Python OOP
Python OOP Exercise: Director extends Cast Context You are working with a simple class hierarchy where Director extends Cast. Implement a robust, test...
Compute optimal matrix-chain multiplication order
Matrix Chain Multiplication: Optimal Parenthesization and Analysis You are given five matrices to multiply: A1 (10×30), A2 (30×5), A3 (5×60), A4 (60×2...
Reverse a list in-place
Coding Task: Reverse a List In-Place (Python) Context You're implementing a utility function during a technical screen. The function must reverse a Py...
Match a string with wildcard pattern recursively
This question evaluates proficiency in string pattern matching, recursive problem decomposition, and algorithmic optimization including handling wildc...
Find minimum operations to make array sorted
Problem You are given an integer array a of length n. Define one operation as follows: 1. Remove the first element x = a[0]. 2. Append x to the end of...
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...
Solve matrix add, frequency count, longest consecutive
You are asked to solve the following 3 coding tasks (in any language). Implement each as a function. 1) Add two matrices Input: Two 2D integer arrays ...
Solve a Skyscraper puzzle efficiently
Design and implement a solver for the Skyscraper logic puzzle on an $N \times N$ grid, where $3 \le N \le 7$. The board is a grid of building heights....
Convert number words to integer
Given a line containing an English phrase representing a number in the range −999,999,999 to 999,999,999, convert it to its integer value. Supported w...
Count subarrays equal to target
Count subarrays equal to target Given an integer array nums and an integer k, count the number of contiguous subarrays whose sum equals k. Solve it in...
Maximize profitable pairs
Maximize profitable pairs You are given an array profits of n integers representing net profit per item and an integer threshold T. You may form disjo...
Find longest substring with at least k repeats
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 ...
Compute statistics in data stream
Question Design a data structure that supports computing the current max, mean, and mode for an unbounded integer data stream. Estimate the memory usa...
Solve Data-Structure Problems in Python Interview Round
Scenario Interview coding round focusing on simple data-structure problems in Python. Question Given an integer, rearrange its digits (considering onl...
Calculate Jaccard Similarity Score for Two String Lists
Scenario During pair programming, the interviewer asks you to compare two lists of merchant tags and quantify their similarity. Question Implement a P...