Randomized Map with Constant-Time Operations

Asked at Quora · Coding Questions · Difficulty: Medium · Last asked Jul 15, 2026

Design a key-value container that supports inserting records, looking them up, and drawing a uniformly random record, each in O(1) average time.

Loading the problem…