Skip to main content

TL;DR

The Birthday Paradox in Hash Collisions: A canonical quantitative trading interview question at foundation difficulty. Commonly asked at Jane Street, Two Sigma, HRT.

By Valenke Exam Prep Team·Last updated 2026-06-01
foundationProbabilistic Algorithm Analysis

The Birthday Paradox in Hash Collisions

Asked at: Jane Street, Two Sigma, HRT

Problem
A hash function maps inputs to one of nn buckets uniformly at random. After hashing kk distinct inputs, what is the expected number of collisions? Specifically, find the smallest kk (in terms of nn) such that the probability of at least one collision exceeds \ rac12\ rac{1}{2}.

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 →