How would you architect a system for rapid experimentation and validation?

Tests designing decoupled experimentation infrastructure that scales past 1M users. Strong answers split assignment, flags, metrics, and analysis into independent event-driven services with change data capture isolating production.
What's really being asked
Whether you understand that experimentation platforms fail at hypergrowth when they are tightly coupled to production systems. The interviewer wants to see you separate concerns across assignment, flagging, metrics, and analysis so that a traffic spike from ten thousand to one million users does not create a cascading failure. They also care if you know how to keep experiment data consistent when dozens of tests run simultaneously across millions of users.
The full answer
First, an event-driven microservices layout with four to five independent services: an assignment service that resolves which variant a user sees; a feature flag service that controls exposure; a metrics pipeline that ingests and enriches user events; an analysis service that computes statistical winners; and a configuration service that stores experiment parameters. Second, async communication between these services via an event bus or stream so that a backup in analytics does not block feature flag lookups. Third, change data capture on the production database to feed the metrics pipeline without adding query load to the main application. Fourth, dynamic user segmentation handled by evaluating segment rules at assignment time or caching segment membership in a low-latency store rather than running heavy joins on every request.
The mistakes people make
Proposing a single monolithic service that handles flags, assignment, and analytics together; this creates a chokepoint where one slow query degrades the entire user experience. Suggesting direct synchronous calls from the product backend to the analytics warehouse for every user action; this adds hundreds of milliseconds to each request and collapses under load. Ignoring data consistency by allowing the assignment service and metrics pipeline to read from different database replicas that are seconds out of sync; this corrupts experiment results.
What usually comes next
How would you handle session-level consistency so that a user sees the same variant across devices? What happens to in-flight experiments when the configuration service deploys a new rule set? How do you compute metrics like revenue per user when events are scattered across ten different microservices?
A concrete example
Imagine a checkout flow experiment. The assignment service returns variant B to the mobile client in under five milliseconds because it reads from a regional cache. The user completes purchase; the order service emits a PurchaseCompleted event to Kafka. The metrics pipeline consumes the event, joins it with the assignment log via change data capture, and writes a pre-aggregated row into the analysis service. When traffic doubles next quarter, you scale only the Kafka consumers and the analysis workers, leaving the assignment cluster untouched.
Interview question
A platform running dozens of simultaneous A/B tests must scale from ten thousand to one million users without cascading failures or corrupted results. Which architectural choice best achieves both goals?
- a.Consolidate feature flags, user assignment, and analytics into one monolithic service that queries the production database directly for real-time metrics.
- b.Deploy separate microservices for assignment and analytics, but have them communicate via synchronous REST and let the metrics pipeline poll the production database for changes.
- c.Route every user action through synchronous calls to the analytics warehouse and isolate load by having the assignment service and metrics pipeline read from different database replicas.
- d.Use independent event-driven services connected by an event bus, feed the metrics pipeline via change data capture, and resolve user segments from a low-latency cache at assignment time.Correct
Why? this is the answer
Asynchronous event-driven services with change data capture isolate production load while keeping assignments and metrics perfectly aligned; the tempting distractor suggesting separate database replicas introduces replication lag that corrupts experiment results by misattributing events to variants.
Just read this? Test yourself on what you have been reading.
Read the original → statsig.com
- #experimentation
- #system design
- #feature flags
- #event-driven architecture
- #microservices
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on experimentation — each one lists the topics its interview covers.
See open roles