Skip to content
Tech Interview Prep
Technical interview guide

Chaos Engineering

Deliberately injecting failure into a system to verify it actually survives what you assume it survives.

Minutes to read
3
Practice MCQs
25
Interview Q&A
25
Edition
v6
Editorial status
Reviewed

Scope: Chaos Engineering principles and AWS, Azure, Google Cloud, Kubernetes, LitmusChaos, Chaos Mesh, and OpenTelemetry guidance current 2026-08-31.

Interview Q&A

Treat each question like a live interview question: answer out loud first (structure, assumptions, tradeoffs), then open the model answer to spot gaps and rehearse a tighter follow-up.

Curated: · Written: · Reviewed:

25 questions

Q&A-3

Define steady state for a payment workflow.

Answer

Assumptions: card and wallet payments, async authorize→capture, provider webhooks delivered at-least-once, an order service, a payment service, and a ledger that settles against provider reports. Volume around 2M attempts/day.

The answer I'd give first. Steady state is a bounded, flat band on end-to-end invariants, not the absence of errors. Four invariants: every attempt reaches a terminal state within a bounded time; the count of indeterminate (unknown) payments stays flat rather than growing; the ledger reconciles to provider settlement with zero breaks; and duplicate or replayed events are absorbed without a second money movement. Host CPU, queue depth and provider status pages are diagnostic inputs: they explain a drift, they don't define steady state.

Why it's defined that way. The workflow is asynchronous and at-least-once, so at any instant a slice of payments is legitimately in flight. "Zero pending" is the wrong target; a flat pending count is the right one. The dangerous class is the indeterminate payment: authorize timed out, the webhook never arrived, and you don't know whether the provider holds an auth. Those can be resolved twice (double capture) or never (customer charged, order never fulfilled). Steady state means the resolver drains unknowns at least as fast as they're created: inflow ≈ outflow. If inflow exceeds outflow, the unknown set grows monotonically and you are drifting even while every host is green.

Invariants (figures illustrative):

invariantsteady statedrift signal
terminal completion99.9% of attempts terminal ≤30sp99 >60s or completion <99.5%
indeterminate countflat, <0.05% of daily volumemonotonic growth over 3 windows
duplicate suppression0 double-captures/dayany double-capture
ledger vs provider settlement0 breaks >$0.01any break
reconciliation queue agep99 <5 minp99 >15 min

Arithmetic that makes it concrete. 2M attempts/day × 0.05% = 1,000 unknowns/day. A resolver on a 5-minute timer runs 288 times/day, so it must clear ~3.5 per run. If it clears 2, the backlog grows 1.5 per run, 432/day, and the indeterminate count stops being flat. That growth, not a red dashboard, is the drift.

Trace of the duplicate case. Client calls authorize, times out at 3s, retries with the same idempotency key. The provider had already authorized the first call, so the retry returns the same auth ID; capture runs once. Without the key: two auths, one capture, one orphan hold. Detection is reconciliation: provider-side auths with no matching capture show up as breaks. Cost is a held line of credit and a support ticket.

Failure modes and how you catch them.

  • Webhook loss: the unknown stays unknown. Detected by the age of the oldest indeterminate payment crossing the resolver's SLA. Cost: customer sees "pending", or a retry double-charges.
  • Reconciliation lag: queue age p99 climbs. Detected by the queue-age SLO. Cost: settlement mismatch found days late, manual ops.
  • Idempotency key reused with a different amount: detected by hashing the payload against the key. Cost: wrong amount captured.
  • Single-provider degradation: auth success by decline reason drops for one provider. Segment by provider and region so a global success rate doesn't mask it.

When a simpler definition is enough. For a synchronous, single-provider, low-volume flow where capture is immediate, steady state is just success rate plus a latency SLO: reconciliation invariants earn their keep only once settlement is async or you run multiple providers. And tightening every threshold to zero causes alert fatigue; the indeterminate-count invariant is the one that protects correctness, so it gets the tightest band.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-2

Write a falsifiable experiment hypothesis.

Answer

A hypothesis is falsifiable when you can write down, before you run anything, the observation that would prove it wrong. If no measurement could contradict it, it's a wish, not a hypothesis.

Here's a complete one. "Given checkout running at 1,200 rps with p99 latency 180 ms and a 0.02% error rate, when I terminate all three payment-service instances in AZ-a at 14:00 UTC, then for the following 10 minutes checkout success stays at or above 99.5%, p99 stays at or below 400 ms, and the load balancer finishes draining AZ-a within 90 seconds."

That sentence carries four things that make it checkable: a steady state you measured first (1,200 rps, 180 ms, 0.02%), a specific fault with a named blast radius (three instances in one zone), a bounded window (10 minutes), and numeric thresholds a dashboard can cross.

The pass/fail table is the experiment:

observationpassfalsified
checkout successat or above 99.5% for the full 10 minany 30 s window below 99.5%
p99 latencyat or below 400 msabove 400 ms for 30 consecutive seconds
AZ-a draincomplete within 90 sstill receiving traffic at 90 s
data integrityzero duplicate or lost ordersany duplicate charge

If the fail column can't happen, you aren't testing anything. "The system stays up" is not falsifiable: nothing you could observe would contradict it.

Now the alternatives, because the framing decides what you learn. The fault-specific phrasing above tests one known weak point. A steady-state hypothesis instead asserts that a measured output holds constant across the fault and its recovery: useful when you don't yet know the failure mode. An SLO-burn hypothesis asserts the error-budget burn rate stays under, say, 2x for the window: better when you care about user-visible cost rather than a single journey. Reach for the fault-specific form when you have a suspected weak point; reach for steady-state when you're exploring.

The trade-off is threshold tightness. Tight thresholds catch real regressions but flake on normal variance: a 99.5% floor on a service that normally runs 99.6% will fail on noise. Loose thresholds pass everything and prove nothing. Set the floor a few multiples of your normal variance below the steady state, not at it.

The failure modes live in the experiment, not the system. Telemetry blindness: if your metrics pipeline runs in AZ-a, killing AZ-a hands you a green dashboard because nothing is reporting. Pre-check that the pipeline has an independent zone and assert on a canary metric that must move. Retry storms: clients retry into the surviving zones, so you end up measuring your retry policy, not your failover. Watch retry rate and queue depth during the window. Load-generator saturation: if the generator can't hold 1,200 rps once a zone is gone, "success" means "no traffic." And blast-radius creep: a shared control plane means killing AZ-a can take down AZ-b's scheduler.

What it doesn't cover: simultaneous multi-zone loss, the recovery path after the 10-minute window, and any fault outside the payment path.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-19

Interpret a passing chaos experiment.

Answer

A passing chaos experiment means the system met the hypothesis under the injected fault, but it does not mean the system is resilient to all faults. I interpret it by checking three things: the injection actually happened, the observed behavior is statistically distinguishable from baseline noise, and recovery met the criteria. For example, in a Chaos Mesh NetworkChaos experiment adding 200ms latency to 3 of 10 pods for 5 minutes, I'd expect p99 latency to rise to ~240ms, error rate to stay under 0.5%, and p99 to return to 40ms within 30 seconds after the experiment ends. If those hold across 5 runs, I call it a pass.

Assumptions matter. The tested version must be pinned, if the service version changes, the pass is invalid. The workload during the experiment must match production traffic mix. The observation boundary must cover all downstream dependencies. And a control group, non-injected pods, must show no degradation. Without those, a pass is just a number.

The key distinction between a pass and a flaky pass is baseline variance. If baseline p99 fluctuates between 35ms and 45ms, a 240ms p99 is clearly outside. But if baseline p99 is 200ms ± 50ms, a 240ms p99 is within noise. So I compute a confidence interval from a pre-experiment baseline window (e.g., 30 minutes) and require the injected run to exceed it. I also check injection evidence: Chaos Mesh events, sidecar logs, or eBPF traces showing the delay was applied. Without that, a pass could be a no-op.

Alternatives to a full chaos experiment: a game day with manual fault injection, or a canary analysis where you compare a canary with a fault to a control. Chaos experiments are better when you need repeatability and automation. But they are not worth it if you lack observability, you can't tell if it passed, or if the blast radius is too large, like injecting a fault into the only database. Start in staging, then production with a small canary and a kill switch.

Common false passes: no traffic hit the target during the experiment. Check request rate per pod. Retries or circuit breakers masked the fault: check retry metrics and breaker state. The platform rescheduled the pod before the fault took effect: check Kubernetes events for pod evictions. Correlated failure across tenants, if you only tested one tenant, a shared dependency might fail for all. Detection: compare per-tenant error rates, check shared resource metrics like database connection pool. Operational cost: running chaos in production requires an on-call engineer, a rollback plan, and clear abort criteria. I also check near-threshold behavior: if error rate was 0.4% against a 0.5% SLO, that's a pass but a warning.

SignalPassFlaky pass
Injection evidenceChaos Mesh events show delay applied to 3 podsNo events, or events show 0 pods
Baseline varianceInjected p99 > 95% CI of baselineInjected p99 within baseline CI
Recovery timep99 back to baseline within 30sp99 stays elevated for minutes
Control groupControl pods show no changeControl pods also degrade
Traffic rateSteady 1000 rps during experimentTraffic drops to 0 during experiment

Hypothetical trace: 10 pods, 3 injected with 200ms latency for 5 minutes. Baseline p99: 40ms (95% CI 38–42ms). During injection: p99 240ms, error rate 0.1% (baseline 0.05%). After injection: p99 41ms within 20s. Control pods: p99 40ms. Request rate: 1000 rps steady. Chaos Mesh events show 3 pods had delay applied. Result: pass.

So I interpret a passing chaos experiment as a bounded, repeatable result: the fault was injected, the system degraded as expected but stayed within SLO, and recovered. I schedule a regression after any change to the service, its dependencies, or the platform. I never treat one pass as certification for all failure modes.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-9

Validate that a chaos experiment actually executed.

Answer

What a strong answer sounds like

"The experiment ran" is three separate claims that fail independently: the controller accepted the spec, the agent applied the fault on the target, and the target's behaviour actually changed. Verify each on a different channel, and never let the controller's own status be the only witness.

