Design a Consistent-Hashing-Based A/B Testing Framework

viaGlassdoor

Requirements: Design a framework that can consistently bucket users into experiment variants (A/B/n testing) for feature rollout, using consistent hashing so the same user reliably lands in the same bucket across requests/services.

Design: Hash a stable user identifier (user ID or device ID) combined with the experiment name onto a hash ring (or simple modulo bucketing with a large hash space) to deterministically assign a variant, ensuring minimal reshuffling when the number of buckets/experiments changes. Discuss why consistent hashing (vs plain modulo) minimizes the fraction of users who flip variants when experiment configuration changes, how to layer multiple concurrent experiments without collision (hashing on experiment_id + user_id), and how to persist/override assignments for QA or sticky rollouts.

Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account