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
Capital One logo
Capital One
Medium
Data Scientist

Validate Unit-Test Coverage and Identify Missing Scenarios

Validate Unit-Test Coverage and Identify Missing Scenarios Scenario Tech round: reviewing an existing unit-test that exercises the class from Part 2 Q...

Coding & Algorithms
6
0
82 people solved
Aug 4, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Design streaming stats with sliding window

Design streaming stats with sliding window Design a data structure that ingests an integer stream and supports online queries for maximum, mean, and m...

Coding & Algorithms
5
0
47 people solved
Aug 1, 2025
Roblox logo
Roblox
Easy
Data ScientistSenior+

Find maximum follow depth using recursion

You are given a directed follows relationship representing a social graph: - Each record (follower_id, followee_id) means follower_id follows followee...

Coding & Algorithms
14
0
216 people solved
Dec 11, 2025
Bytedance logo
Bytedance
Medium
Data ScientistIntern

Count Same-Day Registered Posters

You are given two tables: `text users - user_id: unique identifier for a user - registered_at: timestamp when the user registered posts - post_id: uni...

Coding & Algorithms
0
0
6 people solved
Mar 14, 2026
Meta logo
Meta
Easy
Data Scientist

Compute maximum score using up to 3 categories

Problem A library runs a summer reading program. Each book a student reads earns a certain number of points, and each book belongs to a category. A st...

Coding & Algorithms
5
0
72 people solved
Dec 2, 2025
Optiver logo
Optiver
Medium
Data Scientist

Match alphanumeric patterns in a stream

Given a reference 7–8 character alphanumeric code and four candidate codes, select the exact match as quickly as possible. Design a system that: - Eff...

Coding & Algorithms
6
0
77 people solved
Sep 6, 2025
Waymo logo
Waymo
Medium
Data Scientist

Implement Safe Average Function

Write a Python function average(values) that returns the arithmetic mean of a list of numbers. Requirements: - If values is empty, return 0. - The inp...

Coding & Algorithms
12
0
84 people solved
Mar 7, 2026
Capital One logo
Capital One
Easy
Data ScientistSenior+ Locked

Review Preprocessing Code and Tests

This question evaluates a candidate's competency in data-science engineering tasks including code review, data preprocessing techniques (outlier handl...

Coding & Algorithms
6
0
73 people solved
Feb 28, 2026
Two Sigma logo
Two Sigma
Medium
Data Scientist

Implement merge sort and largest 1-rectangle

The coding round included two algorithm questions: 1. Implement merge sort for an array of integers. Return the sorted array and explain its time and ...

Coding & Algorithms
7
0
53 people solved
Feb 26, 2026
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Compute delivery order via BFS

Compute delivery order via BFS A city road network is an unweighted, undirected graph G(V, E) with a depot node s and D delivery requests located at n...

Coding & Algorithms
5
0
61 people solved
Aug 10, 2025
Bank of America logo
Bank of America
Medium
Data Scientist

Explain coding solution and alternatives

Explain coding solution and alternatives Explain the logic behind your solution to a previous coding problem (e.g., the second coding task in this int...

Coding & Algorithms
4
0
65 people solved
Aug 1, 2025
Oracle logo
Oracle
Easy
Data ScientistIntern Locked

Count closed islands in a grid

This question evaluates grid traversal and connected-component detection skills, focusing on 4-directional adjacency and boundary-condition reasoning ...

Coding & Algorithms
8
0
62 people solved
Feb 18, 2026
PayPal logo
PayPal
Hard
Data Scientist

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

Coding & Algorithms
9
0
83 people solved
Oct 29, 2025
Jane Street logo
Jane Street
Medium
Data Scientist

Solve queue switch and coin change puzzles

This entry contains two separate interview-style quantitative/algorithmic questions. --- 1. Queue switching decision problem You are standing in a sin...

Coding & Algorithms
17
0
149 people solved
Oct 14, 2025
Google logo
Google
Medium
Data Scientist

Implement piecewise linear interpolation for time-to-empty

Time-to-Empty from a Discharge Curve (Piecewise Linear Interpolation) Implement a function time_to_empty(checkpoints, current_soc) that returns the nu...

Coding & Algorithms
4
0
41 people solved
Oct 13, 2025
Tencent logo
Tencent
Medium
Data Scientist

Implement robust k-means with k-means++ initialization

Implement from scratch in Python (no scikit‑learn) a function kmeans(X, k, max_iter=300, tol=1e-4, random_state=0) that returns (centroids, labels). R...

Coding & Algorithms
5
0
77 people solved
Oct 13, 2025
NVIDIA logo
NVIDIA
Hard
Data Scientist

Design and secure a REST inference API

Design a REST API for Image Inference with Grad-CAM You are designing a public REST API for an image-inference service that accepts large images and r...

Coding & Algorithms
4
0
62 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Analyze DFS, BFS, and A* trade-offs

Given a weighted graph with nodes {S,A,B,C,D,G} and edges: S–A(2), S–B(5), A–C(2), B–C(1), C–D(2), D–G(1), B–G(20). Heuristic for A*: h(A)=4, h(B)=3, ...

Coding & Algorithms
4
0
62 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Implement K-means and run two iterations

Given points P={(0,0),(0,2),(2,0),(2,2),(8,8),(8,10),(10,8),(10,10)} and k=2, (1) initialize centroids with k-means++ using seed=42 and Euclidean dist...

Coding & Algorithms
4
0
46 people solved
Oct 13, 2025
Pinterest logo
Pinterest
Easy
Data Scientist Locked

Implement np.random.choice

This question evaluates understanding of random sampling algorithms, probability distributions (uniform and weighted), handling of weights and edge-ca...

Coding & Algorithms
5
0
47 people solved
Feb 1, 2026

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