TL;DR
The Hat Color Puzzle (Countable Prisoners): A canonical quantitative trading interview question at intermediate difficulty. Commonly asked at Jane Street, Two Sigma, DE Shaw.
By Valenke Exam Prep Team·Last updated 2026-06-01
intermediateLogic & Constraints
The Hat Color Puzzle (Countable Prisoners)
Asked at: Jane Street, Two Sigma, DE Shaw
Problem
A countably infinite line of prisoners each receive a hat colored red or blue. Each prisoner can see all hats in front of them (infinitely many) but not their own or those behind. Starting from the back, each must guess their hat color aloud (everyone hears). Devise a strategy that guarantees at most finitely many wrong guesses.
Related concepts
Ready to practice for the Valenke Finance Exam?
Adaptive practice powered by Item Response Theory targets your weak areas. Start with 3 free sessions.
Start free practice →