Two Sigma Coding & Algorithms Interview Questions

Practice the exact questions companies are asking right now.

34 Questions 1 Company07.31.2026
Showing 14 results
Role
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
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
Two Sigma logo
Two Sigma
Hard
Software Engineer

Implement binary encode/decode with frequency tree

Problem Implement a binary encoding and decoding scheme for strings based on character frequencies (Huffman-like coding). You must implement two funct...

Coding & Algorithms
8
0
132 people solved
Dec 15, 2025
Two Sigma logo
Two Sigma
Hard
Data Scientist

Assign 2n Workers to Two Tasks to Minimize Total Time

You manage 2n workers and two tasks, A and B. Every worker must be assigned to exactly one task, and each task must be staffed by exactly n workers. W...

Coding & Algorithms
0
0
7 people solved
Nov 28, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Implement Univariate Linear Regression with Ordinary Least Squares

Implement univariate (simple) linear regression fitted in batch with the ordinary least squares (OLS) closed-form solution. You must implement the for...

Coding & Algorithms
0
0
4 people solved
Nov 15, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Maximum-Product Simple Path in a Complete Directed Graph

You are given a complete directed graph with n nodes labeled 0 through n - 1. For every ordered pair of distinct nodes (i, j), there is a directed edg...

Coding & Algorithms
0
0
5 people solved
Nov 15, 2025
Two Sigma logo
Two Sigma
Hard
Data ScientistIntern

Count Distinct Island Shapes in a Binary Grid

You are given an m x n binary grid grid, where grid[i][j] is either 0 (water) or 1 (land). An island is a maximal group of 1-cells connected 4-directi...

Coding & Algorithms
0
0
7 people solved
Nov 15, 2025
Two Sigma logo
Two Sigma
Medium
Software Engineer

All Subsequences After Deleting One Character

You are given a string s of length n consisting of lowercase English letters. Consider every string that can be obtained by deleting exactly one chara...

Coding & Algorithms
0
0
7 people solved
Sep 19, 2025
Two Sigma logo
Two Sigma
Medium
Software Engineer

Autoscale a Server Fleet from Throughput Readings

You run a service on a fleet of identical servers behind a load balancer. Each server can handle at most limit units of throughput. A monitoring syste...

Coding & Algorithms
0
0
5 people solved
Sep 19, 2025
Two Sigma logo
Two Sigma
Medium
Machine Learning Engineer

Solve tree partition and IPO allocation

1) Tree partitioning for minimum difference: Given a rooted tree as an array parent of length n (parent[i] gives the parent of node i, and parent[root...

Coding & Algorithms
5
0
72 people solved
Sep 6, 2025
Two Sigma logo
Two Sigma
Medium
Software Engineer

Maximize Capital by Completing at Most k Projects

A startup has an initial amount of capital w and is choosing which projects to take on before an important funding deadline. There are n candidate pro...

Coding & Algorithms
1
0
10 people solved
Aug 26, 2025
Two Sigma logo
Two Sigma
Medium
Software Engineer

Solve capital selection and grid escape

Solve capital selection and grid escape Implement two functions for algorithmic practice: 1) MaximizeCapitalAfterProjects(k, initialCapital, requiredC...

Coding & Algorithms
8
0
117 people solved
Aug 9, 2025
Two Sigma logo
Two Sigma
Medium
Software Engineer

Maximum Group of Pairwise Strangers in an Acquaintance Tree

You are given a social network of n people, labeled 0 through n - 1. For some pairs of people, it is known that the two people in the pair know each o...

Coding & Algorithms
0
0
5 people solved
Jul 23, 2025
Two Sigma logo
Two Sigma
Hard
Software Engineer

Compute maximum currency exchange rate

Compute maximum currency exchange rate You are given a set of currencies and the direct exchange rates between some pairs of them. Each direct exchang...

Coding & Algorithms
17
0
147 people solved
Jul 20, 2025

Explore more Two Sigma Coding & Algorithms interview questions

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

By role
Other categories at Two Sigma
Coding & Algorithms questions at other companies
Browse all