Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Declarative Infrastructure Orchestrator

Design a two-region control plane that plans and applies versioned infrastructure changes safely across unreliable provider APIs.

Problem statement

Design a declarative infrastructure orchestrator. For this exercise, assume organizations manage isolated infrastructure stacks. Each immutable configuration version declares resources and dependencies through a provider-neutral schema.

A user publishes a configuration, requests a preview plan, reviews it, and applies that exact plan.

The orchestration backend is deployed in US east and US west: either region may accept authenticated management commands and serve status reads, but each stack has exactly one active mutation home and a monotonic regional ownership epoch at a time.

Provider resources declared by a stack may live in either or both regions. A regional outage may pause mutation work, but failover must preserve acknowledged orchestration records and must not create two coordinators that can publish state for the same stack.

The service calls external provider adapters to create, update, or delete resources and stores versioned state that maps logical resource identities to provider resource identities. Provider calls may be slow, rate-limited, duplicated, or return an ambiguous timeout after taking effect.

Only one mutating run may own a stack at a time, and an apply must fail closed if the configuration or stored state no longer matches the reviewed plan.

Users can inspect progress, cancel work that has not crossed an irreversible provider boundary, refresh observed provider state, and generate a new plan for detected drift.

Exclude provider implementation, cloud billing, credential issuance, policy-language design, continuous automatic drift repair, and simultaneous mutation authority for one stack in both regions.

What to build

  1. An authorized user can publish an immutable configuration version for an isolated stack, including resource declarations and dependencies.
  2. A user can generate and inspect a plan whose actions are bound to one configuration version and one stored-state version.
  3. A user can idempotently start an apply of the reviewed plan from either US region, inspect resource-action progress and terminal outcomes, request bounded cancellation, and retain the same logical run through a safe regional failover.
  4. A user can refresh provider observations, record detected drift without silently mutating desired configuration, and generate a new reconciliation plan.

At scale

  • For this exercise, assume 20,000 organizations manage 200,000 stacks and five million resource instances; one stack may declare up to 10,000 resources.
  • For this exercise, assume peaks of 100 plan requests and 30 apply starts per second, while individual provider operations range from 100 milliseconds to five minutes and are constrained by account-specific quotas.
  • For this exercise, assume the backend is deployed in US east and US west; either region may serve management reads and accept commands, while one region owns mutation for a stack at a time. Loss of either region must not lose an acknowledged configuration, plan, run, or state record, must not permit dual mutation ownership, and should restore pending orchestration within 15 minutes; management reads should complete within 200 milliseconds at p95 from a healthy region, while plan and apply commands may be asynchronous.