Assumptions: Kubernetes, Chaos Mesh as the injector (Litmus is equivalent. ChaosResult.status.experimentStatus.verdict is Pass/Fail/Awaited), Prometheus for steady-state telemetry, NTP-synced clocks across nodes.

1. Controller accepted it: necessary, not sufficient. kubectl get podchaos payments-kill -o jsonpath='{.status.experiment.phase}' returning Run only means the CR was admitted and the controller is reconciling. Chaos Mesh's .status.conditions carries AllInjected and AllRecovered; AllInjected: True (reason ChaosInjected) means every selected target got the fault. False with reason NotInjected means at least one did not: usually the chaos-daemon pod is not running on that node, or RBAC blocks the patch.

2. Target-side evidence: the part the controller cannot fake. For a pod-kill the pod is deleted and the ReplicaSet builds a new one, so the UID and status.startTime change while restartCount stays 0. For a container-kill the pod survives and restartCount increments. For network delay, kubectl exec <pod> -- tc qdisc show dev eth0 shows the netem qdisc Chaos Mesh installed. For CPU stress, ps inside the target shows stress-ng and cAdvisor's container_cpu_cfs_throttled_periods_total climbs.

3. Correlate timestamps and scope with steady-state telemetry. The fault must land inside the experiment window and on exactly the targets you asked for.

Worked trace: pod-kill, mode one, duration 30s, 3 replicas

$ kubectl get pods -l app=payments-api -o custom-columns=NAME:.metadata.name,UID:.metadata.uid,START:.status.startTime
payments-api-7d9f4b-2xk9p   9f2c…   2024-06-03T10:00:12Z
payments-api-7d9f4b-8m4qt   3a71…   2024-06-03T10:00:12Z
payments-api-7d9f4b-qz5vn   6b0e…   2024-06-03T10:00:12Z

$ kubectl apply -f pod-kill.yaml
podchaos.chaos-mesh.org/payments-kill created

$ kubectl get pods -l app=payments-api -o custom-columns=NAME:.metadata.name,UID:.metadata.uid,START:.status.startTime
payments-api-7d9f4b-2xk9p   9f2c…   2024-06-03T10:00:12Z
payments-api-7d9f4b-8m4qt   3a71…   2024-06-03T10:00:12Z
payments-api-7d9f4b-w7r2c   c41d…   2024-06-03T10:41:07Z   ← new UID, new startTime

Exactly one of three pods was replaced, at a time inside the window. The two untouched pods keep their UIDs: that is the negative control. If all three had changed, a node drain or a rollout caused it, not the experiment.

Telemetry corroborates: kube_pod_start_time for the new pod, and a dip in sum(rate(http_requests_total{job="payments-api"}[1m])). But with a 15s scrape interval and a ReplicaSet that replaces the pod in ~2s, the dip may be invisible. The UID change is the primary evidence; telemetry is corroboration, not the test.

Failure modes

failurewhat you seedetection
selector matches nothingphase Run, AllInjected: True, zero pods changedcompare changed-pod count to the mode you asked for
chaos-daemon down on the target's nodeAllInjected: False, reason NotInjectedkubectl -n chaos-mesh get pods -o wide, check the daemon on that node
partial injection (fixed-percent 50% of 10 pods)5 pods changedexpected count vs. observed count
clock skew between controller and targetcorrelation window off by secondschronyc tracking offset
telemetry pipeline downno anomaly either wayconfirm up{job="payments-api"} was 1 for the whole window
fault applied but not recoveredphase Finished, netem qdisc still on the interfacere-run the target-side check after the duration expires

Test the verification channel. Run a deliberate no-op, a selector with a typo, and confirm your check reports "not executed" rather than "pass". A check that has never failed is not a check.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-18

How do you simulate packet loss, latency, and network partitioning using traffic control (tc) or service mesh primitives?

Answer

To simulate packet loss, latency, and partitioning, you choose between Layer 3/4 kernel queueing disciplines (tc and iptables) and Layer 7 service mesh sidecars (such as Envoy via Istio). The choice dictates whether you test raw network transport resilience (like TCP window exhaustion, connection pool timeouts, and heartbeat deadlocks) or application semantics (HTTP status codes, gRPC deadlines, and application-level circuit breaking).

1. Transport-Level Degradation with tc and iptables

