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

Implement sliding-window device anomaly

Streaming detection algorithm: Implement a function process_logins(stream) that consumes a time-ordered stream of login events (user_id, ts, device_id...

Coding & Algorithms
4
0
51 people solved
Oct 13, 2025
Microsoft logo
Microsoft
Hard
Data Scientist

Implement lower_bound on unknown-size sorted array

Lower Bound in Unknown-Length Nondecreasing Array via API Setup You are given a non-decreasing integer array A of unknown length n. You cannot access ...

Coding & Algorithms
3
0
52 people solved
Oct 13, 2025
DoorDash logo
DoorDash
Medium
Data Scientist

Implement minimum window substring with counts

Implement min_window_with_counts(s, t) Task Write a function: - min_window_with_counts(s: str, t: str) -> tuple[int, int] that returns the inclusive (...

Coding & Algorithms
8
0
103 people solved
Oct 13, 2025
Pinterest logo
Pinterest
Easy
Data Scientist

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

Coding & Algorithms
12
0
87 people solved
Oct 13, 2025
TCS logo
TCS
Medium
Data Scientist

Find duplicates in a list efficiently

Given a Python list that can contain integers (possibly negative) and may be very large, write code and explain approaches to find all values that app...

Coding & Algorithms
18
0
178 people solved
Oct 13, 2025
HBO logo
HBO
Medium
Data Scientist

Implement Director awards with Python OOP

Python OOP Exercise: Director extends Cast Context You are working with a simple class hierarchy where Director extends Cast. Implement a robust, test...

Coding & Algorithms
1
0
28 people solved
Oct 13, 2025
Apple logo
Apple
Hard
Data Scientist

Compute optimal matrix-chain multiplication order

Matrix Chain Multiplication: Optimal Parenthesization and Analysis You are given five matrices to multiply: A1 (10×30), A2 (30×5), A3 (5×60), A4 (60×2...

Coding & Algorithms
6
0
62 people solved
Oct 13, 2025
Microsoft logo
Microsoft
Easy
Data Scientist

Reverse a list in-place

Coding Task: Reverse a List In-Place (Python) Context You're implementing a utility function during a technical screen. The function must reverse a Py...

Coding & Algorithms
11
0
94 people solved
Oct 13, 2025
Citadel logo
Citadel
Medium
Data Scientist Locked

Match a string with wildcard pattern recursively

This question evaluates proficiency in string pattern matching, recursive problem decomposition, and algorithmic optimization including handling wildc...

Coding & Algorithms
4
0
55 people solved
Oct 9, 2025
IBM logo
IBM
Easy
Data Scientist

Find minimum operations to make array sorted

Problem You are given an integer array a of length n. Define one operation as follows: 1. Remove the first element x = a[0]. 2. Append x to the end of...

Coding & Algorithms
4
1
65 people solved
Oct 3, 2025
Easy
Data ScientistIntern

Find two numbers that sum to target

Problem You are given an integer array nums (length n) and an integer target. Return the indices (i, j) such that: - i != j - nums[i] + nums[j] == tar...

Coding & Algorithms
4
0
35 people solved
Sep 28, 2025
Disney logo
Disney
Medium
Data Scientist

Solve matrix add, frequency count, longest consecutive

You are asked to solve the following 3 coding tasks (in any language). Implement each as a function. 1) Add two matrices Input: Two 2D integer arrays ...

Coding & Algorithms
6
0
43 people solved
Sep 13, 2025
Optiver logo
Optiver
Medium
Data Scientist

Solve a Skyscraper puzzle efficiently

Design and implement a solver for the Skyscraper logic puzzle on an $N \times N$ grid, where $3 \le N \le 7$. The board is a grid of building heights....

Coding & Algorithms
47
0
329 people solved
Sep 6, 2025
Bank of America logo
Bank of America
Medium
Data Scientist

Convert number words to integer

Given a line containing an English phrase representing a number in the range −999,999,999 to 999,999,999, convert it to its integer value. Supported w...

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

Count subarrays equal to target

Count subarrays equal to target Given an integer array nums and an integer k, count the number of contiguous subarrays whose sum equals k. Solve it in...

Coding & Algorithms
2
0
36 people solved
Aug 10, 2025
Akuna Capital logo
Akuna Capital
Medium
Data Scientist

Maximize profitable pairs

Maximize profitable pairs You are given an array profits of n integers representing net profit per item and an integer threshold T. You may form disjo...

Coding & Algorithms
5
0
41 people solved
Aug 10, 2025
C3 AI logo
C3 AI
Hard
Data Scientist

Find longest substring with at least k repeats

Find longest substring with at least k repeats Longest substring where each character appears at least k times You are given: - a string s consisting ...

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

Compute statistics in data stream

Question Design a data structure that supports computing the current max, mean, and mode for an unbounded integer data stream. Estimate the memory usa...

Coding & Algorithms
2
0
46 people solved
Aug 4, 2025
Meta logo
Meta
Medium
Data Scientist

Solve Data-Structure Problems in Python Interview Round

Scenario Interview coding round focusing on simple data-structure problems in Python. Question Given an integer, rearrange its digits (considering onl...

Coding & Algorithms
4
0
47 people solved
Aug 4, 2025
Shopify logo
Shopify
Medium
Data Scientist

Calculate Jaccard Similarity Score for Two String Lists

Scenario During pair programming, the interviewer asks you to compare two lists of merchant tags and quantify their similarity. Question Implement a P...

Coding & Algorithms
11
0
148 people solved
Aug 4, 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