tezvyn:

Describe an architecture that decouples business launch from code deployment

AI-drafted, machine-checkedSource: martinfowler.comadvanced
Describe an architecture that decouples business launch from code deployment

This tests feature-flag architecture separating deployment from release. Strong answers cover toggle categories and decision decoupling. They need lifecycle management to limit carrying cost. Red flag: treating flags as permanent or ignoring toggle debt.

WHAT THIS TESTS: This question evaluates whether you can design a continuous delivery architecture where deploying code to production does not automatically expose new behavior to users. The interviewer wants to see that you understand feature toggles as a first-class architectural concern, not just as conditional if statements scattered through the codebase.

A GOOD ANSWER COVERS: First, categorize toggles by lifespan and purpose: release toggles are transient and should be retired quickly; experiment toggles support A/B testing; ops toggles act as circuit breakers; and permissioning toggles control entitlements. Second, decouple decision points from decision logic using inversion of decision so that routing happens at the edge or via configuration rather than nesting business logic inside conditional blocks. Third, distinguish static configuration, which is preferred for simplicity, from dynamic configuration, which enables per-request overrides and canary releasing. Fourth, manage toggle state through structured configuration files or a distributed configuration store rather than hardcoding, and expose current toggle configuration for observability. Fifth, address long-term carrying cost by planning toggle retirement so the system does not accumulate dead flags.

COMMON WRONG ANSWERS: A red flag is proposing only hardcoded boolean flags or environment variables without a management strategy. Another mistake is placing toggles deep in core business logic instead of at the edge, which pollutes the domain model. Candidates also err by treating all toggles as permanent infrastructure; release toggles in particular are transient debt that must be removed after launch. Ignoring validation complexity is another error, since combinatorial flag states multiply test paths.

LIKELY FOLLOW-UPS: The interviewer may ask how you would handle a toggle that needs to change at runtime without restarting services. They might probe the trade-off between dynamic routing versus dynamic configuration, or ask how you prevent a failed flag evaluation from crashing a request. You could also be asked how to test when flags create many possible execution paths, or how to sunset a long-lived permissioning toggle.

ONE CONCRETE EXAMPLE: Imagine a team refactoring a pricing engine. They deploy the new algorithm behind a release toggle that defaults to off. The toggle is configured statically in a structured YAML file but evaluated dynamically per request at the API gateway edge. After a canary release to five percent of traffic, the team enables the toggle globally. Once metrics confirm stability, they remove the toggle and the old code path entirely within two weeks, avoiding carrying cost.

Source: martinfowler.com

Read the original → martinfowler.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.