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

Implement sampling and subarray scan

A coding interview included the following algorithm questions: 1. You are given access to a function rand01() that returns an independent sample from ...

Coding & Algorithms
4
0
56 people solved
Feb 5, 2025
Google logo
Google
Easy
Data Scientist

Count super-streak segments in an event stream

You are given a time-ordered sequence of events. Each event has: - type, a string or integer event type. - ts, an integer timestamp in milliseconds or...

Coding & Algorithms
12
0
92 people solved
Jan 2, 2025
Cargurus logo
Cargurus
Medium
Data ScientistSenior+ Locked

Reverse a Character Array In Place

Practice an in-place character-array reversal under explicit restrictions on built-in helpers and extra storage. This coding exercise tests careful in...

Coding & Algorithms
1
0
10 people solved
Jun 22, 2026
Squarepoint logo
Squarepoint
Medium
Data Scientist Locked

Implement EMA Crossovers and Root Solvers

This question evaluates time-series data manipulation and vectorized pandas operations for EMA crossovers, numerical methods and error analysis for im...

Coding & Algorithms
1
0
15 people solved
May 3, 2026
J.P. Morgan logo
J.P. Morgan
Medium
Data ScientistSenior+

Implement Integer Square Root

Given a non-negative integer x, implement sqrt(x) and return the integer part of its square root, i.e., floor(sqrt(x)). Requirements: - Do not use a b...

Coding & Algorithms
14
0
89 people solved
Apr 24, 2026
Uber logo
Uber
Medium
Data ScientistSenior+

Find the Next Larger Palindrome

Given a positive integer n, return the smallest integer strictly greater than n whose decimal representation is a palindrome. A palindrome reads the s...

Coding & Algorithms
2
0
24 people solved
Apr 10, 2026
Uber logo
Uber
Medium
Data ScientistNew Grad Locked

Can one car serve all riders?

This question evaluates understanding of interval scheduling and conflict detection, testing skills in time-interval reasoning, sorting, and efficient...

Coding & Algorithms
6
0
71 people solved
Apr 6, 2026
Bytedance logo
Bytedance
Medium
Data Scientist

Probability That One Fair Die Beats Another

Probability That One Fair Die Beats Another Two fair dice, A and B, are represented by integer arrays. Each array element is one physical face, so dup...

Coding & Algorithms
0
0
7 people solved
Apr 4, 2026
Microsoft logo
Microsoft
Easy
Data ScientistSenior+ Locked

Write an average-income function

This question evaluates proficiency in data manipulation and basic statistical aggregation, particularly handling missing values and computing average...

Coding & Algorithms
12
0
102 people solved
Apr 1, 2026
Pinterest logo
Pinterest
Medium
Data Scientist Locked

Implement weighted random choice

This question evaluates understanding of weighted random sampling, probability distributions, input validation, and algorithmic time and space complex...

Coding & Algorithms
11
0
70 people solved
Mar 10, 2026
Two Sigma logo
Two Sigma
Medium
Data Scientist Locked

Evaluate a Piecewise Linear Function

This question evaluates understanding of linear interpolation, numerical reasoning with ordered 2D points, and input validation when computing values ...

Coding & Algorithms
4
0
38 people solved
Mar 3, 2026
Morgan Stanley logo
Morgan Stanley
Medium
Data Scientist

Implement Factorial and Squares

Question In a live coding interview, write two Python functions and be ready to discuss their behavior. 1. factorial(n): Given a non-negative integer ...

Coding & Algorithms
6
0
47 people solved
Mar 1, 2026
Two Sigma logo
Two Sigma
Medium
Data Scientist

Evaluate piecewise linear function at x

You are given a polyline defined by n 2D points \((x_i, y_i)\). Connecting consecutive points with straight line segments forms a piecewise linear fun...

Coding & Algorithms
12
0
106 people solved
Mar 1, 2026
Uber logo
Uber
Medium
Data ScientistNew Grad Locked

Implement FizzBuzz

This question evaluates a candidate's ability to implement basic control flow, use modulo operations, iterate over sequences, and reason about time an...

Coding & Algorithms
4
0
51 people solved
Feb 27, 2026
Microsoft logo
Microsoft
Medium
Data Scientist

Traverse an Org Chart by Level

You are given an organization's reporting structure as a flat list of employee-manager relationships. Exactly one employee is the root (the CEO) and h...

Coding & Algorithms
15
1
138 people solved
Feb 25, 2026
OpenAI logo
OpenAI
Medium
Data Scientist Locked

Design plant-infection algorithms

This question evaluates algorithm design and simulation skills for a data scientist role, focusing on modeling contagion spread on an m-by-n grid, eve...

Coding & Algorithms
5
0
46 people solved
Feb 18, 2026
PayPal logo
PayPal
Easy
Data Scientist

Compute variance of a list in Python

Task Given a Python list of numbers (ints/floats), write code to compute its variance. Requirements - Input: nums: list[float] (length \(n\ge 1\)) - C...

Coding & Algorithms
9
0
66 people solved
Feb 15, 2026
Coinbase logo
Coinbase
Medium
Data Scientist

Implement Plus One

Given a non-empty array of digits representing a non-negative integer, where the most significant digit comes first and each element is in [0, 9], add...

Coding & Algorithms
4
0
52 people solved
Feb 13, 2026
Chicago logo
Chicago
Easy
Data Scientist Locked

Determine if tree has path sum

This question evaluates understanding of binary tree data structures and traversal techniques, along with the ability to accumulate and track root-to-...

Coding & Algorithms
2
0
22 people solved
Feb 9, 2026
Microsoft logo
Microsoft
Easy
Data Scientist Locked

Traverse org chart level by level

This question evaluates understanding of hierarchical data modeling and tree traversal, specifically breadth-first (level-order) traversal and reconst...

Coding & Algorithms
6
0
45 people solved
Feb 9, 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