All practice tasks

Low Level Design

Low-Level Design: Configuration

Choose a feature variant from ordered rollout rules that can contain a faulty predicate.

Interface

Export create_feature_flag_engine(). It returns evaluate(flag, context). A flag has default_variant and optional rules. Each rule has when, a callable taking context, and variant, a string. An applicable variant "beta" wins over any later match.

Implement the contract in the supplied source file using Python 3. Discuss framework integration in design.md.

Behavior

  • [F1] Call each synchronous predicate with context in input order. Only True matches. A match returns its variant and stops evaluation.
  • [F2] With no match, return default_variant exactly. Omitted rules are an empty sequence.
  • [F3] Treat a predicate exception as a non-match. Evaluate the same rule normally on later calls.
  • [F4] Do not mutate the supplied flag, rules or context. Evaluate each call independently.

Design and verification

  • Place the component in Django services, views and repository boundaries and explain the adapter/core boundary.
  • Separate policy loading, rule evaluation and consumption of a variant.
  • Explain where to record a failed predicate separately from a deliberate False result.

What this task practices

Low-Level Design: Configuration is a low level design interview exercise that trains prompt interpretation, explicit assumptions, a concrete response, and a clear explanation of tradeoffs. The catalog marks it as medium difficulty. It focuses on Testing, Tradeoffs, Validation. The signed-in workspace provides the tools for the round and evaluates the attempt against task-specific criteria. Reference solutions, hidden checks, evaluator instructions, and candidate work remain private.

Sign in to startThe workspace and evaluation open after sign in.