Design a Set with Uniform Random Sampling
Asked at Google · Coding Questions · Difficulty: Medium
Design a set of distinct values that can also hand back a random member, each member equally likely. Adding, removing, membership checks and sampling must all stay fast as the set grows, so no operation may scan the members.
Loading the problem…
More Google interview questions
- LLM conceptual questions
- Implement a Nested Tic-Tac-Toe Game Engine
- ML Fundamentals Deep Dive (AI/ML & MLE Roles)
- Design a Real-Time Product Recommendation System
- Implement Scaled Dot-Product Attention
- Design a Multi-Tenant, Multi-Region API Rate Limiter