Problem database last updated: June 20, 2025

TTwo Sigma logo

Two Sigma Coding Interview Questions

20 problems · 4 Easy, 11 Medium, 5 Hard · Ranked #93 of 458

Difficulty breakdown

4 Easy

20% · avg 23%

11 Medium

55% · avg 59%

5 Hard

25% · avg 18%

Top topics

array
65%
dynamic-programming
35%1.8x
binary-search
25%2.8x
string
25%
math
20%1.6x
hash-table
20%

Interview profile

Based on 20 reported problems, Two Sigma interviews are slightly harder than average - 25% Hard vs 18% across all companies. The majority (55%) of questions are Medium difficulty, which is typical for companies that want to see solid fundamentals without excessive trick questions.

Compared to the industry average, Two Sigma puts unusual emphasis on trie (10% of problems, 3.8x the industry average), simulation (15% of problems, 3.5x the industry average), graph (10% of problems, 3.4x the industry average). If you're short on time, these are the categories to double down on.

The most common topics are array (65%), dynamic-programming (35%), binary-search (25%), string (25%). Problems below are sorted by frequency, the ones at the top are asked most often.

All 20 problems

Minimum Operations to Reduce an Integer to 0

Solve

You are given a positive integer n, you can do the following operation any number of times:

MediumVery Likely
dynamic-programminggreedybit-manipulation

Number of Provinces

Solve

There are n cities. Some of them are connected, while some are not. If city a is connected directly with city b, and city b is connected directly with city c, t...

MediumVery Likely
depth-first-searchbreadth-first-searchunion-find

Random Pick with Weight

Solve

You are given a 0-indexed array of positive integers w where w[i] describes the weight of the ith index.

MediumVery Likely
arraymathbinary-search

Maximum Subarray Sum with One Deletion

Solve

Given an array of integers, return the maximum sum for a non-empty subarray (contiguous elements) with at most one element deletion. In other words, you want to...

MediumVery Likely
arraydynamic-programming

Maximum Sum Circular Subarray

Solve

Given a circular integer array nums of length n, return the maximum possible sum of a non-empty subarray of nums.

MediumVery Likely
arraydivide-and-conquerdynamic-programming

Longest String Chain

Solve

You are given an array of words where each word consists of lowercase English letters.

MediumVery Likely
arrayhash-tabletwo-pointers

Game of Life

Solve

According to Wikipedia's article: "The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway...

MediumVery Likely
arraymatrixsimulation

Power of Four

Solve

Given an integer n, return true if it is a power of four. Otherwise, return false.

EasyVery Likely
mathbit-manipulationrecursion

Wildcard Matching

Solve

Given an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '' where:

HardVery Likely
stringdynamic-programminggreedy

Multiply Strings

Solve

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

MediumVery Likely
mathstringsimulation

Intersection of Two Arrays

Solve

Given two integer arrays nums1 and nums2, return an array of their intersection. Each element in the result must be unique and you may return the result in any...

EasyVery Likely
arrayhash-tabletwo-pointers

Word Search II

Solve

Given an m x n board of characters and a list of strings words, return all words on the board.

HardVery Likely
arraystringbacktracking

Parallel Courses III

Solve

You are given an integer n, which indicates that there are n courses labeled from 1 to n. You are also given a 2D integer array relations where relations[j] = [...

HardLikely
arraydynamic-programminggraph

Merge k Sorted Lists

Solve

You are given an array of k linked-lists lists, each linked-list is sorted in ascending order.

HardLikely
linked-listdivide-and-conquerheap-priority-queue

Minimum Space Wasted From Packaging

Solve

You have n packages that you are trying to place in boxes, one package in each box. There are m suppliers that each produce boxes of different sizes (with infin...

HardLikely
arraybinary-searchsorting

Design HashMap

Solve

Design a HashMap without using any built-in hash table libraries.

EasyLikely
arrayhash-tablelinked-list

Design Memory Allocator

Solve

You are given an integer n representing the size of a 0-indexed memory array. All memory units are initially free.

MediumLikely
arrayhash-tabledesign

Sum of Square Numbers

Solve

Given a non-negative integer c, decide whether there're two integers a and b such that a2 + b2 = c.

MediumLikely
mathtwo-pointersbinary-search

Search Suggestions System

Solve

You are given an array of strings products and a string searchWord.

MediumLikely
arraystringbinary-search

Best Time to Buy and Sell Stock

Solve

You are given an array prices where prices[i] is the price of a given stock on the ith day.

EasyLikely
arraydynamic-programming

How often are these problems asked?

Frequency scores are based on crowdsourced interview reports. A higher score means the problem has been reported more often in recent Two Sigma interviews.

Very Likely

75-100%

Likely

50-74%

Sometimes

25-49%

Rare

0-24%

Preparing for your Two Sigma coding interview

Two Sigma interviews focus heavily on array, dynamic-programming, binary-search problems. If you're short on time, these are the categories to prioritize. The problems on this page are sorted by frequency, so start from the top and work your way down.

Beyond solving problems, practice explaining your approach. Two Sigma interviewers care about your thought process - how you break down a problem, consider edge cases, and evaluate tradeoffs between solutions. A clean O(n) solution you can explain clearly beats an O(log n) solution you can't articulate.

Looking for more companies? Browse all 458 companies in our directory, or sharpen your fundamentals with our free data structure visualizers and AI-powered DSA tutor.

Frequently Asked Questions

What coding problems does Two Sigma ask in interviews?add

Two Sigma has been reported to ask 20 distinct coding problems. The most common topics are array, dynamic-programming, binary-search. 4 are Easy difficulty, 11 are Medium, and 5 are Hard. Problems are sorted by frequency - the ones at the top are asked most often.

How hard are Two Sigma coding interviews?add

Based on 20 reported problems, Two Sigma interviews are slightly harder than average - 25% Hard vs 18% across all companies. 55% of questions are Medium difficulty. Focus on the high-frequency Medium problems first, then work through the Hard ones.

How should I prepare for a Two Sigma coding interview?add

Start with the highest-frequency problems listed on this page. Focus on the core topics: array, dynamic-programming, binary-search. Practice solving them under time pressure and explaining your approach out loud. Mock interviews with AI can simulate the real experience.

Other companies to explore

Ready to ace your Two Sigma interview?

Simulate a real Two Sigma coding interview with an AI interviewer. Get a scorecard with specific feedback on your problem-solving, code quality, and communication.

Simulate a Two Sigma interview with AIarrow_forward