Linux Traffic Control (tc) uses Network Emulator (netem) queueing disciplines (qdisc) attached to network interfaces (such as a pod's veth pair or host interface eth0). Packet drop or delay happens in the kernel egress pipeline before frames hit the physical wire.

Shell
# Inject 120ms +/- 20ms normal-distributed latency to all egress on eth0
tc qdisc add dev eth0 root handle 1: netem delay 120ms 20ms distribution normal

# Introduce 5% packet loss with a 25% correlation factor
tc qdisc change dev eth0 root handle 1: netem loss 5% 25%

# Clean up and revert to default pfifo_fast/fq_codel
tc qdisc del dev eth0 root

To restrict the fault blast radius to a single upstream dependency (e.g., target CIDR 10.244.2.15/32 on port 5432), filter via tc-filter or mark packets using iptables:

Shell
# Direct traffic via classful hierarchy: prio qdisc + cgroup or fwmark
tc qdisc add dev eth0 root handle 1: prio
tc qdisc add dev eth0 parent 1:3 handle 30: netem delay 150ms
tc filter add dev eth0 protocol ip parent 1:0 prio 3 u32 \
    match ip dst 10.244.2.15/32 match ip dport 5432 0xffff flowid 1:3

For a complete network partition between Node A and Node B, drop packets bidirectionally using iptables rather than netem to prevent TCP resets (RST) or ICMP Destination Unreachable from prematurely terminating the socket:

Shell
# Bidirectional silent partition: DROP silently discards packets (emulating wire break)
iptables -A INPUT -s 10.244.3.40 -j DROP
iptables -A OUTPUT -d 10.244.3.40 -j DROP

2. Application-Level Fault Injection via Service Mesh (Envoy)

Service meshes inject faults directly within user-space proxies (Envoy) at the HTTP/gRPC frame level, intercepting parsed streams rather than kernel buffers.

YAML
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: payment-fault-injection
spec:
  hosts:
    - payment-service
  http:
  - match:
    - headers:
        x-chaos-test: { exact: "true" }
    fault:
      delay:
        percentage: { value: 10 }
        fixedDelay: 2.5s
      abort:
        percentage: { value: 2 }
        httpStatus: 503
    route:
    - destination:
        host: payment-service

Architectural Trade-offs

AttributeKernel Level (tc, netem, iptables)Service Mesh (Envoy / L7 Proxy)
Layer TestedL3/L4 (IP/TCP/UDP). Exercises OS TCP stack, buffers, timeouts.L7 (HTTP/1.1, HTTP/2, gRPC). Exercises retries, circuit breakers.
ScopeAll traffic egressing the interface unless strict IP/port filtered.Scoped to matching HTTP routes, headers, or synthetic test contexts.
PrivilegesRequires CAP_NET_ADMIN / root in network namespace.Declarative Kubernetes CRD; no elevated container capabilities.
Transport RealismReplicates real packet retransmissions, head-of-line blocking, MTU issues.Cannot simulate connection drops, socket buffer bloat, or TLS handshake delays.

Critical Failure Modes and Blast Radius Mitigation

  1. Orphaned qdisc State: If the chaos injection runner crashes or loses connection to the target pod, tc netem rules persist indefinitely in the network namespace. Always set a watchdog or timeout-based rollback (e.g., orchestrate via tools like Chaos Mesh that wrap operations in timer leases).
  2. DNS & Health Check Blackholing: A broad tc rule without port filters delays kubelet livenessProbe traffic (typically port 8080/healthz) and cluster DNS (port 53). The kubelet marks the pod unready, restarts it, and kills the experiment prematurely. Always explicitly exclude kube-dns and local node IPs from the filter chain.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-13

Design a network-partition experiment.

Answer

Before touching anything I'd write the claim as a falsifiable sentence, because "the cluster survives a partition" isn't one. Mine: a 5-node etcd 3.5 cluster split 3/2 across two AZs keeps serving linearizable reads and writes on the majority side, the minority side stops acknowledging writes within one election timeout, and no client that got a 200 loses that write when the partition heals.

Assumptions I'd state out loud: 5 nodes, 3 in AZ-a and 2 in AZ-b, peer traffic on 2380, client traffic on 2379, clients behind a load balancer that health-checks, and the app using quorum-acknowledged writes. If the app acks before commit, the last claim is false and the experiment is measuring something else.

For a hard partition I'd use iptables DROP, not REJECT:

iptables -A INPUT  -s 10.0.1.0/24 -p tcp --dport 2380 -j DROP
iptables -A OUTPUT -d 10.0.1.0/24 -p tcp --dport 2380 -j DROP

DROP matters. REJECT sends an RST or ICMP unreachable, so the peer fails fast and the failure mode is "connection refused", not "timeout", and timeout is the mode you actually want to test. Direction matters too: a one-way drop where AZ-b's SYNs get through but AZ-a's replies don't leaves half-open connections that look healthy to the sender. Two-way is the honest test.

Existing connections persist through this. Linux TCP keepalive defaults to 7200s (net.ipv4.tcp_keepalive_time), so a partitioned socket can look alive for two hours. What actually detects the partition is etcd's own heartbeat: 100ms interval, 1000ms election timeout. A follower that misses roughly ten heartbeats starts an election.

That's the mechanism behind the expected behavior. The majority side still has quorum, so it keeps committing. The minority side can't get 3 votes, so both nodes stay candidates and increment their term on every failed election: term inflation. When the partition heals, those higher terms force the majority leader to step down, causing a spurious election. etcd's pre-vote (default since 3.4) stops the term rising while partitioned, which is why you confirm it's on before running this.

Fencing: if the leader was on the minority side it must stop serving. etcd's check-quorum makes it step down once it can't confirm a quorum. Without it, the stale leader still answers serializable reads (--consistency=s) from its local store: stale data, no error. Linearizable reads go through ReadIndex and fail, which is the behavior you want.

PhaseActionExpectedWatch
Baseline5 min steady writesleader stable, p99 ~10msterm flat
PartitionDROP peer 2380 both waysmajority commits, minority candidatesterm inflation on minority
Hold5 minminority returns 503proposals_failed climbing
Healremove rules one node at a timeminority rejoins, log truncatedleader re-election

Healing: remove the rules one node at a time, not all at once. Watch the minority's uncommitted log entries get truncated: Raft never overwrites committed entries, so the only way to lose an acknowledged write is if the app acked before commit. That's the thing to verify, not the log.

Detection: etcd_server_leader_changes_seen_total jumping, etcd_server_proposals_failed_total climbing on the minority, client-side 503s. Two leaders in the same term is impossible in Raft; what you're actually watching for is a stale leader serving reads.

Blast radius: run it in staging first, or a canary. Keep the abort path out of band, an SSH session through a bastion that isn't in the partition, and test the abort (iptables -F on the peer rules) before you start. Budget the cost: five minutes of partition means five minutes of 503s for clients routed to the minority.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-7

Chaos-test dependency latency and timeouts.

Answer

Clarify first. "Dependency latency" is three different experiments: does my client degrade gracefully, does the dependency degrade gracefully, or does the fleet survive. I'd ask which one before injecting anything, because the injection point and the pass criteria differ.

Assumptions I'd state up front. Checkout service calls a ledger over gRPC. Client deadline 250 ms, connection pool 20 per pod, retry budget 10% of requests with 3 attempts, exponential backoff plus jitter, circuit breaker opens at 50% error rate over a 20 s window. Canary deployment, 10% of pods, Kubernetes with Chaos Mesh.

The injection. A NetworkChaos delay of 300 ms ± 50 ms on egress to the ledger, scoped by label selector to the canary pods only, 5-minute duration. I pick 300 ms deliberately: it exceeds the 250 ms deadline, so every call times out. If I injected 100 ms I'd only be testing slowness, not timeout behavior: the deadline, retry and breaker paths would never fire.

Why it cascades. Each in-flight call holds a pool connection until its deadline fires, so a connection is occupied for ~250 ms. At 400 rps arrival, Little's law says I need 400 × 0.25 = 100 concurrent connections; the pool caps at 20. So ~80% of requests queue for a connection and time out before they're even sent. The 10% retry budget adds up to 40 rps of retries, each grabbing a connection too: retry amplification. That's the mechanism to watch: pool saturation, then queue growth, then breaker trip.

Trade-offs on where to inject. Client-side egress (Chaos Mesh, Toxiproxy) exercises your timeout, retry and breaker config: that's what you control in prod. Server-side sleep tests the dependency's own behavior and is more realistic but you don't own it. Istio VirtualService fault injection needs no code change, but it delays at the sidecar, so it won't exercise a socket-level client timeout. Deciding criterion: if the question is "does my client degrade gracefully," inject at the client; if it's "how does the dependency behave under load," inject at the dependency.

Recovery is where teams get burned. Remove the delay and the backlog doesn't vanish. Requests queued during the window still drain, and retries scheduled with backoff fire after recovery: a second wave. Distinguish dependency recovery (ledger p99 back to 40 ms) from application recovery (your queue depth back to baseline, breaker closed). The breaker can stay open for its full 20 s window after the dependency is healthy, so a naive "dependency is fine, we're done" check passes while users still fail.

Worked trace (example figures, 400 rps, 250 ms deadline, pool 20):

tledger delaypool in usequeuedbreakeruser impact
0 s40 ms160closednone
30 s300 ms20 (capped)~80closed80% time out
60 s300 ms20~80openfast-fail, fallback
90 s40 ms20drainingopen (20 s window)still failing
120 s40 ms160closedrecovered

The row at 90 s is the one to design a check for: dependency healthy, application not yet recovered.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-14

Test resource exhaustion without causing uncontrolled harm.

Answer

Core answer

The safe way to test resource exhaustion is to exhaust exactly one resource, on one target, with a hard stop that does not depend on the system under test, and a hypothesis that predicts the shape of the degradation before you run it. If you cannot say what you expect to see: "p99 rises linearly with queue depth until the pool's 5s acquire timeout fires, then errors": you are not testing, you are just breaking things.

Assumptions I state up front: a non-production environment that mirrors prod's limits, or a single canary replica behind a traffic split. Never the shared control plane (API server, etcd, ingress) on the first pass.

Mechanism: why the order of symptoms matters

When you exhaust a bounded resource, the first symptom is almost never the failure. Take a connection pool of 20 with a 5s acquire timeout. As concurrency climbs past 20, requests do not fail, they queue. Little's law gives queue depth L = arrival rate λ × wait time W, so latency rises linearly with load until the timeout fires. You watch p99 climb from 40 ms to 5 s before you see a single error. If error rate is your abort signal, you blow past the safe point.

Memory has the same shape. A Go service with GOGC=100 (the default) roughly doubles its live heap before triggering GC, so as you push allocation you see GC CPU climb and p99 wobble before the 512 Mi limit is hit and the kernel OOMKills the container. The OOMKill is the last symptom, not the first.

Worked example

Target: one canary replica, CPU limit 500m, memory limit 512 Mi, DB pool max 20, acquire timeout 5s.

Mechanism: stress-ng --vm 1 --vm-bytes 400M in a sidecar sharing the pod's cgroup, ramped over 5 minutes rather than slammed.

Expected control: p99 stays under 1 s and error rate under 0.1% until heap crosses ~400 Mi, then GC CPU saturates the 500m limit and p99 degrades. Abort signals:

signalthresholdwhy
container restarts> 0OOMKill already happened; you are past the interesting regime
p99> 3 s for 30 squeue is unbounded, not degrading gracefully
neighbor pod restartsanynode-level eviction cascade has started

Failure modes and detection

  • OOMKill of the target: kubectl get pod -o jsonpath='{.status.containerStatuses[*].restartCount}' climbing, OOMKilled in kubectl describe. Cost: in-flight requests dropped, clients retry, offered load doubles.
  • Node eviction cascade: kubelet evicts by QoS. BestEffort first, then Burstable over its requests, Guaranteed last. A neighbor Burstable pod gets killed. Detect via kubectl get events --field-selector reason=Evicted. This is the one that turns a scoped test into an incident.
  • Disk: never fill a volume backing a WAL or a shared PVC. That is the irreversible one.

Trade-offs / when not to run

If the resource is shared (a single DB instance, a shared Redis) you cannot exhaust it without harming others. Test the client's behavior against a saturated dependency using a proxy (toxiproxy) that fakes the exhaustion instead. That is the deciding criterion: exhaust the resource only when you own it end-to-end; otherwise simulate the symptom at the boundary.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-8

Chaos-test a Kubernetes workload responsibly.

Answer

"Responsibly" means three things before I touch anything: a written hypothesis, a steady state I can measure, and a blast radius I can stop with one command. If I can't name the metric that tells me the workload is healthy, chaos testing is the wrong tool: I'd be injecting noise into a system I can't read.

Assumptions I'd state up front: non-production first, same manifest and same resource limits as prod. If the hypothesis is about a prod-only dependency (a specific zone, a cloud provider's spot reclaim) I run it in prod, but on a canary namespace with a small replica count.

Steady state, with numbers. For a checkout-api Deployment I'd pin p99 latency at 180 ms, 5xx rate under 0.5%, Kafka consumer lag under 2k messages, and DB pool occupancy under 40 of 50 connections. Those are the pass/fail gates; a run that doesn't move them proves nothing.

Tooling: Chaos Mesh for Kubernetes-native work. PodChaos, NetworkChaos, StressChaos, plus Schedule for repeats. Litmus if the team already runs it; its ChaosEngine probes (httpProbe, promProbe, cmdProbe) put the steady-state gate inside the experiment. Hand-rolled kubectl delete pod is fine for step one and useless after that, because it has no blast-radius control.

The escalation ladder, one rung at a time.

1. pod-kill, mode: one. Proves the ReplicaSet replaces a pod and the readiness gate re-adds it to Endpoints. This is the cheapest rung and where most teams find their real bug: the pod comes back Running but the readiness probe fails for 40 s because the app warms a cache, so the Service runs one endpoint short the whole time.

YAML
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata:
  name: checkout-pod-kill
  namespace: chaos-mesh
spec:
  action: pod-kill
  mode: one
  gracePeriod: 0
  selector:
    namespaces: [checkout]
    labelSelectors:
      app: checkout-api

2. pod-failure for 60s. Different mechanism, different lesson: the pod object stays, the container is swapped for a pause image, readiness fails, the endpoint is removed, but the pod is never deleted. This tests whether clients handle a slow endpoint removal and whether alerting fires on "not ready" rather than "not running".

3. fixed-percent 25 on a 4-replica canary, exactly one pod, to check the controller's replacement doesn't stampede the DB.

4. Node-level. kubectl drain is a voluntary disruption and goes through the eviction API, so the PDB applies. A node power-off, kubelet crash, or spot reclaim is involuntary and bypasses the PDB entirely: the pods are gone, minAvailable or not. That's the most common misunderstanding, so I test both: drain with minAvailable: 2 on 3 replicas (one evicts at a time), then stop the node to show the PDB does nothing.

Failure modes I watch for, with the signal:

  • Stuck Terminating pods. Signal: kubectl get pods -A shows Terminating past terminationGracePeriodSeconds (default 30 s). Cause is usually a finalizer, or a NotReady node whose kubelet can't confirm deletion.
  • Throttled recovery. kube-controller-manager defaults to --kube-api-qps=20, --kube-api-burst=30. Kill 30 pods at once and the ReplicaSet controller reconciles them in batches. Signal: workqueue_depth on kube-controller-manager climbing while pods sit Pending.
  • Scheduling and quota exhaustion. Signal: FailedScheduling events. "exceeded quota", or "no IP addresses available in range set" on an IP-limited node pool.
  • Retry storm. Signal: downstream request rate rising faster than the failure rate, because every client retried three times.

Trade-offs and when not to. pod-kill tests replacement, pod-failure tests degraded-but-present, and only node or zone tests test topology. If the hypothesis is "does our retry logic back off correctly", that's a unit test, not chaos. If the system is already degraded, or I have no rollback and no metric, I don't run it. Every run gets a duration and a kill switch, kube-system stays excluded, and I audit the chaos controller's RBAC: a chaos tool holding cluster-admin is a production incident waiting for a typo.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-15

