Experimentation Platforms and Infrastructure Questions
Infrastructure for A/B testing and experimentation: assignment/bucketing, metric pipelines for experiments, guardrail and variance-reduction plumbing, and experiment result storage. Covers building the platform that powers trustworthy online experiments at scale. Distinct from the statistics of experiment analysis.
Implement a simulator (pseudocode or Python) that models user assignment across multiple overlapping experiments and measures the bias this introduces into a treatment-effect estimate when the assignments are not independent. Describe the simulation parameters you would vary and what output would tell you the bias is large enough to worry about.
Sample Answer
Direct answer
Simulate two overlapping experiments A and B where every user is independently assigned a treatment indicator for each, generate an outcome as a function of both treatments plus an interaction term plus noise, then measure the bias introduced when assignment is NOT actually independent (for example, a bucketing bug that correlates the two assignments) by comparing the naive difference-in-means estimate of A's effect under independent versus correlated assignment.
Structured elaboration
def simulate_overlapping_experiments(n_users, true_effect_A, true_effect_B,
interaction, independent_assignment, seed):
rng = random.Random(seed)
baseline = 10.0
rows = []
for i in range(n_users):
treat_A = rng.random() < 0.5
if independent_assignment:
treat_B = rng.random() < 0.5
else:
# correlated: a bucketing-bug shape, B mostly copies A's assignment
treat_B = treat_A if rng.random() < 0.9 else (rng.random() < 0.5)
y = (baseline + (true_effect_A if treat_A else 0) + (true_effect_B if treat_B else 0)
+ (interaction if (treat_A and treat_B) else 0) + rng.gauss(0, 5))
rows.append((treat_A, treat_B, y))
treat_vals = [y for (a, b, y) in rows if a]
control_vals = [y for (a, b, y) in rows if not a]
return sum(treat_vals)/len(treat_vals) - sum(control_vals)/len(control_vals)
Simulation parameters to vary: the correlation strength between the two assignments (from fully independent to fully correlated), the interaction term's magnitude (a larger interaction amplifies the bias from non-independence), and the individual effect sizes of A and B. The output that tells you the bias is large enough to worry about is simply the difference between the naive estimate under correlated assignment and the same estimate under independent assignment; a difference that's small relative to the true effect size of A is probably tolerable noise, while one that's a large fraction of (or larger than) the true effect is a real, actionable bias.
Worked example (executed and derived analytically)
With true_effect_A = 2.0, true_effect_B = 1.0, interaction = 3.0: under independent assignment, the simulated naive effect of A converged to 3.502, matching the analytical prediction of effect_A + interaction times P(B=1) = 2.0 + 3.0 times 0.5 = 3.5. Under a 90%-correlated bucketing-bug assignment, the simulated estimate converged to 5.754, matching the analytical prediction (using P(B=1|A=1)=0.95 and P(B=1|A=0)=0.05) of 15.80 minus 10.05 = 5.75. The bias introduced by non-independent assignment here is 2.25, more than two-thirds of A's true effect size, which is large enough that any real experimentation platform should treat this as a serious problem, not a rounding error.
Trade-offs and pitfalls
The most useful adversarial case to construct is exactly this one, deliberately correlating the two assignments to mimic a realistic bucketing bug (shared low-entropy hash inputs across experiments), rather than only testing with fully independent assignment, which would never reveal the bias this simulator exists to quantify. A subtlety worth flagging explicitly: even under fully independent assignment, A's naive effect estimate is NOT simply true_effect_A, it legitimately includes A's average interaction with B (since B is independent of A but not absent), which is expected and correct, not itself a bias; the actual bias is specifically the ADDITIONAL shift caused by non-independence, which is why comparing the correlated case against the independent case, not against the bare true_effect_A, is the right measurement.
Design the self-service UI and guardrails for an experimentation platform that let product teams create and launch experiments without engineering help, while preventing misuse. Cover experiment templates, validation checks, a rollout wizard, an experiment catalog, and permission tiers, and sketch the user flow from idea to launch.
Sample Answer
Direct answer
Self-serve UI design for an experimentation platform means giving product teams the ability to create and launch an experiment without engineering help, while the platform itself enforces the guardrails a human reviewer used to provide manually: templates that start teams from a known-good configuration, validation checks that block an inconsistent launch, a rollout wizard that turns a risky all-at-once launch into a guided, gated ramp, and permission tiers that scale the amount of self-service allowed to the risk of what's being touched.
Structured elaboration
A typical creation flow: (1) pick an experiment template (a standard A/B test, a feature-flag rollout, a multi-variant test) rather than starting from a blank form, since templates encode good defaults and reduce the chance of a misconfigured experiment; (2) define the hypothesis and primary/guardrail metrics from a curated, searchable catalog rather than free text, so metric definitions stay consistent across teams; (3) set targeting and allocation, with real-time validation (does this targeting rule match a non-zero, non-suspicious population; do allocations sum to 1.0); (4) a rollout wizard step that replaces a single "launch to X%" field with a guided ramp schedule: the user picks a starting percentage (defaulting to a small value like 1-5% for anything not already proven safe), the wizard proposes subsequent stages (5%, 25%, 50%) each gated by a minimum soak time and passing the automated pre-launch and guardrail checks, and the user can accept the default schedule or customize it, with the platform visually showing "you are here" against the planned stages once the experiment is live; (5) a pre-launch checklist screen that surfaces anything the automated validity checks flag, which the user must acknowledge or fix before the launch button is enabled; (6) an experiment catalog view so anyone can see what's currently running on a given surface, which doubles as the interference-detection surface described elsewhere.
Permission tiers gate what a team can do unassisted: a low-risk experiment (UI copy, non-payment surface, traffic under a threshold) can go from creation to launch in minutes with no review, including using the rollout wizard's default ramp schedule unmodified; anything touching payments, a schema change, or traffic above a threshold requires an explicit approval step from a designated approver role, encoded as a workflow state rather than an out-of-band Slack message, and the wizard additionally requires that approver's sign-off before it will advance the ramp past its first stage.
Worked example
A growth team wants to test three variants of an onboarding screen. Starting from an "A/B/n test" template pre-fills the standard metric set (activation rate, day-1 retention as a guardrail) and standard allocation logic, so the team only has to specify the actual variants and targeting, cutting a configuration task that used to take a platform engineer half a day down to something a PM can complete in fifteen minutes, with the same validity checks running either way. When they reach the rollout wizard, the default 1% -> 10% -> 50% schedule is proposed automatically since the experiment is UI-only and under the platform's low-risk traffic threshold; the team accepts the default rather than customizing it, and the wizard automatically advances the ramp to the next stage once each stage's minimum soak time and guardrail checks pass, with no further manual clicks required.
Trade-offs and pitfalls
The design tension is discoverability versus power: a UI simple enough for a first-time user to configure alone tends to hide advanced options (custom stratification, non-standard traffic layers, a fully custom ramp schedule) that power users legitimately need. Most platforms resolve this with progressive disclosure (an "advanced settings" section collapsed by default, and a rollout wizard that proposes sensible default stages but allows a power user to edit them) rather than either a stripped-down UI that frustrates experienced teams or a fully-exposed UI that overwhelms new ones.
What core instrumentation best practices should be enforced for the events and metrics an experimentation platform depends on? Cover naming conventions, schema versioning, idempotency, event enrichment, and backward compatibility.
Sample Answer
Direct answer
The core instrumentation practices are: consistent naming conventions across teams, explicit schema versioning, idempotent event delivery, event enrichment at ingestion rather than at query time, and backward compatibility whenever a schema changes, because a violation of any one of these quietly corrupts every metric computed downstream without producing an obvious error.
Structured elaboration
- Naming conventions: a shared taxonomy (verb_object style, like purchase_completed rather than one team's buy_done and another's checkout_success for the same underlying action) so a metric defined once can be reused across teams instead of every team redefining "purchase" slightly differently.
- Schema versioning: every event schema carries a version field, and a schema change is additive (new optional fields) rather than repurposing an existing field's meaning, so historical events remain readable by current code.
- Idempotency: events carry a unique event id so a retry (from a flaky network on the client, or a replay after a pipeline failure) can be deduplicated rather than double-counted, which matters enormously for count and sum metrics specifically.
- Event enrichment: joining an event to its experiment exposure, user segment, or session context should happen once, at ingestion, and be stored on the enriched record, rather than re-joined by every downstream query, both for performance and so every team computing a metric from the same enriched table agrees on what "exposed" meant at that moment.
- Backward compatibility: a schema change should never break a metric-computation job that hasn't yet been updated to read the new field, which in practice means never removing or repurposing a field, only adding.
Worked example
A team renames a field from user (an integer id) to user_id (a string id) in place, without a version bump, to "clean things up." Every metric job still filtering on the old field silently sees no matches for new events and reports a metric that quietly stops updating, which looks exactly like "the experiment has no effect" rather than "the pipeline broke," and can go unnoticed for days because nothing errors.
Trade-offs and pitfalls
Enforcing all of this centrally (a single shared schema registry every team must go through) adds process overhead that slows down individual teams shipping new events. The pragmatic middle ground most platforms land on is: a small number of core, centrally-governed event types (exposure, generic conversion) that everyone must use as-is, plus a flexible custom-properties field for team-specific context that doesn't require central review, so the fields that feed universal validity checks (like SRM) stay standardized while teams retain flexibility for their own custom analysis.
What traffic allocation strategies do experimentation platforms use, static splits, progressive rollouts, hash-based bucketing, and weighted allocation? For each, give a short example of when it is the right choice and its main trade-off.
Sample Answer
Direct answer
Static splits are simplest and right when you want a fixed, known percentage for the whole experiment duration; progressive rollouts (ramping traffic up in stages) are right when you want to limit blast radius from an undiscovered bug before committing to a larger split; hash-based bucketing is the underlying mechanism that makes any of these deterministic and consistent per user; and weighted allocation (uneven splits, like 90/10) is right when you want to minimize exposure to a risky variant while still collecting enough data to learn from it.
Structured elaboration
- Static splits (say, a fixed 50/50 for the whole run): simplest to reason about and analyze, appropriate once you already trust the variant is safe and just need a clean, stable comparison.
- Progressive rollouts (1% then 5% then 25% then 50%, each stage gated by automated checks): the right choice specifically when the variant itself is new and unproven, since it limits how many users are affected by an undiscovered bug before the team has had a chance to observe it at small scale; the trade-off is a slower path to reaching full statistical power, since the effective sample size only fully accrues once the ramp reaches its final percentage.
- Hash-based bucketing: not really an alternative to the others so much as the underlying mechanism that makes ANY of them deterministic; a progressive rollout is typically implemented as the same hash function with a shifting threshold over time, so a user who's included at 10% stays included as the ramp expands to 25%, rather than being re-randomized at each stage.
- Weighted allocation: appropriate when you want to keep exposure to a risky or resource-intensive variant small on principle (not just as a temporary ramp stage, but as the intended steady-state split, like a 90/10 test of an expensive-to-serve feature), trading some statistical power for a smaller worst-case exposure if the variant turns out badly.
Worked example
A team launching a genuinely new checkout flow chooses a progressive rollout rather than a static 50/50 split, starting at 1% for the first day specifically because the flow has never run in production before; once the first day's automated checks (SRM, guardrails, crash rate) pass cleanly, the ramp proceeds to 10%, then 50%, reaching the final split over about a week rather than immediately, which limits how many users would have been affected had a serious bug only surfaced once real traffic hit the new flow.
Trade-offs and pitfalls
Choosing a static 50/50 split for a genuinely unproven, high-risk change skips the safety benefit progressive rollout provides, exposing the maximum possible share of users to an undiscovered bug from the very first moment; choosing an overly cautious progressive rollout for a low-risk, well-understood change (a copy tweak) needlessly slows down reaching statistical power for no real safety benefit. The right choice is calibrated to how much genuine uncertainty exists about the variant's safety, not applied uniformly to every experiment regardless of risk.
Describe the purpose and core components of an experimentation platform used by product and ML teams: assignment, telemetry ingestion, metric computation, experiment configuration, analysis, and rollout. Walk through how a single experiment moves through these stages from hypothesis to rollout, naming which component owns each stage and the most common failure mode at each one.
Sample Answer
Direct answer
An experimentation platform exists to move an idea from a hypothesis to a shipped decision safely: it assigns users to variants, ingests the telemetry those users generate, computes metrics from that telemetry, lets a team configure and target the experiment, analyzes the result, and finally gates the rollout. Each of those is usually a distinct component, and most production incidents trace back to exactly one of them failing.
Structured elaboration
Walking the same experiment through each stage:
- Hypothesis and configuration. A team defines what they're testing, which metric decides success, and what the eligible population is. This is where mistakes are cheapest to catch (a badly defined hypothesis or an unreachable target metric) and most expensive to catch later.
- Assignment. The assignment service deterministically buckets each eligible user into control or a variant, usually via a hash of the user id and experiment id, and this must be consistent across every service that later needs to know a user's bucket.
- Telemetry ingestion. Client and server events (exposures, clicks, purchases) stream into an event pipeline. This is the layer where instrumentation bugs (dropped events, a client that never fires the exposure event) silently corrupt every downstream number without triggering an obvious error.
- Metric computation. A batch or streaming job joins exposures to outcome events and produces per-variant metric values, confidence intervals, and guardrail checks like Sample Ratio Mismatch.
- Analysis and decision. A human, or an automated report, reads the computed metrics against the pre-registered hypothesis and decides ship, iterate, or kill.
- Rollout. The winning variant is ramped to 100%, usually through the same feature-flag/config layer that ran the experiment, so "ship the winner" is a configuration change rather than a new code deploy.
The most common failure mode at each stage, in order: a hypothesis with no measurable success metric; an assignment bug that correlates two experiments that were supposed to be independent; a dropped or duplicated event; a join bug in metric computation (most often around exposure deduplication or late-arriving events); confirmation bias in the read-out; and a rollout that reintroduces the very regression the experiment was designed to catch, because rollout bypassed the same guardrails the experiment enforced.
Worked example
A checkout-page redesign experiment ships a strong "up" result in the platform's dashboard. Two weeks after 100% rollout, revenue is flat. Tracing backward: the assignment service correctly split users 50/50, telemetry was intact, but the metric-computation job had joined exposure events to purchase events using a 24-hour attribution window that excluded a meaningful share of next-day purchases in the treatment arm (which had a slower but more deliberate checkout flow). The "lift" was a measurement artifact of the attribution window, not a real effect. This is exactly why the metric-computation stage, not just the assignment stage, needs its own validity checks before a result is trusted.
Trade-offs and pitfalls
Treating these as one monolithic "experimentation platform" component instead of separately-owned services is the single biggest scaling mistake: it means one team ends up debugging all five failure classes above, and nobody develops the specialized instincts (SRM triage, join-window bugs, attribution logic) that come from owning just one layer. The counter-pressure is integration cost: five cleanly separated services need well-defined, versioned contracts between them, or a schema change in telemetry silently breaks metric computation downstream.
Unlock Full Question Bank
Get access to all Experimentation Platforms and Infrastructure interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.