Pinterest Data Scientist Coding & Algorithms Interview Questions
Practice 21 real Coding & Algorithms interview questions for Data Scientist roles at Pinterest.

"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 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...
Implement np.random.choice
Implement a function similar to numpy.random.choice. Function signature choice(a, size=None, replace=True, p=None) -> samples Requirements - a can be:...
Implement Jackknife and Random Choice
Write Python code for two implementation tasks without using np.random.choice directly: 1. Jackknife-style resampling. Given a one-dimensional collect...
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',...
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...
Implement scalable prime generator
Write a function first_n_primes(n) that returns the first n prime numbers in ascending order. Constraints: - 1 ≤ n ≤ 100,000. - Aim for O(n log log n)...
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...
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...
Determine Pin Connections Through Common Boards
Scenario Pinterest boards contain many pins; need to infer relationships between pins. Question Given the membership lists of all boards, write a func...
Calculate 95% Bootstrap Confidence Interval for Order Values
Scenario An e-commerce firm wants a 95% confidence interval for the average order value but only has a single historical sample of order amounts. Ques...
Implement DelayQueue with Idempotent Task Execution
Scenario Message broker offers DelayQueue where tasks execute at future timestamps, ensuring idempotency on duplicate IDs. Question Implement a delay ...
Design Efficient Multi-Level Access Control System
Scenario Multi-level access control lists (country → city) must be queried quickly. Question Design and implement a permission system where each geogr...
Implement Function to Return First n Prime Numbers
Scenario Quick algorithm screen to gauge Python fluency. Question Implement a Python function that returns the first n prime numbers. Hints An optimiz...
Design Data Structure for Sparse Matrices Operations
Scenario Analytics engine stores extremely sparse numeric matrices. Question Design a data structure to store two sparse matrices and implement print(...
Implement LRUCache with O(1) Operations and Thread Safety
Scenario High-traffic API needs constant-time eviction cache. Question Implement an LRUCache supporting get(key) and put(key,val) in O( 1). Describe ...
Design Algorithm to Minimize Payments in Expense-Sharing App
Scenario Expense-sharing app needs to settle debts among friends after a trip. Question Given a list of transactions (payer, payee, amount), design an...
Implement Data Structure for Top-K Elements in Streams
Scenario Analytics feature that must constantly report the K largest numbers seen so far. Question Implement a data structure that ingests a stream of...
How to Design a Proportional Randomized Sampler?
Scenario Randomized promotion engine must pick an item proportional to its score, but scores have no upper bound. Question Design a sampler pick() tha...
Maximize Non-Overlapping Task Scheduling Efficiency
Scenario Job scheduler on a single machine wants to maximise throughput. Question Given tasks with [start, end) times, return the maximum number of no...
Decode and Explain Ambiguity in Compression Strings
Scenario Compression library that encodes an array as count-value pairs where value is one digit but count may be many digits. Question Implement deco...