Run chaos against a stateful data system.

Answer

What I'd say in the first two minutes. Assume a 3-node PostgreSQL 16 cluster (one primary, one synchronous standby, one async replica) with Patroni and a 3-node etcd for leader election, RPO 0, RTO 30s. Chaos on a stateful system means injecting one scoped fault at the write path and proving the data invariants survive; "the job exited zero" is not a result. I run it in staging first, then a single canary in production behind a kill switch.

Define steady state as numbers, not nouns. Before injecting anything: commit p99 < 15 ms, pg_stat_replication.write_lag < 100 ms, and a ledger invariant. SELECT count(*) FROM ledger WHERE idem_key='k1' returns 1, and the sum of entries per account equals the account balance. If those don't hold before the fault, chaos tells you nothing.

Inject one fault, watch one signal.

faultsignal to watchabort threshold
SIGKILL the sync standby's postgresprimary blocks on commit until synchronous_standby_names falls backcommit p99 > 5 s for 30 s
partition primary ↔ etcdPatroni lease expires, promotion within RTOtwo primaries streaming
tc netem delay 200ms primary ↔ standbywrite_lag climbswrite_lag > RPO window

Why duplicates and ordering break. Trace it: the client sends INSERT INTO ledger (idem_key, acct, amt) VALUES ('k1','A',100) ON CONFLICT (idem_key) DO NOTHING. The primary commits, flushes WAL to the sync standby, sends the ack. A partition drops the ack; the client times out at 5 s and retries. The retry hits the unique constraint and is a no-op: one row. Drop the unique index on idem_key and the retry inserts a second row: the balance is off by 100 with no error anywhere. That is the failure the test exists to catch, and why idempotency keys are a precondition, not a nice-to-have.

Fencing is what stops split-brain. Patroni holds an etcd lease (default TTL 30 s, renewed every 10 s). If the primary can't renew, etcd partition, the lease expires and another node promotes. The old primary must be fenced on lease loss (pg_ctl stop -m fast, or STONITH) before it can serve again. Without that hook it keeps accepting writes while the new primary does too: two primaries, divergent WAL, manual reconciliation. Detect it by polling pg_is_in_recovery() on every node, two nodes returning false means two primaries, or by comparing WAL LSNs.

RPO is a config fact, not a hope. Postgres synchronous_commit defaults to on, but with synchronous_standby_names empty (the default) there is no sync standby, so commits don't wait and RPO > 0. Worked example: write 1000 rows at 500/s, SIGKILL the primary, promote the standby, if 998 rows survive, you lost ~4 ms of writes. Set synchronous_standby_names and re-run to drive that to 0.

Trade-offs and when not to. Single scoped faults are cheap and repeatable; correlated faults (kill the primary and partition etcd in the same window) are where real outages live, but run them only after single faults pass. Staging catches most bugs; a production canary catches the ones that depend on real traffic skew. Don't run chaos on a stateful system that has no tested restore and no fencing: you'll convert a controlled fault into data loss. And if the system can't tolerate a 30 s RTO, fix the architecture before you test it.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-11

Test recovery after fault removal.

Answer

Clarify first. "Recovered" is not one thing. Before the injection I would have written down three numbers: time to first successful request, time for the backlog to reach zero, and time for p99 latency to return to its pre-injection baseline. Without those, "it is green again" is a dashboard reading, not a result.

Assume a concrete run: a 10-minute chaos experiment that dropped 100% of packets to the payments provider, at a steady 2,000 rps. Fault removed at T0.

The core answer. Recovery testing measures the shape of the return, not the endpoint. The fault is a step function; the recovery is not. Three things decide whether the test passes: does the backlog drain monotonically, does the system overshoot its steady state (retry storm, cache stampede, autoscaler thrash), and is every unit of work accounted for exactly once.

Why the return is not the mirror of the fault. During the outage, work accumulates. 2,000 rps x 600 s = 1.2M requests queued or retried. At T0 the service comes back with capacity, say 2,500 rps. Fresh traffic resumes at 2,000 rps, so headroom is 500 rps and the drain takes 1.2M / 500 = 2,400 s: 40 minutes, four times the outage. If clients retry three times without jitter, offered load is 2,000 + 6,000 = 8,000 rps against 2,500 rps of capacity: the backlog grows and the system never leaves the degraded state even though the fault is gone. That is metastable failure, and it is the most common way a recovery test fails.

Trade-off: keep safeguards on or open the gates. Keeping admission control, circuit breakers and retry budgets active through the drain costs user-visible failures for the whole 40 minutes. Requests that would have succeeded get shed. Opening the gates recovers the success rate faster if the backlog is small. The deciding criteria are backlog size relative to headroom, whether retries are jittered and idempotent, and whether the queue is deadline-aware. If the backlog is under roughly 30 s of headroom and the queue drops expired work, shedding buys nothing; if the backlog is 40 minutes deep, shedding is the only thing that lets fresh traffic through.

Failure modes and how to see them.

failuresignalthreshold
metastable retry stormqueue age p99 rising while dependency error rate is 0age > 5 min and climbing
cache stampedehit ratio collapses, origin QPS spikeshit ratio < 20%, origin > 5x baseline
duplicate workidempotency-key collisions, ledger mismatchany collision > 0
leader election churnterm/epoch increments, replication lagmore than 1 election in the window
autoscaler scale-inpod count falling while queue age risesscale-in during drain

Proving nothing was lost or duplicated. Count, do not eyeball. Accepted requests vs. completed requests vs. dead-letter depth; sum of the ledger against the expected total; distinct idempotency keys processed. A gap in any of the three is a data-reconciliation incident, not a recovery pass.

Handback. Observation window of at least twice the longest drain observed, with rollback criteria stated as numbers: queue age p99 above 5 minutes for 10 minutes, or error rate above baseline for 5 minutes, triggers rollback.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-16

Test observability and incident response with chaos.

Answer

What a strong candidate says first

Clarify scope: this drill tests the detection-and-response chain, not the service's own resilience. Assume a bounded blast radius (one cell or staging), an independent stop mechanism, and no individual scoring. Then run two coupled faults: a service fault with a known user symptom and a pre-agreed alert that should fire, plus a separate impairment of the telemetry or paging path. Measure the chain end to end: time to detect, time to declare, alert delivery, runbook reachability, role assignment, and whether fallback evidence exists.

Why two faults, not one

A drill that only breaks the service exercises your alerting's happy path. The failure that actually hurts is when the symptom is real and the primary evidence is gone. So the service fault produces the symptom; the telemetry fault removes the primary signal and forces the responder onto fallback evidence: logs, traces, synthetic probes, customer reports. The two faults interact: the telemetry impairment can also hide the service fault from the very dashboard the responder reaches for first.

Worked trace

Scenario: checkout service, SLO 99.9% availability over 30 days = 43.2 min error budget. Expected page: multi-window burn-rate alert, 14.4× over 1h (consumes 2% of budget) and 6× over 6h.

  • Fault A (service): Chaos Mesh HTTPChaos, 30% of calls to the payment dependency return 500 for 10 minutes.
  • Fault B (telemetry): scale the OTel Collector deployment to 0 replicas for the same window, so metrics stop reaching Prometheus.

Trace:

  • t+0: fault A starts. Error rate climbs; the burn-rate alert should fire at ~t+2 min once the 1h window fills.
  • t+0: fault B starts. Prometheus stops receiving metrics. The burn-rate alert cannot evaluate.
  • t+2: no page. The external synthetic probe (independent of the collector) starts failing at t+1 and pages at t+3.
  • t+3: on-call paged by the synthetic probe. Runbook link in the alert resolves. IC assigned at t+6.
  • t+10: faults stop. Collector restored. t+0 to t+10 is a gap in Prometheus.
measurementobservedtarget
MTTD (synthetic probe)3 min< 5 min
page to ack90 s< 2 min
runbook reachableyesyes
IC assignedt+6< 10 min
fallback evidence usedprobe + logsnamed in runbook

Trade-offs and when not to run it

Alternatives: a tabletop game day (no injection, cheap, tests coordination only); fault injection without telemetry impairment (tests detection only, low risk); the full coupled drill (tests the whole chain, highest risk). Don't run the coupled version during a change freeze, during an active incident, or when you lack an independent stop mechanism, if your only stop signal is the telemetry you're impairing, you can't stop. Prefer staging or a single production cell first.

Failure modes

  • Stop condition depends on impaired telemetry → the drill runs unbounded. Detect with a watchdog on an independent channel (separate probe or a human timer).
  • Missing intervals silently backfilled as healthy → post-incident dashboards lie. Detect by reconciling the gap explicitly and marking it, not interpolating.
  • Drill grades individuals → responders hide symptoms next time. Detect by scoring the system, not people.

Close the loop

Recover service and telemetry, reconcile the gap, file owned actions (instrumentation, routing, runbook), and schedule the next drill.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-10

How do you design and facilitate an effective GameDay exercise across cross-functional engineering teams?

Answer

A GameDay is a scheduled rehearsal where you inject a known fault into a real system and watch how the whole socio-technical system responds: the architecture, the alerts, the runbooks, and the people. Designing it is picking a fault worth rehearsing and bounding it. Facilitating it is running a room where responders don't know the script and the cross-functional observers (product, support, security, the database team) leave with something they can act on. Most GameDays fail on the second half.

Assumptions worth stating out loud: production observability good enough to see the fault, a way to inject it (AWS FIS, Chaos Mesh, or a hand-run tc/iptables rule), an incident process worth exercising, and executive cover to touch production. Without those you're rehearsing staging, and staging teaches you about staging.

Design: pick the fault from evidence

Pull the last 6–12 months of Sev1/Sev2 and the risk register, and pick the failure you are least confident you'd survive. "We have never actually failed over the primary database" beats "let's kill a random pod." Then write one falsifiable sentence with numbers in it:

Hypothesis: with 100% egress drop on the primary Redis session
cluster in us-east-1a, checkout p99 stays < 800 ms, checkout 5xx
stays < 0.1%, and PagerDuty pages the checkout on-call within 3 min.

