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
Block (Square) logo
Block (Square)
Medium
Data Scientist

Build referral chains and detect cycles

You are given a directed referral graph where each user may have at most one referrer. Input file 'referrals.csv' has columns: user_id (INT), referred...

Coding & Algorithms
10
0
86 people solved
Oct 13, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern Locked

Merge two sorted linked lists

This question evaluates proficiency with linked list data structures, pointer manipulation, in-place merging concepts, and algorithmic efficiency with...

Coding & Algorithms
4
0
51 people solved
Apr 2, 2026
NVIDIA logo
NVIDIA
Hard
Data Scientist

Reverse linked lists, including k-group

Singly Linked List Reversal — Variants and Edge Cases You are given a standard singly linked list with nodes of the form: - Node fields: value, next -...

Coding & Algorithms
6
0
90 people solved
Oct 13, 2025
Roblox logo
Roblox
Medium
Data Scientist

Optimize bread-factory pipeline for max profit

You can assemble a production line by choosing modules of three types: Mixers, Ovens, Packers. Each module i has (type, build_cost_i, throughput_i uni...

Coding & Algorithms
8
0
118 people solved
Oct 13, 2025
Google logo
Google
Medium
Data Scientist Locked

Implement sampling and subarray algorithms

Solve uniform 2D square sampling and longest increasing contiguous subarray. The solution maps Uniform(0,1) to Uniform(-1,1), proves uniformity by ind...

Coding & Algorithms
8
0
82 people solved
Mar 9, 2025
Zoox logo
Zoox
Easy
Data Scientist

Choose fastest way to transfer 2 TB

You need to transfer a 2 TB dataset to someone located in San Francisco as fast as possible. - What transfer method(s) would you choose and why? - St...

Coding & Algorithms
9
0
124 people solved
Nov 13, 2025
Two Sigma logo
Two Sigma
Easy
Data Scientist Locked

Merge two sorted lists

This question evaluates a candidate's competency in array manipulation and merging algorithms, emphasizing understanding of ordered data and time comp...

Coding & Algorithms
4
0
69 people solved
Feb 13, 2026
Two Sigma logo
Two Sigma
Hard
Data Scientist Locked

Merge Two Sorted Lists

This question evaluates proficiency with linked list data structures, pointer manipulation, in-place merging of sorted sequences, and general algorith...

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

Evaluate Piecewise Linear Function

This question evaluates understanding of piecewise linear interpolation, numerical reasoning, and the ability to handle ordered 2D point data and edge...

Coding & Algorithms
4
0
48 people solved
Mar 3, 2026
Meta logo
Meta
Medium
Data Scientist

Design robust group size limiting for calls

Design the admission-control and enforcement algorithm to limit group-call size under real-world race conditions. Constraints: multiple SFU edges in m...

Coding & Algorithms
7
0
55 people solved
Oct 13, 2025
TikTok logo
TikTok
Medium
Data Scientist

Implement streaming SRM detector with late events

Implement a streaming detector for sample ratio mismatch (SRM) across many concurrent experiments. Input is two topic-partitioned streams: assignments...

Coding & Algorithms
2
0
55 people solved
Oct 13, 2025
Optiver logo
Optiver
Medium
Data Scientist

Optimize switching puzzle solution

Consider a switching puzzle on an m×n grid of lights where toggling a cell flips its state and that of its orthogonal neighbors (Lights Out variant). ...

Coding & Algorithms
9
0
172 people solved
Sep 6, 2025
Optiver logo
Optiver
Medium
Data Scientist

Compare two programs for equivalence

You are given two short programs (or functions) that process an integer array A (|A| ≤ 10^ 5). Determine whether they are functionally equivalent for ...

Coding & Algorithms
10
0
115 people solved
Sep 6, 2025
Capital One logo
Capital One
Medium
Data Scientist

Critique Shell Script for Credit-Card Program Tech Round

Critique Shell Script for Credit-Card Program Tech Round Scenario Tech round for a new credit-card program: candidate is shown a 5-6 line shell script...

Coding & Algorithms
15
0
143 people solved
Aug 4, 2025
Boston Consulting Group logo
Boston Consulting Group
Medium
Data Scientist

Analyze Python Functions: Improve Readability and Efficiency

Analyze Python Functions: Improve Readability and Efficiency Scenario Zoom interview code-review segment: interviewer shares three short Python functi...

Coding & Algorithms
5
0
73 people solved
Aug 4, 2025
Amazon logo
Amazon
Easy
Data Scientist

Solve two string DP/hash problems

Solve the following two coding questions. 1) Unique Morse Code Transformations You are given an array of strings words (lowercase English letters). Us...

Coding & Algorithms
79
0
599 people solved
Feb 13, 2026
Adia logo
Adia
Easy
Data Scientist Locked

Compute Score Difference in Reversing Array Game

This question evaluates array manipulation and stateful simulation skills, parity-based control flow reasoning, and the ability to analyze time comple...

Coding & Algorithms
0
0
8 people solved
May 25, 2026
Capital One logo
Capital One
Medium
Data Scientist

Design late-tolerant streaming window aggregator

You receive an unbounded stream of events: (event_time, user_id, category). Events may arrive up to 48 hours late and are not ordered by time. Design ...

Coding & Algorithms
8
0
78 people solved
Oct 13, 2025
NVIDIA logo
NVIDIA
Hard
Data Scientist

Design and explain robust web APIs for ML inference

Design an HTTP API for Image-Based Model Predictions Context: Design an HTTP REST API that serves predictions for image inputs (e.g., classification, ...

Coding & Algorithms
3
0
65 people solved
Oct 13, 2025
Uber logo
Uber
Medium
Data ScientistNew Grad Locked

Implement FizzBuzz

This question evaluates basic programming and algorithmic reasoning, including control flow, modular arithmetic, string handling, and the ability to a...

Coding & Algorithms
4
0
64 people solved
Mar 22, 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