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.

335 Questions 80 Companies08.08.2026
Showing 20 results
Role
Amazon logo
Amazon
Medium
Data Scientist

Design a Scalable, Fault-Tolerant Distributed Order System

Scenario Round covering distributed-system design and algorithm implementation. Question Design a highly available, low-latency distributed order-proc...

Coding & Algorithms
23
0
65 people solved
Aug 4, 2025
Jane Street logo
Jane Street
Medium
Data Scientist

Optimal Stopping for Die Rolls That Bust on Perfect Squares

You repeatedly roll a fair six-sided die and keep a running cumulative sum $S$ of all the values rolled so far (starting from $S = 0$ before the first...

Coding & Algorithms
0
0
5 people solved
Aug 3, 2025
Jane Street logo
Jane Street
Medium
Data Scientist

Two Opaque Boxes: Place or Take for Maximum Expected Payoff

You are playing a one-player game with two opaque boxes, both of which start empty. The game lasts exactly 100 turns, and on every turn you must choos...

Coding & Algorithms
0
0
10 people solved
Aug 3, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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...

Coding & Algorithms
12
0
101 people solved
Aug 2, 2025
Optiver logo
Optiver
Easy
Data Scientist

Stone Pile Doubling Game: Can One Pile Be Emptied?

You are given two piles of stones containing a and b stones respectively (both piles start non-empty). You repeatedly apply the following move: - Let ...

Coding & Algorithms
0
0
2 people solved
Jul 26, 2025
Apple logo
Apple
Medium
Data Scientist

Implement sparse vector dot product and cosine similarity

Sparse Vector Class Implement a SparseVector class for high-dimensional vectors where most entries are zero. Representation Assume each vector has: - ...

Coding & Algorithms
6
0
56 people solved
Jul 15, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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 ...

Coding & Algorithms
29
0
68 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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 ...

Coding & Algorithms
16
0
62 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

Develop Auto-Complete System for Dish Suggestions

Scenario Search-as-you-type needs dish suggestions with popularity scores. Question Build an auto-complete system using the given (string, score) tupl...

Coding & Algorithms
5
0
25 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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...

Coding & Algorithms
14
0
38 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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...

Coding & Algorithms
13
0
8 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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...

Coding & Algorithms
21
0
52 people solved
Jul 12, 2025
Google logo
Google
Medium
Data Scientist

Implement Sampling and Minimize Loss in Numerical Coding

Scenario Numerical coding challenges on sampling and loss minimization. Question a) Implement functions to sample from truncated normal distributions ...

Coding & Algorithms
24
0
91 people solved
Jul 12, 2025
Google logo
Google
Medium
Data Scientist

Normalize Columns in Binomial Matrix Efficiently

Scenario Write code that creates a 100×100 matrix of Binomial(1, 0. 5) samples and normalizes each column so it sums to 1. Question Provide an efficie...

Coding & Algorithms
14
0
31 people solved
Jul 12, 2025
Capital One logo
Capital One
Medium
Data Scientist

Automate Python Virtual Environment Setup on Linux Terminal

Scenario Shell script that automates Python virtual-environment setup on a Linux terminal during a tech interview Question Walk through the script lin...

Coding & Algorithms
104
0
321 people solved
Jul 12, 2025
OneMain Financial logo
OneMain Financial
Medium
Data Scientist

Solve Python Challenges: Reverse String, Palindrome, Fibonacci, Unique List

Scenario Live coding round – four quick Python exercises Question Implement a function that reverses a string in-place. Write code that returns True i...

Coding & Algorithms
8
0
22 people solved
Jul 12, 2025
Apple logo
Apple
Medium
Data Scientist

Find Maximum Sum of Contiguous Subarray Length k

Scenario Monitoring website traffic and needing the highest traffic within any fixed-length time window. Question Given an array of positive integers ...

Coding & Algorithms
19
0
58 people solved
Jul 12, 2025
Point72 logo
Point72
Medium
Data Scientist

Determine Circle Intersection Status for Rendering Order

Scenario Graphics engine must evaluate multiple pairs of circles to decide rendering order based on intersection. Question Given an array where each e...

Coding & Algorithms
31
0
85 people solved
Jul 12, 2025
Point72 logo
Point72
Medium
Data Scientist

Determine Most Frequent Product Color in Carts

Scenario Online store wants to know which color of product appears most frequently in customers’ carts. Question Implement a function getMaxColor(colo...

Coding & Algorithms
30
0
100 people solved
Jul 12, 2025
Pinterest logo
Pinterest
Medium
Data Scientist

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...

Coding & Algorithms
10
0
38 people solved
Jul 12, 2025

Explore more Data Scientist Coding & Algorithms interview questions

Real questions from candidate reports, grouped by company, topic and role.

By company
Other categories for Data Scientist
Coding & Algorithms questions for other roles
Browse all