Abort gate (pre-registered, automated, not a verbal shout):
  if checkout_5xx_ratio > 1% for 30s  OR  checkout_p99 > 2s
  then FIS stop-condition terminates the experiment and reverts
  the network policy.

The abort gate matters more than the injection. A GameDay that can't be stopped in under a minute is a production incident with extra steps. Note the gate sits looser than the success target on purpose: aborting at 800 ms would stop you learning how bad it actually gets.

Invite the teams whose services sit on the critical path, and get a named owner from each before the day. A GameDay where the only people in the room are the ones who already agree is a team meeting. Start with one critical path and one team; expand once the follow-through loop works.

Facilitate: roles and run-of-show

Four roles, non-overlapping. The facilitator drives the clock and does not debug: that's the discipline that breaks first. The injector holds the tool and the rollback. The scribe timestamps everything: injection, first dashboard signal, page fired, first responder action, abort. Responders get symptoms only, never the injection blueprint. Add a fifth seat for cross-functional observers who aren't on-call; they watch the same screens and write down what they would have told a customer.

TimePhaseFacilitatorObservers
T-15mBaselineConfirm steady state under background loadWatch dashboards go green
T+0InjectAnnounce "fault applied", start clockNote the first signal they see
T+0–20mRespondHalt unvetted manual hotfixes; keep the clockTrack what they'd tell a customer
T+20mAbortVerify injection removed, pools drained, breakers resetConfirm telemetry normal
T+30mHot wash10 minutes, facts only, no fixesOne sentence each

If a real incident fires mid-GameDay, abort and switch to the real one. That's a successful GameDay, not a failed one.

Debrief and follow-through

Within 48 hours, 45 minutes, blameless. The output is not a document; it's tickets with owners and dates, filed in the same backlog as everything else, tagged with the GameDay ID. Findings that don't become tickets are why the second GameDay finds the same bugs.

FindingOwnerTicket
Client pool timeout is 5 s, longer than the 1.5 s failover the design assumesCheckout teamCHK-4412
Runbook step 4 uses a CLI flag removed in the current client versionSRESRE-889
Support had no customer-facing status text for a checkout outageSupportSUP-210

Failure modes of the GameDay itself

  • Everyone already knows the answer. If responders can guess the injection from the invite title, you've tested nothing. Vary the fault and keep the script need-to-know.
  • The facilitator debugs. The moment they start typing, they stop facilitating and the room loses its clock.
  • No abort gate, or a verbal one. Someone has to notice and shout, and under load nobody does.
  • Findings become a Confluence page. No owners, no dates, no tickets: the same failure recurs next quarter.
  • It becomes a leadership demo. If the audience is watching rather than participating, you've built a show, not a rehearsal.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-6

Design experiment stop conditions.

Answer

What I'd say first

Clarify three things before designing: the steady-state signal that defines "healthy", the blast radius I'm allowed to touch, and a fault-removal path that doesn't depend on the component under test. Assume a checkout service on EC2 behind an ALB, a 99.9% availability SLO, and a chaos controller with IAM permission to stop instances.

