Build From Scratch: Database, Stream Merger, Huffman & Hash Map
Two Sigma's screens like to take the library away. Instead of spotting a pattern, you build the structure yourself, in a shared pad, inside an hour. For 2026 that mostly means a Premium question. A software engineer intern was asked to build "a mini SQL db" in a January 2026 first round. An April 2026 phone screen asked for one, and a New York candidate spent a one-hour Python round in July 2026 on "a mock database class".
A January 2026 technical round asked for a class that merges delta-encoded sensor streams. A Huffman-style encoder and decoder came up on a December 2025 technical screen, and a hash map with no built-in hash table came up in screens from September to November 2025. Each one below is a runnable Python class, and its tests run in the order you'd build it.
Two SigmaPremium lesson · Coding round
The 4 Two Sigma problems are below.
- A Premium questionCoding · Hard · Frequently asked
- A Premium questionCoding · Medium
- A Premium questionCoding · Medium
+ 1 more in this lesson
Each with hints, the follow-up and a tested solution.
Get the Two Sigma questions$49 a year · all 107 companies · instant access
20,000+ candidate reports
Two Sigma interview guideKnow what Two Sigma asks before you walk in.
21 coding · 4 system design · 13 behavioral questions
Get their questions first.
InterviewLegend is independent and not affiliated with or endorsed by any company it covers.