KatInterview

Architecture Decisions for an Online Experimentation System

System DesignModel answer
MediumModel answerSystem Designsystem-designab-testinglatency

Last updated

Architect an experimentation engine balancing sync/async validation, strict latency budgets, and experiment health monitoring.

In a system design discussion focused on infrastructure for online A/B testing, you are asked to dive into three core operational challenges:

  1. Validation Pipeline (Sync vs. Async): Deciding which configuration and data integrity checks must block operational workflows versus running asynchronously in the background.
  2. Latency Budget Preservation: Designing the evaluation/assignment pipeline so product microservices can determine feature variants without exceeding tight latency SLAs.
  3. Health Checking & Safety Automation: Monitoring both infrastructure health and statistical experiment validity, including automated circuit breakers for broken or harmful variants.

Assume a standard online experimentation architecture comprising:

  • A Control Plane (UI/API for experiment configuration, audience targeting rules, variant traffic splits, metric definitions).
  • An Assignment Engine (evaluates rules for incoming user requests to yield a variant).
  • An Event Ingestion Pipeline (logs exposures and conversion events).
  • An Analytics/Statistical Engine (computes metrics, sample ratio mismatches, and guardrails).

Key Areas to Address

  1. Synchronous vs. Asynchronous Validation

    • Define clear principles for separating blocking (synchronous) checks from non-blocking (asynchronous) background validations across two distinct stages: experiment configuration time and runtime event ingestion.
    • Detail concrete checks for both stages and describe the consequences of incorrectly placing a check on the wrong side of the boundary.
  2. Latency Budget & In-Process vs. Remote Assignment

    • Detail how variant evaluation stays within caller latency limits (e.g., sub-millisecond budgets).
    • Compare in-process SDK evaluation via local rule caching against remote RPC-based evaluation.
    • Explain how configuration updates are propagated safely without impacting live request execution.
    • Define fallback behavior when timeouts occur and explain how fallbacks interact with data logging to prevent experiment corruption.
  3. Platform and Experiment Health Checks

    • Distinguish between platform infrastructure checks (propagation delay, ingestion backpressure) and statistical health checks (Sample Ratio Mismatch, guardrail metric degradation).
    • Specify automated remediation policies (auto-kill switch vs. alert-only) and explain how to prevent false positives caused by continuous statistical testing.

Hints

Hint 1

Rule evaluation latency can be eliminated from network calls by performing in-process deterministic evaluation via a local config cache.

Hint 2

Consider how defaulting on SDK timeout affects variance and bias in the analysis pipeline—should defaulted requests log an exposure?

Hint 3

Beware of sequential testing bias when implementing automated statistical health checks; continuous p-value monitoring inflates Type I errors.