Stop conditions are three layers, each independently testable:

  • Automatic threshold stop. In AWS FIS this is a CloudWatch alarm ARN. FIS evaluates it periodically; when it enters ALARM, FIS stops the experiment and runs rollback.
  • Hard cap. Maximum duration and maximum blast radius, enforced by the tool. FIS selectionMode is ALL, COUNT(n) or PERCENT(n); action parameters take ISO 8601 durations like PT5M.
  • Independent abort. An out-of-band kill switch (revoke the controller's IAM role, or block its network path) so it works when the controller is the thing that's broken.
JSON
{
  "stopConditions": [
    {"source": "aws:cloudwatch:alarm",
     "value": "arn:aws:cloudwatch:us-east-1:123456789012:alarm:checkout-p99-breach"}
  ],
  "targets": {
    "web": {"resourceType": "aws:ec2:instance", "selectionMode": "PERCENT(10)"}
  }
}

The mechanism, because it decides the numbers

The stop latency is not a FIS setting. It's the alarm's own evaluation window plus FIS's poll plus fault removal. With Period=60, EvaluationPeriods=3, DatapointsToAlarm=2, the alarm can go ALARM about two minutes after the breach begins. Add FIS's poll (tens of seconds) and an instance stop (30–60s) and you're at 3–4 minutes end to end. If the error budget burns at 1% per minute, one stop costs 3–4% of the monthly budget. That arithmetic is what you bring to the review, not "we'll stop if it looks bad."

LitmusChaos does the same job differently: a probe with interval, timeout and attempt runs against the steady state, and engineState: stop on the ChaosEngine halts it. Chaos Toolkit uses --rollback-strategy=always so rollbacks run even when the hypothesis fails, and --hypothesis-strategy controls when steady state is checked: after-method-only means a mid-run degradation is never caught, which is a real trap.

Tight vs loose

tightloose
trigger1 breaching 60s datapoint3 of 5 datapoints
stop latency~1 min~5 min
use whenshared datastore, PII, irreversible faultisolated canary, reversible fault, game day
costfalse stops kill useful experimentsharm can outrun the stop

Deciding criteria: is the fault reversible in seconds, is the blast radius shared with production traffic, and is the steady-state signal faster than the harm. Data corruption is irreversible: stop on the first datapoint. Latency is reversible: you can afford a looser window if the blast radius is 10% of a canary fleet.

Failure modes and how you'd see them

  • Controller dies mid-run, fault persists. FIS actions with a duration self-terminate; Litmus has no such guarantee. Detection: experiment status stuck past its expected end time, alert on that. Cost: a stuck fault on 10% of the fleet until the watchdog fires.
  • Telemetry gap means the alarm can't fire. The stop condition depends on the pipeline the experiment may be degrading. Detection: a second alarm on metric absence with treatMissingData: breaching. Cost: false stops when the metric is legitimately sparse.
  • Abort path shares the controller. Detection: run the abort with the controller down during a game day. Cost: engineering time, and the discovery that your only abort was the thing you broke.
  • Cleanup deletes the evidence. Detection: check the experiment record and audit trail survive a stop. Cost: no postmortem, so the next run repeats the failure.

Test the whole stop path at low scope first, PERCENT(1), including killing the controller mid-run.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-5

Choose between staging and production for an experiment.

Answer

Core answer (first 90 seconds)

Ask what the hypothesis is actually about. If it's about the system: "does the new index hold p99 under 200 ms at 10k rps", "does the retry storm stay bounded when Redis fails over": staging answers it, and production buys you nothing but exposure. If it's about people, "does a three-field signup form lift activation", staging cannot answer it, because staging has no real users, no real traffic mix, and no real intent. Default to staging; escalate to production only for the second kind, and only behind a flag with a guardrail metric and an automatic kill.

State three assumptions before you pick: the change is reversible, it's flag-gated, and you have a guardrail (error rate, p99, revenue per session) wired to an auto-kill.

The arithmetic usually decides it

Suppose the hypothesis is a 10% relative lift on a 5% baseline conversion rate: 5.0% to 5.5%, an absolute delta of 0.005. For 80% power at a two-sided 5% significance level, the usual rule of thumb gives each arm roughly 16·p(1−p)/δ² = 16 × 0.05 × 0.95 / 0.005² ≈ 30,400 users. Two arms, about 61,000 users.

Staging generates maybe 200 synthetic sessions a day. That's 150 days per arm. Production at 2% of 500,000 daily actives gives 10,000 users a day, so the experiment reads out in about six days. The staging run isn't a cheaper version of the production run: it's a different experiment that can't reach significance. That's the whole argument.

Where staging lies to you (illustrative numbers, not measured here)

DimensionStagingProduction
Data volume10k rows; a seq scan looks fine10M rows; the same query is far slower
Traffic mixSynthetic, uniformSkewed: 60% mobile, long tail of bots
DependenciesMocks or a shared sandboxReal payment, real email, real rate limits
Blast radiusOne environmentA slice of paying users

Failure modes and how you catch them

  • Fidelity gap. Staging's 10k-row table hides a query that seq-scans at 10M rows. Catch it by running EXPLAIN on both, or by shadow-reading a production-sized replica. Cost of missing it: the experiment passes in staging and pages someone at 03:00.
  • Shared staging. Another team deploys mid-run and confounds the result. Catch it in the deploy audit log for the window. Cost: the run is void and you repeat it.
  • Sample ratio mismatch. If the split is meant to be 50/50 and you observe 50.8/49.2 across 60k users, that's a chi-square p well under 0.001: the assignment or logging is broken and every metric is suspect. Check it before reading any result.
  • Novelty effect. Day-one lift that decays. Plot the effect by day; if day 1 is three times day 7, you're measuring novelty, not value.
  • Blast radius. Without an auto-kill, a bad variant sits in front of 5% of users for hours. The guardrail is what makes production acceptable at all.

When not to go to production

Irreversible changes: schema migrations, data deletion, anything that writes to a system you can't roll back: stay in staging regardless of the hypothesis. So does anything whose hypothesis is purely mechanical. Production is for questions only real users can answer.

Curated: · Written: · Reviewed:

Difficulty: Medium
Q&A-4

Plan a safe production zone-failure experiment.

Answer

Core answer (first 90 seconds)

The claim I'm testing is narrow: if one AZ of three goes away ungracefully, the service holds its SLO. Before touching production I write that down, plus the assumptions it rests on. Three AZs, a stateless tier behind a load balancer, a quorum datastore with one replica per AZ, and no other maintenance in flight. If any of those is false (say the datastore is two replicas in two AZs), the experiment is no longer "does failover work," it's "we lose quorum," and I stop and fix the topology first.

Then I size the blast radius: one service, one tenant canary, one AZ, business hours, with the on-call and the service owner watching. Business hours is deliberate: I want the people who can diagnose it awake, and I want the real traffic profile.

The arithmetic that decides go/no-go

Each AZ normally carries 1/3 of traffic. Lose one and the other two must each carry 1.5x. So the gate is: can each surviving AZ run at 150% of its steady-state share? If the fleet sits at 60% CPU at peak, 150% of that is 90%: tight but survivable. If it sits at 75%, 150% is 112%: you saturate, and the experiment fails for reasons unrelated to failover logic. That number, not a checklist, is what I bring to the review.

Injection: three options, three different claims

methodwhat it testswhen to use
Drain AZ (remove from LB, wait for connections to close, stop instances)graceful evacuation, rebalancingmaintenance-style claim
Hard kill (FIS AZ power-interruption scenario, or blackhole the subnet with a NACL)failure detection, connection resets, cold startthe real claim
Shadow (replay traffic with the AZ removed from routing)capacity math onlypre-check, no production risk

If the claim is "we survive ungraceful loss," drain is the wrong test: it never exercises the failure detector. I inject progressively: one instance, then the whole AZ.

What breaks, and how I see it

  • Quorum. A 3-replica Raft group loses one replica and keeps quorum (2 of 3), but with zero margin. Any second node event (a rolling restart, a disk) takes writes down. Detection: quorum-error rate on writes. This is why I freeze all other maintenance for the window.
  • Cold cache. Consistent hashing remaps the lost AZ's keys onto the survivors, and those keys are cold. A 95% hit rate drops and the DB absorbs the misses. Detection: cache hit rate and DB connection-pool wait time. If the pool is 200 connections and wait time crosses 50 ms, I abort.
  • Retry amplification. Clients retrying into the surviving AZs can double request rate. Detection: total RPS against baseline.
  • Autoscaling lag. Replacement instances land in the two surviving AZs and take minutes to pass health checks. Detection: healthy-instance count vs. desired.

Abort and rollback

Abort is independent of the injection tool: a kill switch that restores the AZ, owned by someone who isn't running the experiment. Rollback is not "put it back": the returning AZ comes back cold and takes a traffic spike, so I ramp it in over several minutes and watch the same signals. Expand to more tenants only after a clean run and a written review.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-17

Combine load and chaos experiments safely.

Answer

The 90-second answer. I'd run this in a canary slice or a staging environment that mirrors production topology, never against the whole fleet. The load model comes from replaying production arrival rates at roughly 1.5x peak. The fault is scoped to exactly one dependency (one pod of the payment service, or a 200 ms delay on its egress) so I can attribute the result. I ramp load to target with no fault, hold, then inject the fault and hold again. The number I'm hunting is where the system stops degrading gracefully: where p99 crosses the SLO, where the admission limiter starts shedding, and where recovery after the fault clears takes longer than the fault itself.

Why coupling changes the envelope. Load alone and fault alone are both survivable; together they are not, because retries and queueing feed each other. Take a service on 10 replicas, each at 200 rps, p99 40 ms, utilization ρ≈0.6. A fault kills 2 replicas. The remaining 8 must carry 250 rps each, so ρ≈0.75 and p99 climbs to roughly 90 ms: queueing latency scales like 1/(1−ρ). If the client timeout is 100 ms you are now on the edge. Add retries: clients retry twice on timeout, so a 5% timeout rate adds 10% offered load, pushing ρ to ~0.83 and p99 to ~200 ms, which raises the timeout rate to 30%, which adds 60% load. That is a metastable failure: the system does not recover when the fault clears, because the retry debt outlives it. (These figures are illustrative; the shape is what matters.)

Admission control is what breaks the loop, but only if it sheds before the queue grows and the shed is cheap: a 429 that costs ~1 ms and touches no downstream service. A concurrency limiter at 50 in-flight requests per replica does that. The trap: if the limiter is backed by Redis and Redis is the failing dependency, it either fails open (no protection) or fails closed (total outage). Test both, because that interaction is the whole point of coupling the experiments.

The phase table.

phaseloadfaultwhat it proves
1 baselineramp 0→1.5x peak over 10 min, hold 20 minnonecapacity ceiling, p99 at target, generator headroom
2 fault-only0.2x peak200 ms egress delay, 5 minmarginal effect of the fault, recovery time
3 coupledhold 1.5x peaksame fault, 5 minfailure envelope, limiter behavior, retry amplification
4 coupled + shedhold 1.5x peakfault + limiter at 50 in-flightdoes shedding hold the line

Stop thresholds for phase 3: abort if p99 exceeds 2x SLO for 60 s, if error rate passes 5%, if the generator's own CPU passes 80%, or if achieved RPS falls more than 10% below a flat target.

Drive load by arrival rate, not VU count. Closed-loop VUs hide coordinated omission: a slow response reduces the next request's rate, so you never see the tail. In k6:

JavaScript
export const options = {
  scenarios: {
    ramp: {
      executor: 'ramping-arrival-rate',
      startRate: 200,
      timeUnit: '1s',
      stages: [
        { target: 2000, duration: '10m' },
        { target: 2000, duration: '20m' },
      ],
      preAllocatedVUs: 500,
      maxVUs: 2000,
    },
  },
};

Generator saturation. Watch achieved against target RPS. If target is 2000 rps and achieved plateaus at 1400 while generator CPU is pegged, you have found the generator's limit, not the system's. Run generators on separate hosts from the system under test. And never infer failure reserve from idle steady-state traffic: a system at 20% utilization tells you nothing about its behavior at 80%.

What would change my decision. If the fault-only phase already blows the SLO at 0.2x load, the dependency has no redundancy and coupling is pointless: fix that first. If recovery time grows with each coupled iteration, that is metastability; stop and fix the retry budget before running again.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-25

How do you chaos-test client-side resilience patterns (circuit breakers, retry budgets and backoff policies) to prove that an induced dependency failure does not escalate into a retry storm or cascading overload across callers?

Answer

A retry storm is an amplification problem, so the experiment measures amplification, not just whether the dependency failed. Before injecting anything I pin down three things: the caller-side pattern under test (breaker thresholds, retry budget, backoff shape), the dependency's failure mode (timeout, connection refused, 503), and the metric that defines escalation. Attempted requests divided by offered requests at the dependency boundary.

Steady state: attempts/original ≤ 1 + retry budget, dependency-facing RPS below its capacity, breaker closed. Then inject at the dependency (100% of calls delayed past the client timeout, or a 50% 503 rate) and hold longer than the breaker's rolling window and the budget's window. A 10s window needs a multi-minute hold to show steady-state behaviour, not the first spike.

The arithmetic is what makes it checkable. 1,000 offered RPS, 3 retries per request, no budget: 4,000 attempts against a dependency that handles 1,500. That is the storm. With a retry budget of 10% of successful requests, at 50% error you have 500 successes, 50 retries allowed, 1,050 attempts: under capacity. The budget converts an unbounded multiplier into a bounded one.

layers retryingmax amplification (3 retries each)
13x
29x
327x

That multiplication is why the budget must be enforced at one layer or shared, not re-implemented per hop.

Backoff: exponential with full jitter. Without jitter every caller retries at the same instant and the recovery spike is worse than the outage.

Breaker: it must open on the injected fault, stay open for the hold, and half-open probes must be limited (1–3 concurrent) and jittered. If it never opens, check whether timeouts increment the failure counter: a common bug where only 5xx does.

Metrics (OpenTelemetry): attempts/original per caller, breaker state gauge, dependency RPS, retry-budget tokens remaining, p99 latency. A storm looks like attempted RPS rising while offered RPS is flat.

Failure modes: per-instance retry budgets (N pods × budget = N× amplification); retries on non-idempotent calls; breaker flapping; a budget enforced only in one client so a new service bypasses it; retrying connection-refused when fast-fail is correct.

Trade-offs: an aggressive breaker trips on transient blips and costs availability; a lenient one offers no protection. Mesh-enforced budgets are cluster-wide and can't be bypassed by a new client; client-side budgets are per-process and easy to get wrong.

After fault removal, measure recovery: time until attempts/original returns to 1.0 and the breaker closes. A slow recovery with a synchronized retry spike means jitter is missing.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-20

How do you design and execute chaos experiments in CI/CD deployment pipelines without causing pipeline flakiness or false positives?

Answer

Running chaos tests in CI/CD requires treating resilience regressions like integration failures: experiments must be scoped, deterministic, bounded by time, and isolated from ambient environmental noise. If a test fails because of a noisy neighbor or an unstable test harness rather than an architectural regression, developers will bypass the gate.

1. Isolated Ephemeral Environments & Workload Generation

Avoid shared staging environments. Run pipeline experiments against ephemeral namespaces (e.g., in Kubernetes using tools like Chaos Mesh or LitmusChaos) or dedicated canary rollouts where traffic and dependencies are strictly controlled.

  • Synthetic Traffic Generator: Use a deterministic workload generator (e.g., k6, Locust) running at a calibrated request rate (e.g., 200 RPS) rather than stochastic live traffic.
  • Mocked/Virtual L7 Dependencies: Use wiremock or service virtualization for external third-party APIs to isolate chaos to internal mechanisms (timeouts, retries, fallbacks) without triggering third-party rate limits.

2. The Deterministic Test Phase Sequence

Flakiness occurs when faults are injected before baseline steady-state stabilizes or when test assertions evaluate before recovery finishes.

[Deploy Ephemeral Stack]
       │
       ▼
[Phase 1: Baseline Check] ──(p99 < 80ms, 0% 5xx for 60s)──> If FAIL: Abort (Infra Flake)
       │
       ▼
[Phase 2: Fault Injection] ──(Inject 300ms delay via ChaosMesh) + Steady-State Validation
       │                     - Circuit breaker trips to fallback?
       │                     - Error rate stays < 1%?
       ▼
[Phase 3: Fault Teardown]
       │
       ▼
[Phase 4: Cooldown & Recovery] ──(Metrics return to baseline within 30s)──> Pass/Fail Pipeline

3. Falsifiable Hypotheses with Ratio-Based SLOs

Avoid raw latency checks during fault injection, which fluctuate based on test runner CPU contention. Instead, measure control-flow properties:

  • Circuit Breaker Engagement: When downstream latency is set to 500ms (above the 150ms timeout), p99 must spike for at most 3 requests before the circuit breaker trips, routing 100% of subsequent calls to cached fallback with 200 OK responses.
  • Deadline Propagation: Upstream services must drop canceled requests rather than accumulating work.

| Failure Mechanism | Injected Fault | Steady-State Assertion | Anti-Flakiness Guard | |---|---|---|---|---| | Dependency Timeout | 2000ms network delay via tc/ChaosMesh | Circuit opens within 5s; fallback rate = 100%; error rate = 0% | Warm up connection pool for 30s prior to measurement | | Pod Eviction | SIGKILL to 1 replica (Kubernetes PDB = 1) | HTTP 5xx < 0.05%; zero dropped TCP connections | Ensure replica count >= 2 and readinessProbe has 1s period | | Resource Starvation | 100% CPU throttle on worker pod | Work queue transfers to sibling node; max job latency < 2000ms | Pin CPU limits explicitly; no shared k8s node CPU pools |

4. Flakiness Mitigation Strategies

  • Strict Pre-Condition Gating: Check baseline latency and error rate for 30–60s prior to injection. If the baseline fails, the run is flagged as an Environment Error, not a Resilience Regression.
  • Synchronized Metric Probes: Query telemetry directly from Prometheus or OpenTelemetry collector APIs over an explicit measurement window [t_inject + warmup, t_stop] rather than relying on pipeline runner client-side timings.
  • Guaranteed Cleanup (Finalizers): Pipeline job cancellations (e.g., git push interrupting a workflow) must run teardown hooks (Kubernetes finalizers, always() CI blocks) to delete Chaos Custom Resources, preventing orphaned network packet drops on shared cluster nodes.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-12

Govern chaos-tool access and target selection.

Answer

What I'd say first

Assume a multi-tenant Kubernetes cluster, prod and staging sharing a control plane, and both engineers and CI able to start experiments. The chaos controller holds cluster-wide access to the CRDs, so the controller is not what you constrain: the callers are.

Three controls carry the weight. Every caller authenticates with a workload identity (IRSA on EKS, Workload Identity on GKE, or a SPIFFE ID), never a static token, so a role change takes effect on the next token rather than the next rotation. The target set is bounded at admission time, not by convention: a ValidatingAdmissionPolicy (GA in Kubernetes 1.30) rejects any chaos object whose selector namespaces or mode fall outside the allowlist. And a second person sits between the experiment being written and being released: an aws:approve step in an SSM Automation document, or a required reviewer on the PR that merges the manifest.

Why each one works

Workload identity works because the credential is short-lived and bound to the pod's service account, so there is no long-lived secret to leak out of CI. Admission-time bounding works because it is evaluated on every create and update, including the one a human types at 3 a.m. RBAC alone cannot do this: resourceNames does not restrict create, because the object name is not known at authorization time. The approval gate works because it separates the author from the releaser, which is the only control that catches a correctly scoped experiment aimed at the wrong service.

YAML
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
  name: chaos-scope
spec:
  matchConstraints:
    resourceRules:
      - apiGroups: ["chaos-mesh.org"]
        resources: ["podchaos", "networkchaos"]
        operations: ["CREATE", "UPDATE"]
  validations:
    - expression: >
        !has(object.spec.selector.namespaces) ||
        object.spec.selector.namespaces.all(ns, ns in ['checkout-staging','checkout-canary'])
      message: "chaos target namespace is not allowlisted"
    - expression: "object.spec.mode in ['one','fixed','fixed-percent']"
      message: "mode 'all' and 'random-max-percent' are not permitted"

Blast radius, with numbers

checkout-staging holds 240 pods. mode: fixed-percent, value: "10" kills 24. A deploy adds app=checkout to the 80 pods in payments; the selector now matches 320 and the same manifest kills 32, roughly 8 of them payment pods. Nothing in the manifest changed: the target set did. On AWS FIS the equivalent bound is selectionMode: PERCENT(10) over a resourceTags filter, which is why the tag, not an ARN list, is the thing to review. Either way you record the resolved set, not the selector: list the matching pods with the same selector immediately before start, diff against the approved list, and fail the run on any addition.

Alternatives, and when the light version is enough

The heavy version is a platform, Litmus ChaosCenter or Chaos Mesh plus Argo Workflows, which gives per-team projects, scheduling and a UI, at the cost of a control plane with its own auth and database to harden. The light version is a CI job that applies a signed manifest, with the admission policy above and PR review as the two-person control; it costs about a day and adds no new service. Take the light version when the target is a single-replica canary namespace or non-prod. Take the heavy one when clusters are multi-tenant, when stateful dependencies are shared, or when an auditor needs a per-experiment approval record.

Failure modes and how you see them

failure modewhat it looks likedetection
selector driftmanifest unchanged, target set grewdiff resolved pods against the approved list before start; alert if the resolved count exceeds approved by 10%
dead stop conditionexperiment runs to completiontrip the FIS stopConditions alarm in a game day and confirm the run halts
approval bypassa principal other than the pipeline can create chaos CRsenumerate every principal with create on the chaos CRDs; assert the set is exactly the pipeline role and the controller's service account
orphaned schedulea Chaos Mesh Schedule outlives its incidentalert on any chaos object older than its declared duration

A stop condition you have never fired is a comment.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-24

Coordinate chaos experiments with vendors and shared platforms.

Answer

Clarify first: which vendor, which shared platform, and what blast radius is acceptable. Assume you have a written runbook and a named abort authority. The answer: agree in writing on three things before you inject. The exact fault, the stop condition, and who can abort. Use the vendor's own safety primitives. On shared platforms, isolate by tenant or namespace and run in a canary cell first. Then execute with one coordination record and independent local stops.

Mechanism. A stop condition bound to a CloudWatch alarm aborts the experiment automatically when the alarm enters ALARM: you don't wait for a human to notice. Configure one on every experiment; the abort path must not depend on someone watching a dashboard. Shared fate is the second mechanism: a network partition inside one tenant's namespace can still saturate a shared broker's network, so tenant isolation is what keeps the blast radius local. Third, contract drift: your stub encodes today's vendor API, and the vendor can change it, so contract tests in CI are what catch the gap before production does.

Trade-offs. Don't run live when the vendor has no sandbox and no programmatic stop, or the shared platform has no tenant isolation. Coordination costs roughly 2-3 hours per experiment (change request, maintenance window, rollback plan) plus the vendor's review time. If the hypothesis is testable in a sandbox, do that. Live coordination earns its cost only when the failure mode depends on the vendor's real infrastructure: their rate limiter, their auto-scaler, their shared network.

Failure modes. (a) Vendor rate limit. You plan 100 injections; the vendor API throttles you at 10 requests/second, so only a fraction land and the experiment is invalid. Detect by counting successful injections against the plan and reading the vendor's throttling response headers. Cost: a wasted window and a false "no impact" result. (b) Shared fate. Your experiment triggers the vendor's auto-scaler, which adds capacity that other tenants also consume. Detect by watching the vendor status page and cross-tenant latency during the window. Cost: an incident you caused for a team that never agreed to it. (c) Contract drift. Your stub returns 200 OK while the vendor now requires an extra header, so the integration passes in the sandbox and fails in production. Detect with contract tests in CI against the vendor's current schema. Cost: a production incident discovered by a customer.

Coordination record: one row per experiment:

fieldexample
experiment IDfis-exp-2025-03-14-kafka-partition
ownerplatform-team@example.com
stop conditionCloudWatch alarm ConsumerLagHigh: lag > 10,000 for 2 min
abort pathFIS console "Stop experiment", or the StopExperiment API call by the on-call
blast radiustenant-a namespace only, 5 min
evidence linkhttps://wiki.example.com/chaos/2025-03-14

Worked trace (hypothetical figures). A 5-minute network partition against a shared Kafka cluster used by three teams. Create a FIS experiment template with action aws:network:disrupt-connectivity, target the brokers tagged chaos:allowed=true, duration 5 minutes, stop condition on the CloudWatch alarm ConsumerLagHigh (lag > 10,000 for 2 minutes). Start the experiment. FIS injects the disruption. At 2 minutes consumer lag reaches 12,000; the alarm enters ALARM; the stop condition aborts the experiment and the network is restored. Verify: lag falls below 1,000 within 3 minutes, and no other tenant's latency moved. Independent local stop: each team can pause its own Chaos Mesh experiment with the pause annotation, so a team can opt out without waiting on the coordinator.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-23

Migrate from ad hoc failure scripts to a governed platform.

Answer

Assumptions first. Kubernetes workloads, roughly 40 shell scripts across four teams, a few holding cluster-admin or a prod IAM role, no shared schema, no audit trail. If it is one team and five scripts, do not build a platform: put them in a repo with review and one ServiceAccount each. The rest of this assumes the 40-script case.

The migration is not "replace scripts with a tool." It is moving the unit of control from a credential to a versioned experiment object. Once the experiment is declarative, identity, blast-radius caps, approvals and audit attach to the object instead of to whoever holds the credential. That is the whole argument for centralising.

The object. A Chaos Mesh NetworkChaos for a checkout latency experiment:

YAML
apiVersion: chaos-mesh.org/v1alpha1
kind: NetworkChaos
metadata:
  name: checkout-latency-5pct
  namespace: chaos-prod
spec:
  action: delay
  mode: fixed-percent
  value: "5"
  selector:
    namespaces: [checkout]
    labelSelectors: {app: checkout-api}
  delay:
    latency: "200ms"
    correlation: "50"
  duration: "10m"

Trace it: the controller admits the object, matches pods by label, applies tc netem delay to 5% of them, holds for 10 minutes, then reverts. mode: fixed-percent with value: "5" is the blast-radius cap: it is a field, not a convention, so a reviewer can see the ceiling before approving. Note what is missing: Chaos Mesh has no built-in steady-state abort. It will run the full 10 minutes even if checkout p99 is already at 900 ms. You get abort-on-probe from LitmusChaos probes, or from AWS FIS stop conditions wired to a CloudWatch alarm. That difference decides tool choice more than the fault catalogue does.

Phases, with exit criteria.

PhaseControl addedExit criterion
InventoryOwner, target, fault, credential per scriptEvery script has a named owner; unknown ones quarantined
SchemaVersioned experiment CRD, CI rejects unknown fieldsA script can be expressed as an object and dry-run
IdentityPer-experiment ServiceAccount or IAM role, scoped to target namespace/tagsNo experiment runs as cluster-admin
GuardrailsBlast-radius cap, duration, stop condition, approvalA deliberately bad experiment aborts without human action
MigrationLow-risk templates first, then destructive onesAchieved fault matches the script's, verified by the same probe
RetirementDirect credentials revokedControlled capability and rollback proven for that fault

Trade-offs. Buy versus build: FIS gives you IAM-per-experiment and stop conditions out of the box but is AWS-only; Chaos Mesh is free and Kubernetes-native but you own the controller's RBAC and the abort logic. Centralise versus federate: a single approval queue is auditable but adds latency, if the median approval is three days (hypothetical, but typical of a first-cut process), teams route around it and you have bought nothing. Federate approvals to the owning team with a platform-enforced cap, and keep central review only for faults that cross a namespace or touch data.

Failure modes, with detection. A stop condition that never fires is the dangerous one: usually an alarm on the wrong metric or dimension. Detect it by injecting a known-bad fault in a game day and confirming the abort; if it does not abort, the stop condition is decorative. Shadow scripts: compare experiments created against processes still using direct credentials in cloud audit logs; a widening gap means governance is being bypassed. Quarantine backlog: track the age of the quarantine queue, not its size. Schema drift: reject unknown fields at admission with a structural CRD or a Kyverno/OPA policy, so drift fails loudly at apply time. Controller sprawl: the platform's own ClusterRole is now the biggest credential in the cluster. Review it on the same cadence as the scripts it replaced.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-22

Test the chaos platform itself.

Answer

I'd interpret this as: before you trust your chaos platform to inject faults into production, how do you validate its own safety and correctness? Assume a typical architecture like Chaos Mesh or LitmusChaos: a central controller, per-target agents, an authorization layer, and a stop-condition evaluator. The goal is to prove the platform cannot exceed approved scope, cannot leave faults behind, and cannot hide what it did.

Start with authorization and scope. A denied identity must not be able to start an experiment. A selector matching zero targets must fail closed: no experiment starts. A selector matching more targets than approved must be rejected. For example, if your policy allows at most 5 pods, a selector matching 6 must be blocked. Then test the controller. Kill the controller mid-experiment. The agent should detect the loss via missed heartbeats. Suppose heartbeat interval is 5s and the controller is considered dead after 3 misses (15s). The agent must then either expire the fault locally or refuse to start new ones. If the fault spec includes a target-side TTL, the agent should remove the fault when the TTL expires. If not, the agent should fail closed and remove the fault immediately. Test duplicate execution: send the same experiment twice; the agent should be idempotent. No double fault. Test stop conditions: inject a fault that raises error rate above 5% for 30s; the platform must halt the experiment within 10s. Test cleanup after timeout: set a 60s experiment, let it expire, and verify all iptables rules, tc qdiscs, or sidecar processes are gone.

Here is a worked trace for controller loss. At t=0, the controller sends a fault spec: block traffic to 10.0.0.5 for 300s. The agent applies an iptables rule and starts a local 300s timer. At t=5,10,15, the agent sends heartbeats; no response. At t=20, the agent marks the controller unreachable. Because fail-closed is enabled, it does not accept new faults. It checks the local timer: 280s remain. It continues the fault because the spec included a target-side expiry. At t=300, the agent removes the iptables rule. At t=305, the controller recovers, queries the agent, and sees no active fault. The audit log shows the fault expired at t=300. Pass if the fault is gone by t=305. Fail if it persists beyond t=310.

TestSetupExpectedFail signal
Denied identityUser without chaos:write tries to start experiment403, no fault appliedFault applied or 200
Zero-target selectorSelector matches no podsExperiment rejected, no faultExperiment starts
Controller lossKill controller at t=30s of 300s faultFault expires at t=300sFault persists past t=310s
Duplicate executionSend same experiment twiceOne fault, second is no-opTwo faults or error
Stop conditionError rate >5% for 30sExperiment halts within 10sContinues past 40s
Cleanup timeout60s experiment, let expireAll rules removed by t=70sRules remain

The key tradeoff is fail-closed versus fail-open. Fail-closed means if the controller is unreachable, the agent removes all faults and refuses new ones. This is safer for production but can abort long-running experiments. Fail-open means the agent continues existing faults and may accept new ones from a stale cache. Use fail-closed when the blast radius is large or the fault is destructive. Use target-side expiry with a longer TTL only when you need faults to survive controller restarts, and only in a controlled environment. Never use fail-open in production.

If any test fails, especially if the platform can exceed approved scope or leave a fault behind, treat it as a security incident. Remediate before production use. The platform must be immutable in audit and visible to operators: every experiment start, stop, and expiry should be logged with who, what, when, and why.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-21

Measure whether a chaos program is effective.

Answer

The 90-second answer. Ask one question: after a quarter of chaos, can you name a failure you didn't know about before, and show the fix held? If not, the program is theatre. Three signals answer it. First, the falsification rate: the share of experiments where your steady-state hypothesis turned out to be wrong. A program that never falsifies anything is either injecting faults you already survive or not injecting hard enough. Second, finding-to-closure with rerun evidence: every finding has an owner, a change, and a rerun of the same experiment showing the hypothesis now holds. A fix without a rerun is a guess about a fix. Third, recurrence: the same failure class showing up in production after you called it closed. That number is the only one that can't be gamed by writing tickets.

Why these and not counts. The steady-state hypothesis is the unit of work in chaos engineering (Principles of Chaos Engineering, principlesofchaos.org): you assert normal behaviour, inject a real-world event, and see whether the assertion survives. So the outcome of that assertion is the natural measurement. Untested-assumption age is a proxy for exposure: an assumption nobody has ever exercised has unknown validity, and the longer it has sat untested, the longer you've been running on a belief. Rerun evidence is what separates a change from a hope: the same fault, the same assertion, now passing.

A worked quarter. Figures below are from a hypothetical program, not benchmarks.

MetricWhat it tells youHealthy band (example)
Falsification rateAre you injecting hard enough?20–30% of experiments
Median finding-to-rerunIs the loop closing?under 30 days
Recurrence after closureDid the fix actually hold?under 10%
Abort latency (p99)Can you stop safely in prod?under 30 s
Stale templatesDoes the catalog match reality?0 for decommissioned services

40 experiments, 9 falsified hypotheses, 6 closed with a passing rerun, 2 recurred in production, 1 open past 30 days. Falsification 22%, recurrence 22%: the loop closes but the fixes are shallow. That's a program to fix, not to celebrate.

Failure modes and how you'd see them. If abort has never been invoked, you're not pushing hard enough, or you don't trust the abort, which is worse. Measure abort latency directly and count invocations. If recurrence is high while closure looks fast, findings are being closed on the ticket, not on the rerun; sample the rerun evidence. If the catalog still lists services you decommissioned last year, your coverage number is fiction: retire templates deliberately and re-baseline.

What not to measure. Experiment count, blast-radius totals, and per-team leaderboards. All three reward volume over learning and push people to suppress findings. Don't headline chaos MTTD/MTTR either; those belong to incident response, and borrowing them makes the chaos program look like a second on-call rota.

Trade-off to state out loud. Falsification rate can be pushed up cheaply by injecting absurd faults. Pair it with a rule that every falsified hypothesis becomes a tracked finding, so the incentive is to find real ones, not to break things theatrically.

Curated: · Written: · Reviewed:

Difficulty: Hard
Q&A-1

Design a chaos-engineering program for a growing platform.

Answer

What I'd say first

I'd scope it to one service and one dependency before anything else. A chaos program is a loop: hypothesis → bounded fault → guardrail → evidence → fix → rerun. The deliverable isn't experiments run, it's findings closed.

Assumptions I'd state up front: per-service SLOs with alerting, a rollback path, and at least one environment that mirrors production topology. If any of those is missing, chaos is an outage generator: I'd fix observability first and run tabletop exercises only.

The loop, concretely

For each material assumption: "checkout survives losing one of six pods", "the API survives a 30s Redis failover": write the steady state as a metric, threshold and window: checkout success rate ≥ 99.5% over 5 minutes, p99 < 200 ms. Then pick the smallest fault that tests it. Chaos Mesh, one pod, 30s:

YAML
apiVersion: chaos-mesh.org/v1alpha1
kind: PodChaos
metadata: { name: kill-one-checkout }
spec:
  action: pod-kill
  mode: one
  selector:
    namespaces: [checkout]
    labelSelectors: { app: checkout }
  duration: '30s'
  scheduler: { cron: '@every 10m' }

Trace it (numbers illustrative): 6 replicas, PDB minAvailable 4, each pod at 45% CPU. Kill one at t=0. Readiness fails for ~8s, the endpoint is removed, 270% total CPU spreads over 5 pods = 54% each, p99 goes 120 → 145 ms. Inside the 200 ms guardrail, so the assumption holds. Now change mode to fixed-percent: 50 and 3 pods die: 270/3 = 90% CPU per pod, p99 crosses 200 ms, the stop condition fires and the run aborts. Same template, different blast radius, opposite result: that's why the hypothesis gets written down before the fault.

Guardrails and abort

The abort must watch the same dimension as the fault. AWS FIS stopConditions bound to a CloudWatch alarm is the pattern. The classic failure is an alarm on node CPU while the fault is on the database: nothing trips, the experiment runs its full duration, and the incident is found by customers. 20 minutes of degraded checkout. Second failure: the target selector is too broad, so app: checkout also matches the checkout worker sharing the DB and blast radius leaks past the service; detect it by diffing the affected-pod list against the intended target list after every run. Third: the chaos identity is too broad. A role that can stop any instance in the account turns one bad template into a control-plane outage. One role per environment, scoped to tagged targets, reviewed in CloudTrail.

Why rerun beats volume

An experiment re-run against unchanged code produces the same result: zero new information. The unit of progress is a closed finding: hypothesis, fault, observed, fix, rerun passes. The passing rerun is the only evidence the fix is durable; experiment count is a vanity metric.

When not to run it

No observability on the target, no rollback, no failover, a single-region database with no replica, regulated data, or a freeze window: skip. Staging can't reproduce production traffic skew or real dependency latency, so for anything latency- or contention-sensitive I'd run a canary in production at 1% of traffic for 5 minutes rather than trust staging. First experiment in an org: tabletop, then staging, then canary production.

Curated: · Written: · Reviewed:

Difficulty: Hard