1,008 real-world-style backend scenarios
3,024 decisions across 18 topics. Practice diagnosis, containment and prevention with evidence, reasoned reviews and verification checks.
1008 exercises across 18 weighted topics: core engineering, system design, software patterns, cybersecurity, cloud, Java 8, Java 21 and focused AI integrations. Related exercises revisit mechanisms through incident investigation, implementation review, recovery and architecture decisions. Questions and acceptance gates differ by decision lens. The cases are realistic educational simulations based on documented platform behavior, not actual customer incident reports.
Start with the three free drills, then use search and topic filters in the practice lab. Paid scenario links open your account page until access is verified.
Coverage chosen for practical engineering
For software engineers, leads and architects, with a practical Java backend emphasis. Topic counts reflect foundational breadth, failure consequences and usefulness across roles. They are editorial allocations, not industry percentages.
| Topic | Scenarios | Coverage |
|---|---|---|
| Programming fundamentals | 40 | Collections, numeric and time semantics, errors and resource ownership, with practical Java examples. |
| Software design & patterns | 64 | Spring boundaries, composition, Strategy, Adapter, State, Decorator and maintainable domain design. |
| System design & architecture | 80 | Capacity, consistency, service boundaries, migration, trade-offs and decisions for leads and architects. |
| Testing & quality | 80 | Unit, integration, contract, concurrency, fault and performance tests with meaningful acceptance gates. |
| SQL & data access | 96 | Transactions, JPA fetch shape, PostgreSQL plans, constraints, migrations and connection budgets. |
| HTTP & API contracts | 80 | Validation, compatibility, pagination, timeouts, safe retries and clear client contracts. |
| Concurrency & async | 64 | Executors, cancellation, shared state and resource ownership, with Java backend examples. |
| Distributed systems | 80 | Idempotency, retries, partial failure, leases, consistency and safe recovery. |
| Messaging & events | 64 | Kafka delivery, consumer recovery, ordering, schemas, outbox and replay safety. |
| Caching & performance | 64 | Invalidation, bounded memory, JVM diagnostics, measurement and workload-aware optimization. |
| Cybersecurity | 80 | Authentication, authorization, service boundaries, input handling, secrets and abuse controls. |
| Cloud & delivery | 56 | Kubernetes, infrastructure changes, identity, deploys, rollback and scarce resources. |
| Observability & reliability | 40 | Useful signals, SLOs, alerting, incident evidence and recovery validation. |
| Web & client fundamentals | 32 | Request races, browser security, accessibility and API-facing client state. |
| Data integrity & pipelines | 16 | Reconciliation, ordering, schema evolution, retention and data provenance. |
| AI integrations | 16 | Backend tool authorization, retrieval isolation, cost limits and evidence-based evaluation. |
| Java 8 features | 24 | Streams, collectors, lambdas, functional interfaces, Optional, date/time and CompletableFuture. |
| Java 21 features | 32 | Virtual threads, records, pattern matching, sequenced collections and explicitly labeled preview boundaries. |
How to use the exercises
Practice incident investigation, implementation review, recovery and architecture decisions. Related exercises can revisit a mechanism through different questions and acceptance gates; this is not a claim of 1008 unrelated customer incidents. Evidence is simulated from documented behavior.
Research behind the coverage
- ACM / IEEE-CS / AAAI CS2023 knowledge areas
- Java learning and API fundamentals
- Spring testing guidance
- PostgreSQL concurrency control
- Microsoft architecture patterns and trade-offs
- Google SRE engineering topics
- OWASP API Security Top 10
- MDN client engineering fundamentals
SQL & data access · 96 scenarios
The database is quiet. The pool is full. · Free
Checkout latency spikes while database CPU stays low. Find what is holding the connections.
The endpoint that runs 101 queries.
One list request fans out into a query per order.
Two orders buy the last item.
Two requests read stock = 1 and both claim success.
Transfers freeze in opposite directions.
Two money-transfer transactions lock the same rows in a different order.
The exception was thrown. The data committed.
A checked export failure does not trigger the rollback the developer expected.
A 20-row page loads the entire result.
Collection fetching undermines a query limit and creates a memory spike.
The inner transaction commits alone
Outer order transaction rolls back; REQUIRES_NEW audit insert remains committed; both calls crossed proxies. Incident investigation: choose a response and a verifiable acceptance gate.
The worker thread has no transaction
A transactional service submits a JDBC write to an executor; that thread reports no active transaction. Incident investigation: choose a response and a verifiable acceptance gate.
The wrong transaction manager
A reporting write commits although the annotated business transaction rolls back; two data sources use different managers. Incident investigation: choose a response and a verifiable acceptance gate.
The retry repeats inside a doomed transaction
Three retry attempts reuse one rollback-only transaction; each appears successful before commit fails. Incident investigation: choose a response and a verifiable acceptance gate.
The lazy field fails after return
Service closes persistence context; JSON serialization then accesses an uninitialized relation and fails. Incident investigation: choose a response and a verifiable acceptance gate.
The bulk update leaves old objects
Bulk SQL updates status to shipped; the same persistence context still returns loaded entities with pending status. Incident investigation: choose a response and a verifiable acceptance gate.
The deleted child stays in the database
Parent collection drops a child; no explicit delete or configured orphan removal exists. Incident investigation: choose a response and a verifiable acceptance gate.
The detached entity overwrites a newer value
An old detached object is merged without version checking after another request changed the row. Incident investigation: choose a response and a verifiable acceptance gate.
The entity is equal until persisted
An entity enters a HashSet before ID assignment; its ID-based hash changes after persistence. Incident investigation: choose a response and a verifiable acceptance gate.
The batch insert flushes every row
Loop calls saveAndFlush per item; database observes individual statement round trips despite batching configuration. Incident investigation: choose a response and a verifiable acceptance gate.
The join multiplies the report
Joining two independent one-to-many collections creates many row combinations and inflated aggregate totals. Incident investigation: choose a response and a verifiable acceptance gate.
The missing tenant predicate
A repository method filters invoice ID but omits tenant; overlapping local IDs return another customer's row. Incident investigation: choose a response and a verifiable acceptance gate.
The giant persistence context
An import retains every managed entity across a million-row transaction; heap grows although processing is sequential. Incident investigation: choose a response and a verifiable acceptance gate.
The enum changes yesterday's records
Stored ordinal 1 meant approved; a new enum constant inserted before it changes interpretation. Incident investigation: choose a response and a verifiable acceptance gate.
The implicit flush breaks a read
A SELECT triggers flush of an earlier invalid pending entity; developers blame the read query. Incident investigation: choose a response and a verifiable acceptance gate.
The identifier generator serializes inserts
All writers contend on one ID allocation row; traces wait on that row before inserting otherwise unrelated entities. Incident investigation: choose a response and a verifiable acceptance gate.
The collection replacement deletes too much
A partial request replaces the whole aggregate collection; absent members are treated as removals. Incident investigation: choose a response and a verifiable acceptance gate.
The migration waits behind a reader
ALTER TABLE waits; a long transaction holds a conflicting lock even though its last SELECT finished minutes ago. Incident investigation: choose a response and a verifiable acceptance gate.
The index exists but the scan stays huge
Query applies lower(email); available index is on raw email; plan scans most rows. Incident investigation: choose a response and a verifiable acceptance gate.
The replica misses a fresh order
Write succeeds on primary; immediate read is routed to an asynchronously lagging replica and returns not found. Incident investigation: choose a response and a verifiable acceptance gate.
The prepared query gets slower for one tenant
Small tenants are fast; a large tenant reuses a plan with poor row estimates and large nested-loop work. Incident investigation: choose a response and a verifiable acceptance gate.
The vacuum cannot reclaim old rows
Dead tuples accumulate; an hours-old snapshot remains open and cleanup cannot remove needed row versions. Incident investigation: choose a response and a verifiable acceptance gate.
The sequence jumps after rollback
Failed inserts consume generated IDs; committed rows contain gaps while uniqueness remains intact. Incident investigation: choose a response and a verifiable acceptance gate.
The upsert replaces fresher data
An older retry performs ON CONFLICT UPDATE and overwrites a newer source version. Incident investigation: choose a response and a verifiable acceptance gate.
The unique check races
Two requests both find no matching row; both insert because the database lacks a unique constraint. Incident investigation: choose a response and a verifiable acceptance gate.
The search with offset slows each page
Pagination requests increasingly large OFFSET values; scanned and discarded rows grow. Incident investigation: choose a response and a verifiable acceptance gate.
The idle transaction blocks checkout
A session is idle in transaction while holding a row lock; many short updates queue behind it. Incident investigation: choose a response and a verifiable acceptance gate.
The lock-free assumption fails at repeatable read
Two concurrent writers see an invariant satisfied and update different rows; the combined state violates the rule. Incident investigation: choose a response and a verifiable acceptance gate.
The sort spills to disk
Query latency rises with temp-file bytes; sort input exceeds its available memory budget. Incident investigation: choose a response and a verifiable acceptance gate.
The JSON predicate ignores the intended index
A report extracts a JSON text field and casts it; the existing index targets a different JSON operator. Incident investigation: choose a response and a verifiable acceptance gate.
Serverless bursts exhaust database connections
Concurrent invocations reach 600; database connection limit is 200; each opens its own pool. Incident investigation: choose a response and a verifiable acceptance gate.
The inner transaction commits alone — implementation review
Outer order transaction rolls back; REQUIRES_NEW audit insert remains committed; both calls crossed proxies. Implementation review: choose a response and a verifiable acceptance gate.
The worker thread has no transaction — implementation review
A transactional service submits a JDBC write to an executor; that thread reports no active transaction. Implementation review: choose a response and a verifiable acceptance gate.
The wrong transaction manager — implementation review
A reporting write commits although the annotated business transaction rolls back; two data sources use different managers. Implementation review: choose a response and a verifiable acceptance gate.
The retry repeats inside a doomed transaction — implementation review
Three retry attempts reuse one rollback-only transaction; each appears successful before commit fails. Implementation review: choose a response and a verifiable acceptance gate.
The lazy field fails after return — implementation review
Service closes persistence context; JSON serialization then accesses an uninitialized relation and fails. Implementation review: choose a response and a verifiable acceptance gate.
The bulk update leaves old objects — implementation review
Bulk SQL updates status to shipped; the same persistence context still returns loaded entities with pending status. Implementation review: choose a response and a verifiable acceptance gate.
The deleted child stays in the database — implementation review
Parent collection drops a child; no explicit delete or configured orphan removal exists. Implementation review: choose a response and a verifiable acceptance gate.
The detached entity overwrites a newer value — implementation review
An old detached object is merged without version checking after another request changed the row. Implementation review: choose a response and a verifiable acceptance gate.
The entity is equal until persisted — implementation review
An entity enters a HashSet before ID assignment; its ID-based hash changes after persistence. Implementation review: choose a response and a verifiable acceptance gate.
The batch insert flushes every row — implementation review
Loop calls saveAndFlush per item; database observes individual statement round trips despite batching configuration. Implementation review: choose a response and a verifiable acceptance gate.
The join multiplies the report — implementation review
Joining two independent one-to-many collections creates many row combinations and inflated aggregate totals. Implementation review: choose a response and a verifiable acceptance gate.
The missing tenant predicate — implementation review
A repository method filters invoice ID but omits tenant; overlapping local IDs return another customer's row. Implementation review: choose a response and a verifiable acceptance gate.
The giant persistence context — implementation review
An import retains every managed entity across a million-row transaction; heap grows although processing is sequential. Implementation review: choose a response and a verifiable acceptance gate.
The enum changes yesterday's records — implementation review
Stored ordinal 1 meant approved; a new enum constant inserted before it changes interpretation. Implementation review: choose a response and a verifiable acceptance gate.
The implicit flush breaks a read — implementation review
A SELECT triggers flush of an earlier invalid pending entity; developers blame the read query. Implementation review: choose a response and a verifiable acceptance gate.
The identifier generator serializes inserts — implementation review
All writers contend on one ID allocation row; traces wait on that row before inserting otherwise unrelated entities. Implementation review: choose a response and a verifiable acceptance gate.
The collection replacement deletes too much — implementation review
A partial request replaces the whole aggregate collection; absent members are treated as removals. Implementation review: choose a response and a verifiable acceptance gate.
The migration waits behind a reader — implementation review
ALTER TABLE waits; a long transaction holds a conflicting lock even though its last SELECT finished minutes ago. Implementation review: choose a response and a verifiable acceptance gate.
The index exists but the scan stays huge — implementation review
Query applies lower(email); available index is on raw email; plan scans most rows. Implementation review: choose a response and a verifiable acceptance gate.
The replica misses a fresh order — implementation review
Write succeeds on primary; immediate read is routed to an asynchronously lagging replica and returns not found. Implementation review: choose a response and a verifiable acceptance gate.
The prepared query gets slower for one tenant — implementation review
Small tenants are fast; a large tenant reuses a plan with poor row estimates and large nested-loop work. Implementation review: choose a response and a verifiable acceptance gate.
The vacuum cannot reclaim old rows — implementation review
Dead tuples accumulate; an hours-old snapshot remains open and cleanup cannot remove needed row versions. Implementation review: choose a response and a verifiable acceptance gate.
The sequence jumps after rollback — implementation review
Failed inserts consume generated IDs; committed rows contain gaps while uniqueness remains intact. Implementation review: choose a response and a verifiable acceptance gate.
The upsert replaces fresher data — implementation review
An older retry performs ON CONFLICT UPDATE and overwrites a newer source version. Implementation review: choose a response and a verifiable acceptance gate.
The unique check races — implementation review
Two requests both find no matching row; both insert because the database lacks a unique constraint. Implementation review: choose a response and a verifiable acceptance gate.
The search with offset slows each page — implementation review
Pagination requests increasingly large OFFSET values; scanned and discarded rows grow. Implementation review: choose a response and a verifiable acceptance gate.
The idle transaction blocks checkout — implementation review
A session is idle in transaction while holding a row lock; many short updates queue behind it. Implementation review: choose a response and a verifiable acceptance gate.
The lock-free assumption fails at repeatable read — implementation review
Two concurrent writers see an invariant satisfied and update different rows; the combined state violates the rule. Implementation review: choose a response and a verifiable acceptance gate.
The sort spills to disk — implementation review
Query latency rises with temp-file bytes; sort input exceeds its available memory budget. Implementation review: choose a response and a verifiable acceptance gate.
The JSON predicate ignores the intended index — implementation review
A report extracts a JSON text field and casts it; the existing index targets a different JSON operator. Implementation review: choose a response and a verifiable acceptance gate.
Serverless bursts exhaust database connections — implementation review
Concurrent invocations reach 600; database connection limit is 200; each opens its own pool. Implementation review: choose a response and a verifiable acceptance gate.
The inner transaction commits alone — recovery exercise
Outer order transaction rolls back; REQUIRES_NEW audit insert remains committed; both calls crossed proxies. Recovery exercise: choose a response and a verifiable acceptance gate.
The worker thread has no transaction — recovery exercise
A transactional service submits a JDBC write to an executor; that thread reports no active transaction. Recovery exercise: choose a response and a verifiable acceptance gate.
The wrong transaction manager — recovery exercise
A reporting write commits although the annotated business transaction rolls back; two data sources use different managers. Recovery exercise: choose a response and a verifiable acceptance gate.
The retry repeats inside a doomed transaction — recovery exercise
Three retry attempts reuse one rollback-only transaction; each appears successful before commit fails. Recovery exercise: choose a response and a verifiable acceptance gate.
The lazy field fails after return — recovery exercise
Service closes persistence context; JSON serialization then accesses an uninitialized relation and fails. Recovery exercise: choose a response and a verifiable acceptance gate.
The bulk update leaves old objects — recovery exercise
Bulk SQL updates status to shipped; the same persistence context still returns loaded entities with pending status. Recovery exercise: choose a response and a verifiable acceptance gate.
The deleted child stays in the database — recovery exercise
Parent collection drops a child; no explicit delete or configured orphan removal exists. Recovery exercise: choose a response and a verifiable acceptance gate.
The detached entity overwrites a newer value — recovery exercise
An old detached object is merged without version checking after another request changed the row. Recovery exercise: choose a response and a verifiable acceptance gate.
The entity is equal until persisted — recovery exercise
An entity enters a HashSet before ID assignment; its ID-based hash changes after persistence. Recovery exercise: choose a response and a verifiable acceptance gate.
The batch insert flushes every row — recovery exercise
Loop calls saveAndFlush per item; database observes individual statement round trips despite batching configuration. Recovery exercise: choose a response and a verifiable acceptance gate.
The join multiplies the report — recovery exercise
Joining two independent one-to-many collections creates many row combinations and inflated aggregate totals. Recovery exercise: choose a response and a verifiable acceptance gate.
The missing tenant predicate — recovery exercise
A repository method filters invoice ID but omits tenant; overlapping local IDs return another customer's row. Recovery exercise: choose a response and a verifiable acceptance gate.
The giant persistence context — recovery exercise
An import retains every managed entity across a million-row transaction; heap grows although processing is sequential. Recovery exercise: choose a response and a verifiable acceptance gate.
The enum changes yesterday's records — recovery exercise
Stored ordinal 1 meant approved; a new enum constant inserted before it changes interpretation. Recovery exercise: choose a response and a verifiable acceptance gate.
The implicit flush breaks a read — recovery exercise
A SELECT triggers flush of an earlier invalid pending entity; developers blame the read query. Recovery exercise: choose a response and a verifiable acceptance gate.
The identifier generator serializes inserts — recovery exercise
All writers contend on one ID allocation row; traces wait on that row before inserting otherwise unrelated entities. Recovery exercise: choose a response and a verifiable acceptance gate.
The collection replacement deletes too much — recovery exercise
A partial request replaces the whole aggregate collection; absent members are treated as removals. Recovery exercise: choose a response and a verifiable acceptance gate.
The migration waits behind a reader — recovery exercise
ALTER TABLE waits; a long transaction holds a conflicting lock even though its last SELECT finished minutes ago. Recovery exercise: choose a response and a verifiable acceptance gate.
The index exists but the scan stays huge — recovery exercise
Query applies lower(email); available index is on raw email; plan scans most rows. Recovery exercise: choose a response and a verifiable acceptance gate.
The replica misses a fresh order — recovery exercise
Write succeeds on primary; immediate read is routed to an asynchronously lagging replica and returns not found. Recovery exercise: choose a response and a verifiable acceptance gate.
The prepared query gets slower for one tenant — recovery exercise
Small tenants are fast; a large tenant reuses a plan with poor row estimates and large nested-loop work. Recovery exercise: choose a response and a verifiable acceptance gate.
The vacuum cannot reclaim old rows — recovery exercise
Dead tuples accumulate; an hours-old snapshot remains open and cleanup cannot remove needed row versions. Recovery exercise: choose a response and a verifiable acceptance gate.
The sequence jumps after rollback — recovery exercise
Failed inserts consume generated IDs; committed rows contain gaps while uniqueness remains intact. Recovery exercise: choose a response and a verifiable acceptance gate.
The upsert replaces fresher data — recovery exercise
An older retry performs ON CONFLICT UPDATE and overwrites a newer source version. Recovery exercise: choose a response and a verifiable acceptance gate.
The unique check races — recovery exercise
Two requests both find no matching row; both insert because the database lacks a unique constraint. Recovery exercise: choose a response and a verifiable acceptance gate.
The search with offset slows each page — recovery exercise
Pagination requests increasingly large OFFSET values; scanned and discarded rows grow. Recovery exercise: choose a response and a verifiable acceptance gate.
The idle transaction blocks checkout — recovery exercise
A session is idle in transaction while holding a row lock; many short updates queue behind it. Recovery exercise: choose a response and a verifiable acceptance gate.
The lock-free assumption fails at repeatable read — recovery exercise
Two concurrent writers see an invariant satisfied and update different rows; the combined state violates the rule. Recovery exercise: choose a response and a verifiable acceptance gate.
Software design & patterns · 64 scenarios
The rollback that never happened. · Free
A transaction annotation is present, yet a failed import leaves rows behind.
The swallowed exception
Service catches a repository exception and returns success; commit later throws UnexpectedRollbackException. Incident investigation: choose a response and a verifiable acceptance gate.
The after-commit email disappears
Database order commits; process dies before an in-memory after-commit listener sends its email. Incident investigation: choose a response and a verifiable acceptance gate.
The validation annotation does nothing
Controller creates a service using new; invalid amounts reach its method despite method-validation annotations. Incident investigation: choose a response and a verifiable acceptance gate.
The async method blocks the caller
Annotated async method is called with this.send(); request latency includes the entire send operation. Incident investigation: choose a response and a verifiable acceptance gate.
The request identity leaks
A pooled thread handles tenant A then B; a custom ThreadLocal still contains A after an exception. Incident investigation: choose a response and a verifiable acceptance gate.
The scheduled job runs twice
Two application replicas both run the same local scheduled settlement task at midnight. Incident investigation: choose a response and a verifiable acceptance gate.
The read-only hint becomes a policy
A supposedly read-only service accepts writes in one deployed database configuration. Incident investigation: choose a response and a verifiable acceptance gate.
The bean uses yesterday's config
A secret refresh succeeds centrally; a singleton copied the old credential into a final field at startup. Incident investigation: choose a response and a verifiable acceptance gate.
The response ends before the job is durable
An endpoint returns accepted then queues a task in an in-memory executor; restart loses accepted work. Incident investigation: choose a response and a verifiable acceptance gate.
Strategy selection leaks between requests
A singleton pricing strategy stores the current customer's discount in a field. Incident investigation: choose a response and a verifiable acceptance gate.
An Adapter changes a domain unit silently
A provider returns cents while the domain adapter treats the value as dollars. Incident investigation: choose a response and a verifiable acceptance gate.
A Factory accepts unsupported product types
Unknown type names fall through to a default implementation that performs a side effect. Incident investigation: choose a response and a verifiable acceptance gate.
Decorator order changes retry behavior
An audit decorator records each retry as a new successful operation. Incident investigation: choose a response and a verifiable acceptance gate.
State pattern allows an invalid transition
A shipped order accepts the same cancel command as a draft and emits a refund. Incident investigation: choose a response and a verifiable acceptance gate.
Observer callbacks run before commit
A listener sends a notification while the transaction later rolls back. Incident investigation: choose a response and a verifiable acceptance gate.
Template methods let subclasses skip validation
An override replaces the entire processing method and omits the mandatory ownership check. Incident investigation: choose a response and a verifiable acceptance gate.
A Builder permits an invalid aggregate
The builder accepts both canceled=true and shipped=true and creates an order. Incident investigation: choose a response and a verifiable acceptance gate.
Dependency inversion still imports a vendor SDK
The domain interface exposes a vendor request type and vendor exception. Incident investigation: choose a response and a verifiable acceptance gate.
A generic repository hides required query semantics
A shared findAll method loads every tenant's rows before filtering in Java. Incident investigation: choose a response and a verifiable acceptance gate.
Singleton configuration exposes partial updates
A singleton changes three related fields one at a time during reload. Incident investigation: choose a response and a verifiable acceptance gate.
Chain of Responsibility skips a mandatory check
A handler returns early after formatting and the authorization handler never runs. Incident investigation: choose a response and a verifiable acceptance gate.
Composition shares a mutable collaborator
Two independent business policies reference the same mutable accumulator. Incident investigation: choose a response and a verifiable acceptance gate.
Anemic service orchestration scatters invariants
Three services update order fields directly and each enforces different transition rules. Incident investigation: choose a response and a verifiable acceptance gate.
The swallowed exception — implementation review
Service catches a repository exception and returns success; commit later throws UnexpectedRollbackException. Implementation review: choose a response and a verifiable acceptance gate.
The after-commit email disappears — implementation review
Database order commits; process dies before an in-memory after-commit listener sends its email. Implementation review: choose a response and a verifiable acceptance gate.
The validation annotation does nothing — implementation review
Controller creates a service using new; invalid amounts reach its method despite method-validation annotations. Implementation review: choose a response and a verifiable acceptance gate.
The async method blocks the caller — implementation review
Annotated async method is called with this.send(); request latency includes the entire send operation. Implementation review: choose a response and a verifiable acceptance gate.
The request identity leaks — implementation review
A pooled thread handles tenant A then B; a custom ThreadLocal still contains A after an exception. Implementation review: choose a response and a verifiable acceptance gate.
The scheduled job runs twice — implementation review
Two application replicas both run the same local scheduled settlement task at midnight. Implementation review: choose a response and a verifiable acceptance gate.
The read-only hint becomes a policy — implementation review
A supposedly read-only service accepts writes in one deployed database configuration. Implementation review: choose a response and a verifiable acceptance gate.
The bean uses yesterday's config — implementation review
A secret refresh succeeds centrally; a singleton copied the old credential into a final field at startup. Implementation review: choose a response and a verifiable acceptance gate.
The response ends before the job is durable — implementation review
An endpoint returns accepted then queues a task in an in-memory executor; restart loses accepted work. Implementation review: choose a response and a verifiable acceptance gate.
Strategy selection leaks between requests — implementation review
A singleton pricing strategy stores the current customer's discount in a field. Implementation review: choose a response and a verifiable acceptance gate.
An Adapter changes a domain unit silently — implementation review
A provider returns cents while the domain adapter treats the value as dollars. Implementation review: choose a response and a verifiable acceptance gate.
A Factory accepts unsupported product types — implementation review
Unknown type names fall through to a default implementation that performs a side effect. Implementation review: choose a response and a verifiable acceptance gate.
Decorator order changes retry behavior — implementation review
An audit decorator records each retry as a new successful operation. Implementation review: choose a response and a verifiable acceptance gate.
State pattern allows an invalid transition — implementation review
A shipped order accepts the same cancel command as a draft and emits a refund. Implementation review: choose a response and a verifiable acceptance gate.
Observer callbacks run before commit — implementation review
A listener sends a notification while the transaction later rolls back. Implementation review: choose a response and a verifiable acceptance gate.
Template methods let subclasses skip validation — implementation review
An override replaces the entire processing method and omits the mandatory ownership check. Implementation review: choose a response and a verifiable acceptance gate.
A Builder permits an invalid aggregate — implementation review
The builder accepts both canceled=true and shipped=true and creates an order. Implementation review: choose a response and a verifiable acceptance gate.
Dependency inversion still imports a vendor SDK — implementation review
The domain interface exposes a vendor request type and vendor exception. Implementation review: choose a response and a verifiable acceptance gate.
A generic repository hides required query semantics — implementation review
A shared findAll method loads every tenant's rows before filtering in Java. Implementation review: choose a response and a verifiable acceptance gate.
Singleton configuration exposes partial updates — implementation review
A singleton changes three related fields one at a time during reload. Implementation review: choose a response and a verifiable acceptance gate.
Chain of Responsibility skips a mandatory check — implementation review
A handler returns early after formatting and the authorization handler never runs. Implementation review: choose a response and a verifiable acceptance gate.
Composition shares a mutable collaborator — implementation review
Two independent business policies reference the same mutable accumulator. Implementation review: choose a response and a verifiable acceptance gate.
Anemic service orchestration scatters invariants — implementation review
Three services update order fields directly and each enforces different transition rules. Implementation review: choose a response and a verifiable acceptance gate.
The swallowed exception — recovery exercise
Service catches a repository exception and returns success; commit later throws UnexpectedRollbackException. Recovery exercise: choose a response and a verifiable acceptance gate.
The after-commit email disappears — recovery exercise
Database order commits; process dies before an in-memory after-commit listener sends its email. Recovery exercise: choose a response and a verifiable acceptance gate.
The validation annotation does nothing — recovery exercise
Controller creates a service using new; invalid amounts reach its method despite method-validation annotations. Recovery exercise: choose a response and a verifiable acceptance gate.
The async method blocks the caller — recovery exercise
Annotated async method is called with this.send(); request latency includes the entire send operation. Recovery exercise: choose a response and a verifiable acceptance gate.
The request identity leaks — recovery exercise
A pooled thread handles tenant A then B; a custom ThreadLocal still contains A after an exception. Recovery exercise: choose a response and a verifiable acceptance gate.
The scheduled job runs twice — recovery exercise
Two application replicas both run the same local scheduled settlement task at midnight. Recovery exercise: choose a response and a verifiable acceptance gate.
The read-only hint becomes a policy — recovery exercise
A supposedly read-only service accepts writes in one deployed database configuration. Recovery exercise: choose a response and a verifiable acceptance gate.
The bean uses yesterday's config — recovery exercise
A secret refresh succeeds centrally; a singleton copied the old credential into a final field at startup. Recovery exercise: choose a response and a verifiable acceptance gate.
The response ends before the job is durable — recovery exercise
An endpoint returns accepted then queues a task in an in-memory executor; restart loses accepted work. Recovery exercise: choose a response and a verifiable acceptance gate.
Strategy selection leaks between requests — recovery exercise
A singleton pricing strategy stores the current customer's discount in a field. Recovery exercise: choose a response and a verifiable acceptance gate.
An Adapter changes a domain unit silently — recovery exercise
A provider returns cents while the domain adapter treats the value as dollars. Recovery exercise: choose a response and a verifiable acceptance gate.
A Factory accepts unsupported product types — recovery exercise
Unknown type names fall through to a default implementation that performs a side effect. Recovery exercise: choose a response and a verifiable acceptance gate.
Decorator order changes retry behavior — recovery exercise
An audit decorator records each retry as a new successful operation. Recovery exercise: choose a response and a verifiable acceptance gate.
State pattern allows an invalid transition — recovery exercise
A shipped order accepts the same cancel command as a draft and emits a refund. Recovery exercise: choose a response and a verifiable acceptance gate.
Observer callbacks run before commit — recovery exercise
A listener sends a notification while the transaction later rolls back. Recovery exercise: choose a response and a verifiable acceptance gate.
Template methods let subclasses skip validation — recovery exercise
An override replaces the entire processing method and omits the mandatory ownership check. Recovery exercise: choose a response and a verifiable acceptance gate.
A Builder permits an invalid aggregate — recovery exercise
The builder accepts both canceled=true and shipped=true and creates an order. Recovery exercise: choose a response and a verifiable acceptance gate.
Messaging & events · 64 scenarios
One event. Two shipments. · Free
A consumer restart repeats a side effect even though the producer is idempotent.
The order exists. The event does not.
A crash lands between a database commit and a broker publish.
The poison event blocks the partition
Every restart retries the same invalid event; later offsets never progress. Incident investigation: choose a response and a verifiable acceptance gate.
The slow consumer keeps rebalancing
Processing takes longer than the configured poll interval; partition ownership repeatedly moves. Incident investigation: choose a response and a verifiable acceptance gate.
The new partition count reorders one customer
Events for one key move under a changed partition mapping while old events remain in previous partitions. Incident investigation: choose a response and a verifiable acceptance gate.
The tombstone becomes a crash
A compacted topic delivers a null value; the deserializer assumes every event contains JSON. Incident investigation: choose a response and a verifiable acceptance gate.
The schema rename breaks old consumers
Producer renames a required field; a still-deployed consumer rejects the new payload. Incident investigation: choose a response and a verifiable acceptance gate.
The retry topic changes business order
A failed update is delayed in a retry topic; a later update succeeds first on the main topic. Incident investigation: choose a response and a verifiable acceptance gate.
The acknowledgment precedes durability
Handler acknowledges delivery then crashes before committing its database mutation. Incident investigation: choose a response and a verifiable acceptance gate.
The replay sends old emails again
Historical events are replayed for a projection rebuild; the same handler also sends customer notifications. Incident investigation: choose a response and a verifiable acceptance gate.
The batch commits past a failed item
One event fails; code commits the batch's highest offset after later items succeed. Incident investigation: choose a response and a verifiable acceptance gate.
The message exceeds the receiver limit
Producer accepts a payload under its configured limit; broker or consumer rejects it at a smaller limit. Incident investigation: choose a response and a verifiable acceptance gate.
The outbox cleaner runs too soon
A cleanup job deletes unsent outbox rows by creation time; delayed publisher loses those events. Incident investigation: choose a response and a verifiable acceptance gate.
The consumer trusts producer order as time
An event with an older business version arrives later and replaces a newer projection. Incident investigation: choose a response and a verifiable acceptance gate.
The retry has no expiration
A deleted customer event is retried forever because every not-found response is considered temporary. Incident investigation: choose a response and a verifiable acceptance gate.
Queue visibility expires while processing continues
Handler runs 95 seconds; visibility timeout is 30; the same message is received by another worker. Incident investigation: choose a response and a verifiable acceptance gate.
A poison message loops forever
One payload fails parsing on every receive; receive count is 180 and no DLQ policy exists. Incident investigation: choose a response and a verifiable acceptance gate.
Duplicate cloud events create duplicate records
Two deliveries share the same provider event ID; both insert separate business rows. Incident investigation: choose a response and a verifiable acceptance gate.
CPU-based scaling ignores a growing queue
CPU is 18%; oldest message age is 24 minutes; worker count stays flat. Incident investigation: choose a response and a verifiable acceptance gate.
The poison event blocks the partition — implementation review
Every restart retries the same invalid event; later offsets never progress. Implementation review: choose a response and a verifiable acceptance gate.
The slow consumer keeps rebalancing — implementation review
Processing takes longer than the configured poll interval; partition ownership repeatedly moves. Implementation review: choose a response and a verifiable acceptance gate.
The new partition count reorders one customer — implementation review
Events for one key move under a changed partition mapping while old events remain in previous partitions. Implementation review: choose a response and a verifiable acceptance gate.
The tombstone becomes a crash — implementation review
A compacted topic delivers a null value; the deserializer assumes every event contains JSON. Implementation review: choose a response and a verifiable acceptance gate.
The schema rename breaks old consumers — implementation review
Producer renames a required field; a still-deployed consumer rejects the new payload. Implementation review: choose a response and a verifiable acceptance gate.
The retry topic changes business order — implementation review
A failed update is delayed in a retry topic; a later update succeeds first on the main topic. Implementation review: choose a response and a verifiable acceptance gate.
The acknowledgment precedes durability — implementation review
Handler acknowledges delivery then crashes before committing its database mutation. Implementation review: choose a response and a verifiable acceptance gate.
The replay sends old emails again — implementation review
Historical events are replayed for a projection rebuild; the same handler also sends customer notifications. Implementation review: choose a response and a verifiable acceptance gate.
The batch commits past a failed item — implementation review
One event fails; code commits the batch's highest offset after later items succeed. Implementation review: choose a response and a verifiable acceptance gate.
The message exceeds the receiver limit — implementation review
Producer accepts a payload under its configured limit; broker or consumer rejects it at a smaller limit. Implementation review: choose a response and a verifiable acceptance gate.
The outbox cleaner runs too soon — implementation review
A cleanup job deletes unsent outbox rows by creation time; delayed publisher loses those events. Implementation review: choose a response and a verifiable acceptance gate.
The consumer trusts producer order as time — implementation review
An event with an older business version arrives later and replaces a newer projection. Implementation review: choose a response and a verifiable acceptance gate.
The retry has no expiration — implementation review
A deleted customer event is retried forever because every not-found response is considered temporary. Implementation review: choose a response and a verifiable acceptance gate.
Queue visibility expires while processing continues — implementation review
Handler runs 95 seconds; visibility timeout is 30; the same message is received by another worker. Implementation review: choose a response and a verifiable acceptance gate.
A poison message loops forever — implementation review
One payload fails parsing on every receive; receive count is 180 and no DLQ policy exists. Implementation review: choose a response and a verifiable acceptance gate.
Duplicate cloud events create duplicate records — implementation review
Two deliveries share the same provider event ID; both insert separate business rows. Implementation review: choose a response and a verifiable acceptance gate.
CPU-based scaling ignores a growing queue — implementation review
CPU is 18%; oldest message age is 24 minutes; worker count stays flat. Implementation review: choose a response and a verifiable acceptance gate.
The poison event blocks the partition — recovery exercise
Every restart retries the same invalid event; later offsets never progress. Recovery exercise: choose a response and a verifiable acceptance gate.
The slow consumer keeps rebalancing — recovery exercise
Processing takes longer than the configured poll interval; partition ownership repeatedly moves. Recovery exercise: choose a response and a verifiable acceptance gate.
The new partition count reorders one customer — recovery exercise
Events for one key move under a changed partition mapping while old events remain in previous partitions. Recovery exercise: choose a response and a verifiable acceptance gate.
The tombstone becomes a crash — recovery exercise
A compacted topic delivers a null value; the deserializer assumes every event contains JSON. Recovery exercise: choose a response and a verifiable acceptance gate.
The schema rename breaks old consumers — recovery exercise
Producer renames a required field; a still-deployed consumer rejects the new payload. Recovery exercise: choose a response and a verifiable acceptance gate.
The retry topic changes business order — recovery exercise
A failed update is delayed in a retry topic; a later update succeeds first on the main topic. Recovery exercise: choose a response and a verifiable acceptance gate.
The acknowledgment precedes durability — recovery exercise
Handler acknowledges delivery then crashes before committing its database mutation. Recovery exercise: choose a response and a verifiable acceptance gate.
The replay sends old emails again — recovery exercise
Historical events are replayed for a projection rebuild; the same handler also sends customer notifications. Recovery exercise: choose a response and a verifiable acceptance gate.
The batch commits past a failed item — recovery exercise
One event fails; code commits the batch's highest offset after later items succeed. Recovery exercise: choose a response and a verifiable acceptance gate.
The message exceeds the receiver limit — recovery exercise
Producer accepts a payload under its configured limit; broker or consumer rejects it at a smaller limit. Recovery exercise: choose a response and a verifiable acceptance gate.
The outbox cleaner runs too soon — recovery exercise
A cleanup job deletes unsent outbox rows by creation time; delayed publisher loses those events. Recovery exercise: choose a response and a verifiable acceptance gate.
The consumer trusts producer order as time — recovery exercise
An event with an older business version arrives later and replaces a newer projection. Recovery exercise: choose a response and a verifiable acceptance gate.
The retry has no expiration — recovery exercise
A deleted customer event is retried forever because every not-found response is considered temporary. Recovery exercise: choose a response and a verifiable acceptance gate.
Queue visibility expires while processing continues — recovery exercise
Handler runs 95 seconds; visibility timeout is 30; the same message is received by another worker. Recovery exercise: choose a response and a verifiable acceptance gate.
A poison message loops forever — recovery exercise
One payload fails parsing on every receive; receive count is 180 and no DLQ policy exists. Recovery exercise: choose a response and a verifiable acceptance gate.
Duplicate cloud events create duplicate records — recovery exercise
Two deliveries share the same provider event ID; both insert separate business rows. Recovery exercise: choose a response and a verifiable acceptance gate.
CPU-based scaling ignores a growing queue — recovery exercise
CPU is 18%; oldest message age is 24 minutes; worker count stays flat. Recovery exercise: choose a response and a verifiable acceptance gate.
The poison event blocks the partition — architecture trade-off
Every restart retries the same invalid event; later offsets never progress. Architecture trade-off: choose a response and a verifiable acceptance gate.
The slow consumer keeps rebalancing — architecture trade-off
Processing takes longer than the configured poll interval; partition ownership repeatedly moves. Architecture trade-off: choose a response and a verifiable acceptance gate.
The new partition count reorders one customer — architecture trade-off
Events for one key move under a changed partition mapping while old events remain in previous partitions. Architecture trade-off: choose a response and a verifiable acceptance gate.
The tombstone becomes a crash — architecture trade-off
A compacted topic delivers a null value; the deserializer assumes every event contains JSON. Architecture trade-off: choose a response and a verifiable acceptance gate.
The schema rename breaks old consumers — architecture trade-off
Producer renames a required field; a still-deployed consumer rejects the new payload. Architecture trade-off: choose a response and a verifiable acceptance gate.
The retry topic changes business order — architecture trade-off
A failed update is delayed in a retry topic; a later update succeeds first on the main topic. Architecture trade-off: choose a response and a verifiable acceptance gate.
The acknowledgment precedes durability — architecture trade-off
Handler acknowledges delivery then crashes before committing its database mutation. Architecture trade-off: choose a response and a verifiable acceptance gate.
The replay sends old emails again — architecture trade-off
Historical events are replayed for a projection rebuild; the same handler also sends customer notifications. Architecture trade-off: choose a response and a verifiable acceptance gate.
The batch commits past a failed item — architecture trade-off
One event fails; code commits the batch's highest offset after later items succeed. Architecture trade-off: choose a response and a verifiable acceptance gate.
The message exceeds the receiver limit — architecture trade-off
Producer accepts a payload under its configured limit; broker or consumer rejects it at a smaller limit. Architecture trade-off: choose a response and a verifiable acceptance gate.
The outbox cleaner runs too soon — architecture trade-off
A cleanup job deletes unsent outbox rows by creation time; delayed publisher loses those events. Architecture trade-off: choose a response and a verifiable acceptance gate.
Distributed systems · 80 scenarios
A small outage becomes a traffic storm.
Retries at three layers multiply load on a struggling dependency.
The double-click becomes a double charge.
Two identical requests pass a non-atomic idempotency check.
The leader writes after losing its lease
Old leader pauses, loses its lease, then resumes and writes over the new leader's result. Incident investigation: choose a response and a verifiable acceptance gate.
The retry multiplies across services
Three service layers each retry three times; one user request creates a burst of downstream attempts. Incident investigation: choose a response and a verifiable acceptance gate.
The breaker retries all probes at once
An open circuit resets and every waiting request probes the failing dependency simultaneously. Incident investigation: choose a response and a verifiable acceptance gate.
The saga compensation runs twice
Timeout recovery repeats an inventory release; stock becomes larger than before the order. Incident investigation: choose a response and a verifiable acceptance gate.
The clocks reverse event history
Two hosts disagree by seconds; timestamp comparison rejects a causally newer update. Incident investigation: choose a response and a verifiable acceptance gate.
The quorum math assumes independent failures
Replicas counted toward quorum share one physical failure domain; one outage removes the majority. Incident investigation: choose a response and a verifiable acceptance gate.
The fallback invents a successful payment
Payment provider times out; fallback returns success to keep the UI green. Incident investigation: choose a response and a verifiable acceptance gate.
The fan-out has one slow tail
A page waits for twenty optional services; one hangs and blocks the entire response. Incident investigation: choose a response and a verifiable acceptance gate.
The distributed lock guards only the request
A request releases its lock before its asynchronous write completes; a second request starts competing work. Incident investigation: choose a response and a verifiable acceptance gate.
The reconciliation job cannot resume
A repair scans millions of records; crash loses its position and repeated runs redo external effects. Incident investigation: choose a response and a verifiable acceptance gate.
The inventory reserve never expires
Checkout abandons a reservation; no expiry or recovery transition releases the held stock. Incident investigation: choose a response and a verifiable acceptance gate.
The regional failover loses acknowledged work
Application acknowledges a write before asynchronous cross-region replication; failover lacks that record. Incident investigation: choose a response and a verifiable acceptance gate.
The dependency cache hides a revoked endpoint
Service discovery refresh fails; clients keep a removed backend forever and ignore bounded staleness. Incident investigation: choose a response and a verifiable acceptance gate.
A lease expires while the old owner still writes
Worker A pauses, its lease expires, worker B takes over, then A resumes a write. Incident investigation: choose a response and a verifiable acceptance gate.
A retry budget multiplies across layers
The gateway, service and SDK each retry three times for one operation. Incident investigation: choose a response and a verifiable acceptance gate.
Clock skew invalidates distributed ordering
Two nodes assign timestamps with a 90-second skew and last-write-wins loses the newer domain change. Incident investigation: choose a response and a verifiable acceptance gate.
An in-memory dedupe disappears on failover
A new replica has an empty seen-ID set and repeats a committed external effect. Incident investigation: choose a response and a verifiable acceptance gate.
An idempotency key expires before retry is possible
Stored keys expire after one hour while mobile clients can retry the next day. Incident investigation: choose a response and a verifiable acceptance gate.
A dedupe key crosses business scope
Two tenants use the same request ID and the second receives the first tenant's cached result. Incident investigation: choose a response and a verifiable acceptance gate.
Bulkhead queues are still shared
A dependency has its own thread pool but rejection blocks the same shared request queue. Incident investigation: choose a response and a verifiable acceptance gate.
Circuit breaker errors erase an uncertain result
A breaker opens after a timeout even though the provider may have committed. Incident investigation: choose a response and a verifiable acceptance gate.
The leader writes after losing its lease — implementation review
Old leader pauses, loses its lease, then resumes and writes over the new leader's result. Implementation review: choose a response and a verifiable acceptance gate.
The retry multiplies across services — implementation review
Three service layers each retry three times; one user request creates a burst of downstream attempts. Implementation review: choose a response and a verifiable acceptance gate.
The breaker retries all probes at once — implementation review
An open circuit resets and every waiting request probes the failing dependency simultaneously. Implementation review: choose a response and a verifiable acceptance gate.
The saga compensation runs twice — implementation review
Timeout recovery repeats an inventory release; stock becomes larger than before the order. Implementation review: choose a response and a verifiable acceptance gate.
The clocks reverse event history — implementation review
Two hosts disagree by seconds; timestamp comparison rejects a causally newer update. Implementation review: choose a response and a verifiable acceptance gate.
The quorum math assumes independent failures — implementation review
Replicas counted toward quorum share one physical failure domain; one outage removes the majority. Implementation review: choose a response and a verifiable acceptance gate.
The fallback invents a successful payment — implementation review
Payment provider times out; fallback returns success to keep the UI green. Implementation review: choose a response and a verifiable acceptance gate.
The fan-out has one slow tail — implementation review
A page waits for twenty optional services; one hangs and blocks the entire response. Implementation review: choose a response and a verifiable acceptance gate.
The distributed lock guards only the request — implementation review
A request releases its lock before its asynchronous write completes; a second request starts competing work. Implementation review: choose a response and a verifiable acceptance gate.
The reconciliation job cannot resume — implementation review
A repair scans millions of records; crash loses its position and repeated runs redo external effects. Implementation review: choose a response and a verifiable acceptance gate.
The inventory reserve never expires — implementation review
Checkout abandons a reservation; no expiry or recovery transition releases the held stock. Implementation review: choose a response and a verifiable acceptance gate.
The regional failover loses acknowledged work — implementation review
Application acknowledges a write before asynchronous cross-region replication; failover lacks that record. Implementation review: choose a response and a verifiable acceptance gate.
The dependency cache hides a revoked endpoint — implementation review
Service discovery refresh fails; clients keep a removed backend forever and ignore bounded staleness. Implementation review: choose a response and a verifiable acceptance gate.
A lease expires while the old owner still writes — implementation review
Worker A pauses, its lease expires, worker B takes over, then A resumes a write. Implementation review: choose a response and a verifiable acceptance gate.
A retry budget multiplies across layers — implementation review
The gateway, service and SDK each retry three times for one operation. Implementation review: choose a response and a verifiable acceptance gate.
Clock skew invalidates distributed ordering — implementation review
Two nodes assign timestamps with a 90-second skew and last-write-wins loses the newer domain change. Implementation review: choose a response and a verifiable acceptance gate.
An in-memory dedupe disappears on failover — implementation review
A new replica has an empty seen-ID set and repeats a committed external effect. Implementation review: choose a response and a verifiable acceptance gate.
An idempotency key expires before retry is possible — implementation review
Stored keys expire after one hour while mobile clients can retry the next day. Implementation review: choose a response and a verifiable acceptance gate.
A dedupe key crosses business scope — implementation review
Two tenants use the same request ID and the second receives the first tenant's cached result. Implementation review: choose a response and a verifiable acceptance gate.
Bulkhead queues are still shared — implementation review
A dependency has its own thread pool but rejection blocks the same shared request queue. Implementation review: choose a response and a verifiable acceptance gate.
Circuit breaker errors erase an uncertain result — implementation review
A breaker opens after a timeout even though the provider may have committed. Implementation review: choose a response and a verifiable acceptance gate.
The leader writes after losing its lease — recovery exercise
Old leader pauses, loses its lease, then resumes and writes over the new leader's result. Recovery exercise: choose a response and a verifiable acceptance gate.
The retry multiplies across services — recovery exercise
Three service layers each retry three times; one user request creates a burst of downstream attempts. Recovery exercise: choose a response and a verifiable acceptance gate.
The breaker retries all probes at once — recovery exercise
An open circuit resets and every waiting request probes the failing dependency simultaneously. Recovery exercise: choose a response and a verifiable acceptance gate.
The saga compensation runs twice — recovery exercise
Timeout recovery repeats an inventory release; stock becomes larger than before the order. Recovery exercise: choose a response and a verifiable acceptance gate.
The clocks reverse event history — recovery exercise
Two hosts disagree by seconds; timestamp comparison rejects a causally newer update. Recovery exercise: choose a response and a verifiable acceptance gate.
The quorum math assumes independent failures — recovery exercise
Replicas counted toward quorum share one physical failure domain; one outage removes the majority. Recovery exercise: choose a response and a verifiable acceptance gate.
The fallback invents a successful payment — recovery exercise
Payment provider times out; fallback returns success to keep the UI green. Recovery exercise: choose a response and a verifiable acceptance gate.
The fan-out has one slow tail — recovery exercise
A page waits for twenty optional services; one hangs and blocks the entire response. Recovery exercise: choose a response and a verifiable acceptance gate.
The distributed lock guards only the request — recovery exercise
A request releases its lock before its asynchronous write completes; a second request starts competing work. Recovery exercise: choose a response and a verifiable acceptance gate.
The reconciliation job cannot resume — recovery exercise
A repair scans millions of records; crash loses its position and repeated runs redo external effects. Recovery exercise: choose a response and a verifiable acceptance gate.
The inventory reserve never expires — recovery exercise
Checkout abandons a reservation; no expiry or recovery transition releases the held stock. Recovery exercise: choose a response and a verifiable acceptance gate.
The regional failover loses acknowledged work — recovery exercise
Application acknowledges a write before asynchronous cross-region replication; failover lacks that record. Recovery exercise: choose a response and a verifiable acceptance gate.
The dependency cache hides a revoked endpoint — recovery exercise
Service discovery refresh fails; clients keep a removed backend forever and ignore bounded staleness. Recovery exercise: choose a response and a verifiable acceptance gate.
A lease expires while the old owner still writes — recovery exercise
Worker A pauses, its lease expires, worker B takes over, then A resumes a write. Recovery exercise: choose a response and a verifiable acceptance gate.
A retry budget multiplies across layers — recovery exercise
The gateway, service and SDK each retry three times for one operation. Recovery exercise: choose a response and a verifiable acceptance gate.
Clock skew invalidates distributed ordering — recovery exercise
Two nodes assign timestamps with a 90-second skew and last-write-wins loses the newer domain change. Recovery exercise: choose a response and a verifiable acceptance gate.
An in-memory dedupe disappears on failover — recovery exercise
A new replica has an empty seen-ID set and repeats a committed external effect. Recovery exercise: choose a response and a verifiable acceptance gate.
An idempotency key expires before retry is possible — recovery exercise
Stored keys expire after one hour while mobile clients can retry the next day. Recovery exercise: choose a response and a verifiable acceptance gate.
A dedupe key crosses business scope — recovery exercise
Two tenants use the same request ID and the second receives the first tenant's cached result. Recovery exercise: choose a response and a verifiable acceptance gate.
Bulkhead queues are still shared — recovery exercise
A dependency has its own thread pool but rejection blocks the same shared request queue. Recovery exercise: choose a response and a verifiable acceptance gate.
Circuit breaker errors erase an uncertain result — recovery exercise
A breaker opens after a timeout even though the provider may have committed. Recovery exercise: choose a response and a verifiable acceptance gate.
The leader writes after losing its lease — architecture trade-off
Old leader pauses, loses its lease, then resumes and writes over the new leader's result. Architecture trade-off: choose a response and a verifiable acceptance gate.
The retry multiplies across services — architecture trade-off
Three service layers each retry three times; one user request creates a burst of downstream attempts. Architecture trade-off: choose a response and a verifiable acceptance gate.
The breaker retries all probes at once — architecture trade-off
An open circuit resets and every waiting request probes the failing dependency simultaneously. Architecture trade-off: choose a response and a verifiable acceptance gate.
The saga compensation runs twice — architecture trade-off
Timeout recovery repeats an inventory release; stock becomes larger than before the order. Architecture trade-off: choose a response and a verifiable acceptance gate.
The clocks reverse event history — architecture trade-off
Two hosts disagree by seconds; timestamp comparison rejects a causally newer update. Architecture trade-off: choose a response and a verifiable acceptance gate.
The quorum math assumes independent failures — architecture trade-off
Replicas counted toward quorum share one physical failure domain; one outage removes the majority. Architecture trade-off: choose a response and a verifiable acceptance gate.
The fallback invents a successful payment — architecture trade-off
Payment provider times out; fallback returns success to keep the UI green. Architecture trade-off: choose a response and a verifiable acceptance gate.
The fan-out has one slow tail — architecture trade-off
A page waits for twenty optional services; one hangs and blocks the entire response. Architecture trade-off: choose a response and a verifiable acceptance gate.
The distributed lock guards only the request — architecture trade-off
A request releases its lock before its asynchronous write completes; a second request starts competing work. Architecture trade-off: choose a response and a verifiable acceptance gate.
The reconciliation job cannot resume — architecture trade-off
A repair scans millions of records; crash loses its position and repeated runs redo external effects. Architecture trade-off: choose a response and a verifiable acceptance gate.
The inventory reserve never expires — architecture trade-off
Checkout abandons a reservation; no expiry or recovery transition releases the held stock. Architecture trade-off: choose a response and a verifiable acceptance gate.
The regional failover loses acknowledged work — architecture trade-off
Application acknowledges a write before asynchronous cross-region replication; failover lacks that record. Architecture trade-off: choose a response and a verifiable acceptance gate.
The dependency cache hides a revoked endpoint — architecture trade-off
Service discovery refresh fails; clients keep a removed backend forever and ignore bounded staleness. Architecture trade-off: choose a response and a verifiable acceptance gate.
A lease expires while the old owner still writes — architecture trade-off
Worker A pauses, its lease expires, worker B takes over, then A resumes a write. Architecture trade-off: choose a response and a verifiable acceptance gate.
A retry budget multiplies across layers — architecture trade-off
The gateway, service and SDK each retry three times for one operation. Architecture trade-off: choose a response and a verifiable acceptance gate.
Caching & performance · 64 scenarios
The cache expires. The database melts.
Hundreds of requests try to rebuild the same popular cache entry.
The heap never comes back down.
A customer lookup cache grows with every unique key and never evicts.
The stale writer wins the cache
Request A reads version 4 slowly; B updates and caches version 5; A finally overwrites the cache with 4. Incident investigation: choose a response and a verifiable acceptance gate.
The missing key becomes permanent
A not-found result is cached indefinitely; later creation remains invisible. Incident investigation: choose a response and a verifiable acceptance gate.
The refresh owner dies
A distributed refresh lock has no expiry; its owner crashes and no worker refreshes the key. Incident investigation: choose a response and a verifiable acceptance gate.
The cache deletes someone else's lock
Owner A's lease expires; B obtains a new lease; A finishes and deletes the lock unconditionally. Incident investigation: choose a response and a verifiable acceptance gate.
The serializer upgrade breaks cache hits
New code expects one cached object shape; shared entries still contain the older incompatible encoding. Incident investigation: choose a response and a verifiable acceptance gate.
The default TTL never gets set
Writer sets a key successfully, then crashes before a separate expiration command. Incident investigation: choose a response and a verifiable acceptance gate.
The cache outage floods the database
Cache connections fail; every request immediately falls through to an already constrained database. Incident investigation: choose a response and a verifiable acceptance gate.
The cache hit changes the language
First English request fills a cache keyed only by article ID; French requests receive English text. Incident investigation: choose a response and a verifiable acceptance gate.
The eviction removes security state
Session revocation markers share an evicting cache with disposable page fragments; markers disappear under pressure. Incident investigation: choose a response and a verifiable acceptance gate.
The hot key overloads one shard
Most requests target one celebrity profile; adding shards barely changes that shard's load. Incident investigation: choose a response and a verifiable acceptance gate.
The increment loses its expiry
A rate-limit key is replaced by a generic SET; its remaining expiration disappears. Incident investigation: choose a response and a verifiable acceptance gate.
The compressed object is larger than the limit
Cache accepts small objects; one report exceeds the configured value budget after encoding. Incident investigation: choose a response and a verifiable acceptance gate.
The invalidation reaches only one process
Node A removes its local entry after a write; node B keeps serving the old value indefinitely. Incident investigation: choose a response and a verifiable acceptance gate.
The allocation rate outruns collection
Live heap after GC stays steady; temporary allocation rate and GC CPU rise with each request. Incident investigation: choose a response and a verifiable acceptance gate.
The retained heap grows after every tenant
Completed tenant sessions remain referenced by a static registry with no removal. Incident investigation: choose a response and a verifiable acceptance gate.
The tiny payload has expensive regex
A crafted input makes regex evaluation consume seconds while input length stays modest. Incident investigation: choose a response and a verifiable acceptance gate.
The logging path becomes synchronous
Verbose logging sends every request detail to a slow remote sink on request threads. Incident investigation: choose a response and a verifiable acceptance gate.
The cache improves averages and hurts p99
Cache miss loads huge objects under a global lock; unrelated hits queue behind it. Incident investigation: choose a response and a verifiable acceptance gate.
The compressed response burns all CPU
Large responses are compressed at the highest level; CPU saturates before network bandwidth. Incident investigation: choose a response and a verifiable acceptance gate.
The benchmark excludes initialization
Microbenchmark reports a fast call but production repeatedly rebuilds the expensive client before each use. Incident investigation: choose a response and a verifiable acceptance gate.
The warmup test predicts the wrong latency
Performance test stops during JIT warmup; results vary sharply across short runs. Incident investigation: choose a response and a verifiable acceptance gate.
The direct buffers exhaust native memory
Heap appears healthy; native direct-buffer allocation fails during concurrent downloads. Incident investigation: choose a response and a verifiable acceptance gate.
The synchronized formatter dominates CPU
Thread samples show contention around a shared formatter; actual formatting work is short. Incident investigation: choose a response and a verifiable acceptance gate.
The list lookup becomes quadratic
For every item, code scans the entire existing list; import time quadruples when size doubles. Incident investigation: choose a response and a verifiable acceptance gate.
The memory optimization increases copying
Small buffer size reduces allocation per buffer but multiplies copies and system calls. Incident investigation: choose a response and a verifiable acceptance gate.
The benchmark serves cached data only
Load generator repeats one key; production has a large cold-key distribution and much higher database demand. Incident investigation: choose a response and a verifiable acceptance gate.
The stale writer wins the cache — implementation review
Request A reads version 4 slowly; B updates and caches version 5; A finally overwrites the cache with 4. Implementation review: choose a response and a verifiable acceptance gate.
The missing key becomes permanent — implementation review
A not-found result is cached indefinitely; later creation remains invisible. Implementation review: choose a response and a verifiable acceptance gate.
The refresh owner dies — implementation review
A distributed refresh lock has no expiry; its owner crashes and no worker refreshes the key. Implementation review: choose a response and a verifiable acceptance gate.
The cache deletes someone else's lock — implementation review
Owner A's lease expires; B obtains a new lease; A finishes and deletes the lock unconditionally. Implementation review: choose a response and a verifiable acceptance gate.
The serializer upgrade breaks cache hits — implementation review
New code expects one cached object shape; shared entries still contain the older incompatible encoding. Implementation review: choose a response and a verifiable acceptance gate.
The default TTL never gets set — implementation review
Writer sets a key successfully, then crashes before a separate expiration command. Implementation review: choose a response and a verifiable acceptance gate.
The cache outage floods the database — implementation review
Cache connections fail; every request immediately falls through to an already constrained database. Implementation review: choose a response and a verifiable acceptance gate.
The cache hit changes the language — implementation review
First English request fills a cache keyed only by article ID; French requests receive English text. Implementation review: choose a response and a verifiable acceptance gate.
The eviction removes security state — implementation review
Session revocation markers share an evicting cache with disposable page fragments; markers disappear under pressure. Implementation review: choose a response and a verifiable acceptance gate.
The hot key overloads one shard — implementation review
Most requests target one celebrity profile; adding shards barely changes that shard's load. Implementation review: choose a response and a verifiable acceptance gate.
The increment loses its expiry — implementation review
A rate-limit key is replaced by a generic SET; its remaining expiration disappears. Implementation review: choose a response and a verifiable acceptance gate.
The compressed object is larger than the limit — implementation review
Cache accepts small objects; one report exceeds the configured value budget after encoding. Implementation review: choose a response and a verifiable acceptance gate.
The invalidation reaches only one process — implementation review
Node A removes its local entry after a write; node B keeps serving the old value indefinitely. Implementation review: choose a response and a verifiable acceptance gate.
The allocation rate outruns collection — implementation review
Live heap after GC stays steady; temporary allocation rate and GC CPU rise with each request. Implementation review: choose a response and a verifiable acceptance gate.
The retained heap grows after every tenant — implementation review
Completed tenant sessions remain referenced by a static registry with no removal. Implementation review: choose a response and a verifiable acceptance gate.
The tiny payload has expensive regex — implementation review
A crafted input makes regex evaluation consume seconds while input length stays modest. Implementation review: choose a response and a verifiable acceptance gate.
The logging path becomes synchronous — implementation review
Verbose logging sends every request detail to a slow remote sink on request threads. Implementation review: choose a response and a verifiable acceptance gate.
The cache improves averages and hurts p99 — implementation review
Cache miss loads huge objects under a global lock; unrelated hits queue behind it. Implementation review: choose a response and a verifiable acceptance gate.
The compressed response burns all CPU — implementation review
Large responses are compressed at the highest level; CPU saturates before network bandwidth. Implementation review: choose a response and a verifiable acceptance gate.
The benchmark excludes initialization — implementation review
Microbenchmark reports a fast call but production repeatedly rebuilds the expensive client before each use. Implementation review: choose a response and a verifiable acceptance gate.
The warmup test predicts the wrong latency — implementation review
Performance test stops during JIT warmup; results vary sharply across short runs. Implementation review: choose a response and a verifiable acceptance gate.
The direct buffers exhaust native memory — implementation review
Heap appears healthy; native direct-buffer allocation fails during concurrent downloads. Implementation review: choose a response and a verifiable acceptance gate.
The synchronized formatter dominates CPU — implementation review
Thread samples show contention around a shared formatter; actual formatting work is short. Implementation review: choose a response and a verifiable acceptance gate.
The list lookup becomes quadratic — implementation review
For every item, code scans the entire existing list; import time quadruples when size doubles. Implementation review: choose a response and a verifiable acceptance gate.
The memory optimization increases copying — implementation review
Small buffer size reduces allocation per buffer but multiplies copies and system calls. Implementation review: choose a response and a verifiable acceptance gate.
The benchmark serves cached data only — implementation review
Load generator repeats one key; production has a large cold-key distribution and much higher database demand. Implementation review: choose a response and a verifiable acceptance gate.
The stale writer wins the cache — recovery exercise
Request A reads version 4 slowly; B updates and caches version 5; A finally overwrites the cache with 4. Recovery exercise: choose a response and a verifiable acceptance gate.
The missing key becomes permanent — recovery exercise
A not-found result is cached indefinitely; later creation remains invisible. Recovery exercise: choose a response and a verifiable acceptance gate.
The refresh owner dies — recovery exercise
A distributed refresh lock has no expiry; its owner crashes and no worker refreshes the key. Recovery exercise: choose a response and a verifiable acceptance gate.
The cache deletes someone else's lock — recovery exercise
Owner A's lease expires; B obtains a new lease; A finishes and deletes the lock unconditionally. Recovery exercise: choose a response and a verifiable acceptance gate.
The serializer upgrade breaks cache hits — recovery exercise
New code expects one cached object shape; shared entries still contain the older incompatible encoding. Recovery exercise: choose a response and a verifiable acceptance gate.
The default TTL never gets set — recovery exercise
Writer sets a key successfully, then crashes before a separate expiration command. Recovery exercise: choose a response and a verifiable acceptance gate.
The cache outage floods the database — recovery exercise
Cache connections fail; every request immediately falls through to an already constrained database. Recovery exercise: choose a response and a verifiable acceptance gate.
The cache hit changes the language — recovery exercise
First English request fills a cache keyed only by article ID; French requests receive English text. Recovery exercise: choose a response and a verifiable acceptance gate.
The eviction removes security state — recovery exercise
Session revocation markers share an evicting cache with disposable page fragments; markers disappear under pressure. Recovery exercise: choose a response and a verifiable acceptance gate.
The hot key overloads one shard — recovery exercise
Most requests target one celebrity profile; adding shards barely changes that shard's load. Recovery exercise: choose a response and a verifiable acceptance gate.
Concurrency & async · 64 scenarios
Async work has nowhere to run.
Blocking remote calls occupy the executor used by unrelated asynchronous work.
More threads. The same throughput.
Virtual threads increase waiting capacity, but the database is still the bottleneck.
The counter loses increments
Eight threads update count++ on a shared int; final count is lower than successful operations. Incident investigation: choose a response and a verifiable acceptance gate.
The volatile balance still races
Balance is volatile; two withdrawals each read 100 and both approve an 80 withdrawal. Incident investigation: choose a response and a verifiable acceptance gate.
The collection changes during iteration
One thread iterates an ArrayList while another removes entries; failures occur only under load. Incident investigation: choose a response and a verifiable acceptance gate.
The canceled future keeps charging
A future is canceled after timeout; the remote request still completes and creates a charge. Incident investigation: choose a response and a verifiable acceptance gate.
The permit is never returned
Semaphore availability decreases after exceptional exits; successful paths release permits. Incident investigation: choose a response and a verifiable acceptance gate.
The lock protects different objects
Each call creates a new lock object before updating the same shared map. Incident investigation: choose a response and a verifiable acceptance gate.
The comparator breaks the sort
Comparator returns inconsistent ordering for equal timestamps; sorting intermittently reports contract violations. Incident investigation: choose a response and a verifiable acceptance gate.
The interrupt is swallowed
Shutdown interrupts a worker; catch InterruptedException logs and resumes its infinite loop. Incident investigation: choose a response and a verifiable acceptance gate.
The compute function calls itself
Cache loader recursively invokes computeIfAbsent for the same key; requests fail or stall. Incident investigation: choose a response and a verifiable acceptance gate.
The timeout only covers the first future
One stage has a timeout; a later network stage has none and holds requests indefinitely. Incident investigation: choose a response and a verifiable acceptance gate.
The producer outruns the queue
Producers submit to an unbounded queue; consumers are slower and heap grows with queued tasks. Incident investigation: choose a response and a verifiable acceptance gate.
The latch never reaches zero
One of five tasks throws before countDown; the coordinator waits forever. Incident investigation: choose a response and a verifiable acceptance gate.
The shared formatter corrupts timestamps
Parallel requests share a mutable legacy date formatter; individual-thread tests pass. Incident investigation: choose a response and a verifiable acceptance gate.
A check-then-act counter exceeds its limit
Two threads both see count=9 under limit=10 and then increment. Incident investigation: choose a response and a verifiable acceptance gate.
Interruption is swallowed by a worker
InterruptedException is caught and the loop immediately retries a blocking operation. Incident investigation: choose a response and a verifiable acceptance gate.
ThreadLocal context leaks in a pooled thread
A worker processes tenant B after tenant A and still sees A's stored context. Incident investigation: choose a response and a verifiable acceptance gate.
Canceling a future leaves a remote call running
The future is canceled but the HTTP client's in-flight request still consumes a slot. Incident investigation: choose a response and a verifiable acceptance gate.
The counter loses increments — implementation review
Eight threads update count++ on a shared int; final count is lower than successful operations. Implementation review: choose a response and a verifiable acceptance gate.
The volatile balance still races — implementation review
Balance is volatile; two withdrawals each read 100 and both approve an 80 withdrawal. Implementation review: choose a response and a verifiable acceptance gate.
The collection changes during iteration — implementation review
One thread iterates an ArrayList while another removes entries; failures occur only under load. Implementation review: choose a response and a verifiable acceptance gate.
The canceled future keeps charging — implementation review
A future is canceled after timeout; the remote request still completes and creates a charge. Implementation review: choose a response and a verifiable acceptance gate.
The permit is never returned — implementation review
Semaphore availability decreases after exceptional exits; successful paths release permits. Implementation review: choose a response and a verifiable acceptance gate.
The lock protects different objects — implementation review
Each call creates a new lock object before updating the same shared map. Implementation review: choose a response and a verifiable acceptance gate.
The comparator breaks the sort — implementation review
Comparator returns inconsistent ordering for equal timestamps; sorting intermittently reports contract violations. Implementation review: choose a response and a verifiable acceptance gate.
The interrupt is swallowed — implementation review
Shutdown interrupts a worker; catch InterruptedException logs and resumes its infinite loop. Implementation review: choose a response and a verifiable acceptance gate.
The compute function calls itself — implementation review
Cache loader recursively invokes computeIfAbsent for the same key; requests fail or stall. Implementation review: choose a response and a verifiable acceptance gate.
The timeout only covers the first future — implementation review
One stage has a timeout; a later network stage has none and holds requests indefinitely. Implementation review: choose a response and a verifiable acceptance gate.
The producer outruns the queue — implementation review
Producers submit to an unbounded queue; consumers are slower and heap grows with queued tasks. Implementation review: choose a response and a verifiable acceptance gate.
The latch never reaches zero — implementation review
One of five tasks throws before countDown; the coordinator waits forever. Implementation review: choose a response and a verifiable acceptance gate.
The shared formatter corrupts timestamps — implementation review
Parallel requests share a mutable legacy date formatter; individual-thread tests pass. Implementation review: choose a response and a verifiable acceptance gate.
A check-then-act counter exceeds its limit — implementation review
Two threads both see count=9 under limit=10 and then increment. Implementation review: choose a response and a verifiable acceptance gate.
Interruption is swallowed by a worker — implementation review
InterruptedException is caught and the loop immediately retries a blocking operation. Implementation review: choose a response and a verifiable acceptance gate.
ThreadLocal context leaks in a pooled thread — implementation review
A worker processes tenant B after tenant A and still sees A's stored context. Implementation review: choose a response and a verifiable acceptance gate.
Canceling a future leaves a remote call running — implementation review
The future is canceled but the HTTP client's in-flight request still consumes a slot. Implementation review: choose a response and a verifiable acceptance gate.
The counter loses increments — recovery exercise
Eight threads update count++ on a shared int; final count is lower than successful operations. Recovery exercise: choose a response and a verifiable acceptance gate.
The volatile balance still races — recovery exercise
Balance is volatile; two withdrawals each read 100 and both approve an 80 withdrawal. Recovery exercise: choose a response and a verifiable acceptance gate.
The collection changes during iteration — recovery exercise
One thread iterates an ArrayList while another removes entries; failures occur only under load. Recovery exercise: choose a response and a verifiable acceptance gate.
The canceled future keeps charging — recovery exercise
A future is canceled after timeout; the remote request still completes and creates a charge. Recovery exercise: choose a response and a verifiable acceptance gate.
The permit is never returned — recovery exercise
Semaphore availability decreases after exceptional exits; successful paths release permits. Recovery exercise: choose a response and a verifiable acceptance gate.
The lock protects different objects — recovery exercise
Each call creates a new lock object before updating the same shared map. Recovery exercise: choose a response and a verifiable acceptance gate.
The comparator breaks the sort — recovery exercise
Comparator returns inconsistent ordering for equal timestamps; sorting intermittently reports contract violations. Recovery exercise: choose a response and a verifiable acceptance gate.
The interrupt is swallowed — recovery exercise
Shutdown interrupts a worker; catch InterruptedException logs and resumes its infinite loop. Recovery exercise: choose a response and a verifiable acceptance gate.
The compute function calls itself — recovery exercise
Cache loader recursively invokes computeIfAbsent for the same key; requests fail or stall. Recovery exercise: choose a response and a verifiable acceptance gate.
The timeout only covers the first future — recovery exercise
One stage has a timeout; a later network stage has none and holds requests indefinitely. Recovery exercise: choose a response and a verifiable acceptance gate.
The producer outruns the queue — recovery exercise
Producers submit to an unbounded queue; consumers are slower and heap grows with queued tasks. Recovery exercise: choose a response and a verifiable acceptance gate.
The latch never reaches zero — recovery exercise
One of five tasks throws before countDown; the coordinator waits forever. Recovery exercise: choose a response and a verifiable acceptance gate.
The shared formatter corrupts timestamps — recovery exercise
Parallel requests share a mutable legacy date formatter; individual-thread tests pass. Recovery exercise: choose a response and a verifiable acceptance gate.
A check-then-act counter exceeds its limit — recovery exercise
Two threads both see count=9 under limit=10 and then increment. Recovery exercise: choose a response and a verifiable acceptance gate.
Interruption is swallowed by a worker — recovery exercise
InterruptedException is caught and the loop immediately retries a blocking operation. Recovery exercise: choose a response and a verifiable acceptance gate.
ThreadLocal context leaks in a pooled thread — recovery exercise
A worker processes tenant B after tenant A and still sees A's stored context. Recovery exercise: choose a response and a verifiable acceptance gate.
Canceling a future leaves a remote call running — recovery exercise
The future is canceled but the HTTP client's in-flight request still consumes a slot. Recovery exercise: choose a response and a verifiable acceptance gate.
The counter loses increments — architecture trade-off
Eight threads update count++ on a shared int; final count is lower than successful operations. Architecture trade-off: choose a response and a verifiable acceptance gate.
The volatile balance still races — architecture trade-off
Balance is volatile; two withdrawals each read 100 and both approve an 80 withdrawal. Architecture trade-off: choose a response and a verifiable acceptance gate.
The collection changes during iteration — architecture trade-off
One thread iterates an ArrayList while another removes entries; failures occur only under load. Architecture trade-off: choose a response and a verifiable acceptance gate.
The canceled future keeps charging — architecture trade-off
A future is canceled after timeout; the remote request still completes and creates a charge. Architecture trade-off: choose a response and a verifiable acceptance gate.
The permit is never returned — architecture trade-off
Semaphore availability decreases after exceptional exits; successful paths release permits. Architecture trade-off: choose a response and a verifiable acceptance gate.
The lock protects different objects — architecture trade-off
Each call creates a new lock object before updating the same shared map. Architecture trade-off: choose a response and a verifiable acceptance gate.
The comparator breaks the sort — architecture trade-off
Comparator returns inconsistent ordering for equal timestamps; sorting intermittently reports contract violations. Architecture trade-off: choose a response and a verifiable acceptance gate.
The interrupt is swallowed — architecture trade-off
Shutdown interrupts a worker; catch InterruptedException logs and resumes its infinite loop. Architecture trade-off: choose a response and a verifiable acceptance gate.
The compute function calls itself — architecture trade-off
Cache loader recursively invokes computeIfAbsent for the same key; requests fail or stall. Architecture trade-off: choose a response and a verifiable acceptance gate.
The timeout only covers the first future — architecture trade-off
One stage has a timeout; a later network stage has none and holds requests indefinitely. Architecture trade-off: choose a response and a verifiable acceptance gate.
The producer outruns the queue — architecture trade-off
Producers submit to an unbounded queue; consumers are slower and heap grows with queued tasks. Architecture trade-off: choose a response and a verifiable acceptance gate.
Programming fundamentals · 40 scenarios
The map forgets a key it still contains.
A key changes after insertion and lookups become unreliable.
Decimal money changes after a round trip
new BigDecimal(0.1) differs from new BigDecimal("0.1"); invoice reconciliation fails an exact comparison. Incident investigation: choose a response and a verifiable acceptance gate.
BigDecimal keys disagree with numeric comparison
1.0.compareTo(1.00) is zero but their equals result is false; a HashMap stores both keys. Incident investigation: choose a response and a verifiable acceptance gate.
A list view changes its backing order
subList is kept after structural changes to the source list; later reads fail. Incident investigation: choose a response and a verifiable acceptance gate.
An unmodifiable list still exposes mutable elements
List.copyOf blocks add but an element's status can still be changed. Incident investigation: choose a response and a verifiable acceptance gate.
Comparator arithmetic overflows
Comparator returns a-b for extreme int values; sorted results violate numeric order. Incident investigation: choose a response and a verifiable acceptance gate.
Locale changes an identifier lookup
Uppercasing an internal identifier with the server default locale changes its normalized value. Incident investigation: choose a response and a verifiable acceptance gate.
A date-only booking shifts to the prior day
A LocalDate is converted through an implicit server zone and displayed in another zone. Incident investigation: choose a response and a verifiable acceptance gate.
An integer counter wraps during aggregation
Adding valid per-request int values produces a negative daily total. Incident investigation: choose a response and a verifiable acceptance gate.
Exceptions are replaced by success defaults
A pricing dependency error is caught and the handler returns a zero price. Incident investigation: choose a response and a verifiable acceptance gate.
Record components retain a mutable collection
A Java record accepts a caller-owned ArrayList; callers change it after construction. Incident investigation: choose a response and a verifiable acceptance gate.
A recursive tree walk exhausts the stack
A deeply nested imported tree reaches thousands of nodes on one branch. Incident investigation: choose a response and a verifiable acceptance gate.
Hash iteration becomes an API ordering contract
Responses serialize HashMap iteration order and snapshot tests vary by insertion history. Incident investigation: choose a response and a verifiable acceptance gate.
Set membership breaks after mutation
An object changes a field used by equals and hashCode after insertion into HashSet. Incident investigation: choose a response and a verifiable acceptance gate.
Decimal money changes after a round trip — implementation review
new BigDecimal(0.1) differs from new BigDecimal("0.1"); invoice reconciliation fails an exact comparison. Implementation review: choose a response and a verifiable acceptance gate.
BigDecimal keys disagree with numeric comparison — implementation review
1.0.compareTo(1.00) is zero but their equals result is false; a HashMap stores both keys. Implementation review: choose a response and a verifiable acceptance gate.
A list view changes its backing order — implementation review
subList is kept after structural changes to the source list; later reads fail. Implementation review: choose a response and a verifiable acceptance gate.
An unmodifiable list still exposes mutable elements — implementation review
List.copyOf blocks add but an element's status can still be changed. Implementation review: choose a response and a verifiable acceptance gate.
Comparator arithmetic overflows — implementation review
Comparator returns a-b for extreme int values; sorted results violate numeric order. Implementation review: choose a response and a verifiable acceptance gate.
Locale changes an identifier lookup — implementation review
Uppercasing an internal identifier with the server default locale changes its normalized value. Implementation review: choose a response and a verifiable acceptance gate.
A date-only booking shifts to the prior day — implementation review
A LocalDate is converted through an implicit server zone and displayed in another zone. Implementation review: choose a response and a verifiable acceptance gate.
An integer counter wraps during aggregation — implementation review
Adding valid per-request int values produces a negative daily total. Implementation review: choose a response and a verifiable acceptance gate.
Exceptions are replaced by success defaults — implementation review
A pricing dependency error is caught and the handler returns a zero price. Implementation review: choose a response and a verifiable acceptance gate.
Record components retain a mutable collection — implementation review
A Java record accepts a caller-owned ArrayList; callers change it after construction. Implementation review: choose a response and a verifiable acceptance gate.
A recursive tree walk exhausts the stack — implementation review
A deeply nested imported tree reaches thousands of nodes on one branch. Implementation review: choose a response and a verifiable acceptance gate.
Hash iteration becomes an API ordering contract — implementation review
Responses serialize HashMap iteration order and snapshot tests vary by insertion history. Implementation review: choose a response and a verifiable acceptance gate.
Set membership breaks after mutation — implementation review
An object changes a field used by equals and hashCode after insertion into HashSet. Implementation review: choose a response and a verifiable acceptance gate.
Decimal money changes after a round trip — recovery exercise
new BigDecimal(0.1) differs from new BigDecimal("0.1"); invoice reconciliation fails an exact comparison. Recovery exercise: choose a response and a verifiable acceptance gate.
BigDecimal keys disagree with numeric comparison — recovery exercise
1.0.compareTo(1.00) is zero but their equals result is false; a HashMap stores both keys. Recovery exercise: choose a response and a verifiable acceptance gate.
A list view changes its backing order — recovery exercise
subList is kept after structural changes to the source list; later reads fail. Recovery exercise: choose a response and a verifiable acceptance gate.
An unmodifiable list still exposes mutable elements — recovery exercise
List.copyOf blocks add but an element's status can still be changed. Recovery exercise: choose a response and a verifiable acceptance gate.
Comparator arithmetic overflows — recovery exercise
Comparator returns a-b for extreme int values; sorted results violate numeric order. Recovery exercise: choose a response and a verifiable acceptance gate.
Locale changes an identifier lookup — recovery exercise
Uppercasing an internal identifier with the server default locale changes its normalized value. Recovery exercise: choose a response and a verifiable acceptance gate.
A date-only booking shifts to the prior day — recovery exercise
A LocalDate is converted through an implicit server zone and displayed in another zone. Recovery exercise: choose a response and a verifiable acceptance gate.
An integer counter wraps during aggregation — recovery exercise
Adding valid per-request int values produces a negative daily total. Recovery exercise: choose a response and a verifiable acceptance gate.
Exceptions are replaced by success defaults — recovery exercise
A pricing dependency error is caught and the handler returns a zero price. Recovery exercise: choose a response and a verifiable acceptance gate.
Record components retain a mutable collection — recovery exercise
A Java record accepts a caller-owned ArrayList; callers change it after construction. Recovery exercise: choose a response and a verifiable acceptance gate.
A recursive tree walk exhausts the stack — recovery exercise
A deeply nested imported tree reaches thousands of nodes on one branch. Recovery exercise: choose a response and a verifiable acceptance gate.
Hash iteration becomes an API ordering contract — recovery exercise
Responses serialize HashMap iteration order and snapshot tests vary by insertion history. Recovery exercise: choose a response and a verifiable acceptance gate.
Set membership breaks after mutation — recovery exercise
An object changes a field used by equals and hashCode after insertion into HashSet. Recovery exercise: choose a response and a verifiable acceptance gate.
HTTP & API contracts · 80 scenarios
Page two repeats page one.
Offset pagination shifts when new records arrive between requests.
The private response is shared
A CDN caches an account page under the URL only; a second signed-in user receives the first user's content. Incident investigation: choose a response and a verifiable acceptance gate.
The ETag ignores the representation
English and French responses share an ETag derived only from record ID; clients reuse the wrong representation. Incident investigation: choose a response and a verifiable acceptance gate.
The retry repeats a POST effect
Client times out after order creation and blindly repeats POST; two orders appear. Incident investigation: choose a response and a verifiable acceptance gate.
The proxy discards the prefix
Service generates redirects without its external path prefix; browser returns to an unrelated root route. Incident investigation: choose a response and a verifiable acceptance gate.
The request body is consumed twice
Logging middleware reads the entire request stream; downstream JSON parsing sees no bytes. Incident investigation: choose a response and a verifiable acceptance gate.
The bulk endpoint has no size bound
One authenticated request submits millions of items; parsing and validation exhaust memory before business limits run. Incident investigation: choose a response and a verifiable acceptance gate.
The timeout exceeds the caller's deadline
Backend waits 60 seconds for a dependency; gateway closes the client request after 10 seconds. Incident investigation: choose a response and a verifiable acceptance gate.
The cursor accepts a different filter
A continuation token from customer A's search is reused with customer B's filters. Incident investigation: choose a response and a verifiable acceptance gate.
The PATCH clears omitted fields
A partial JSON update is mapped onto a full object; missing fields become null in storage. Incident investigation: choose a response and a verifiable acceptance gate.
The success response hides partial failure
Bulk import returns 200 with a single success flag although several item writes failed. Incident investigation: choose a response and a verifiable acceptance gate.
The content type is guessed
Endpoint receives form data but attempts JSON parsing; clients see misleading internal errors. Incident investigation: choose a response and a verifiable acceptance gate.
The range download ignores object versions
A client resumes part of a file after the object changes; combined bytes form a corrupt download. Incident investigation: choose a response and a verifiable acceptance gate.
The URL parser disagrees with validation
Validation checks a hostname string differently from the outbound client; a crafted URL reaches an unintended destination. Incident investigation: choose a response and a verifiable acceptance gate.
An ETag update overwrites a newer version
Two clients read version 7; both PUT without a precondition and the later write replaces the earlier one. Incident investigation: choose a response and a verifiable acceptance gate.
A request body bypasses validation groups
A partial update uses the create DTO but skips required update invariants. Incident investigation: choose a response and a verifiable acceptance gate.
Offset pagination skips moving records
An insertion shifts rows before the client's next offset; one record is repeated and another is skipped. Incident investigation: choose a response and a verifiable acceptance gate.
A cursor can be reused across tenants
A signed cursor includes a row position but no authorization scope; another tenant reuses it. Incident investigation: choose a response and a verifiable acceptance gate.
The API returns success for background acceptance
The handler returns 200 before validation and the worker later rejects the task. Incident investigation: choose a response and a verifiable acceptance gate.
A timeout outlives the caller's deadline
The API has 3 seconds remaining but gives a downstream client a 10-second timeout. Incident investigation: choose a response and a verifiable acceptance gate.
An enum addition breaks a generated client
The service returns a new enum value; an older client rejects the whole response. Incident investigation: choose a response and a verifiable acceptance gate.
Problem details leak private implementation data
A validation response includes SQL text, tenant identifiers and a stack trace. Incident investigation: choose a response and a verifiable acceptance gate.
The private response is shared — implementation review
A CDN caches an account page under the URL only; a second signed-in user receives the first user's content. Implementation review: choose a response and a verifiable acceptance gate.
The ETag ignores the representation — implementation review
English and French responses share an ETag derived only from record ID; clients reuse the wrong representation. Implementation review: choose a response and a verifiable acceptance gate.
The retry repeats a POST effect — implementation review
Client times out after order creation and blindly repeats POST; two orders appear. Implementation review: choose a response and a verifiable acceptance gate.
The proxy discards the prefix — implementation review
Service generates redirects without its external path prefix; browser returns to an unrelated root route. Implementation review: choose a response and a verifiable acceptance gate.
The request body is consumed twice — implementation review
Logging middleware reads the entire request stream; downstream JSON parsing sees no bytes. Implementation review: choose a response and a verifiable acceptance gate.
The bulk endpoint has no size bound — implementation review
One authenticated request submits millions of items; parsing and validation exhaust memory before business limits run. Implementation review: choose a response and a verifiable acceptance gate.
The timeout exceeds the caller's deadline — implementation review
Backend waits 60 seconds for a dependency; gateway closes the client request after 10 seconds. Implementation review: choose a response and a verifiable acceptance gate.
The cursor accepts a different filter — implementation review
A continuation token from customer A's search is reused with customer B's filters. Implementation review: choose a response and a verifiable acceptance gate.
The PATCH clears omitted fields — implementation review
A partial JSON update is mapped onto a full object; missing fields become null in storage. Implementation review: choose a response and a verifiable acceptance gate.
The success response hides partial failure — implementation review
Bulk import returns 200 with a single success flag although several item writes failed. Implementation review: choose a response and a verifiable acceptance gate.
The content type is guessed — implementation review
Endpoint receives form data but attempts JSON parsing; clients see misleading internal errors. Implementation review: choose a response and a verifiable acceptance gate.
The range download ignores object versions — implementation review
A client resumes part of a file after the object changes; combined bytes form a corrupt download. Implementation review: choose a response and a verifiable acceptance gate.
The URL parser disagrees with validation — implementation review
Validation checks a hostname string differently from the outbound client; a crafted URL reaches an unintended destination. Implementation review: choose a response and a verifiable acceptance gate.
An ETag update overwrites a newer version — implementation review
Two clients read version 7; both PUT without a precondition and the later write replaces the earlier one. Implementation review: choose a response and a verifiable acceptance gate.
A request body bypasses validation groups — implementation review
A partial update uses the create DTO but skips required update invariants. Implementation review: choose a response and a verifiable acceptance gate.
Offset pagination skips moving records — implementation review
An insertion shifts rows before the client's next offset; one record is repeated and another is skipped. Implementation review: choose a response and a verifiable acceptance gate.
A cursor can be reused across tenants — implementation review
A signed cursor includes a row position but no authorization scope; another tenant reuses it. Implementation review: choose a response and a verifiable acceptance gate.
The API returns success for background acceptance — implementation review
The handler returns 200 before validation and the worker later rejects the task. Implementation review: choose a response and a verifiable acceptance gate.
A timeout outlives the caller's deadline — implementation review
The API has 3 seconds remaining but gives a downstream client a 10-second timeout. Implementation review: choose a response and a verifiable acceptance gate.
An enum addition breaks a generated client — implementation review
The service returns a new enum value; an older client rejects the whole response. Implementation review: choose a response and a verifiable acceptance gate.
Problem details leak private implementation data — implementation review
A validation response includes SQL text, tenant identifiers and a stack trace. Implementation review: choose a response and a verifiable acceptance gate.
The private response is shared — recovery exercise
A CDN caches an account page under the URL only; a second signed-in user receives the first user's content. Recovery exercise: choose a response and a verifiable acceptance gate.
The ETag ignores the representation — recovery exercise
English and French responses share an ETag derived only from record ID; clients reuse the wrong representation. Recovery exercise: choose a response and a verifiable acceptance gate.
The retry repeats a POST effect — recovery exercise
Client times out after order creation and blindly repeats POST; two orders appear. Recovery exercise: choose a response and a verifiable acceptance gate.
The proxy discards the prefix — recovery exercise
Service generates redirects without its external path prefix; browser returns to an unrelated root route. Recovery exercise: choose a response and a verifiable acceptance gate.
The request body is consumed twice — recovery exercise
Logging middleware reads the entire request stream; downstream JSON parsing sees no bytes. Recovery exercise: choose a response and a verifiable acceptance gate.
The bulk endpoint has no size bound — recovery exercise
One authenticated request submits millions of items; parsing and validation exhaust memory before business limits run. Recovery exercise: choose a response and a verifiable acceptance gate.
The timeout exceeds the caller's deadline — recovery exercise
Backend waits 60 seconds for a dependency; gateway closes the client request after 10 seconds. Recovery exercise: choose a response and a verifiable acceptance gate.
The cursor accepts a different filter — recovery exercise
A continuation token from customer A's search is reused with customer B's filters. Recovery exercise: choose a response and a verifiable acceptance gate.
The PATCH clears omitted fields — recovery exercise
A partial JSON update is mapped onto a full object; missing fields become null in storage. Recovery exercise: choose a response and a verifiable acceptance gate.
The success response hides partial failure — recovery exercise
Bulk import returns 200 with a single success flag although several item writes failed. Recovery exercise: choose a response and a verifiable acceptance gate.
The content type is guessed — recovery exercise
Endpoint receives form data but attempts JSON parsing; clients see misleading internal errors. Recovery exercise: choose a response and a verifiable acceptance gate.
The range download ignores object versions — recovery exercise
A client resumes part of a file after the object changes; combined bytes form a corrupt download. Recovery exercise: choose a response and a verifiable acceptance gate.
The URL parser disagrees with validation — recovery exercise
Validation checks a hostname string differently from the outbound client; a crafted URL reaches an unintended destination. Recovery exercise: choose a response and a verifiable acceptance gate.
An ETag update overwrites a newer version — recovery exercise
Two clients read version 7; both PUT without a precondition and the later write replaces the earlier one. Recovery exercise: choose a response and a verifiable acceptance gate.
A request body bypasses validation groups — recovery exercise
A partial update uses the create DTO but skips required update invariants. Recovery exercise: choose a response and a verifiable acceptance gate.
Offset pagination skips moving records — recovery exercise
An insertion shifts rows before the client's next offset; one record is repeated and another is skipped. Recovery exercise: choose a response and a verifiable acceptance gate.
A cursor can be reused across tenants — recovery exercise
A signed cursor includes a row position but no authorization scope; another tenant reuses it. Recovery exercise: choose a response and a verifiable acceptance gate.
The API returns success for background acceptance — recovery exercise
The handler returns 200 before validation and the worker later rejects the task. Recovery exercise: choose a response and a verifiable acceptance gate.
A timeout outlives the caller's deadline — recovery exercise
The API has 3 seconds remaining but gives a downstream client a 10-second timeout. Recovery exercise: choose a response and a verifiable acceptance gate.
An enum addition breaks a generated client — recovery exercise
The service returns a new enum value; an older client rejects the whole response. Recovery exercise: choose a response and a verifiable acceptance gate.
Problem details leak private implementation data — recovery exercise
A validation response includes SQL text, tenant identifiers and a stack trace. Recovery exercise: choose a response and a verifiable acceptance gate.
The private response is shared — architecture trade-off
A CDN caches an account page under the URL only; a second signed-in user receives the first user's content. Architecture trade-off: choose a response and a verifiable acceptance gate.
The ETag ignores the representation — architecture trade-off
English and French responses share an ETag derived only from record ID; clients reuse the wrong representation. Architecture trade-off: choose a response and a verifiable acceptance gate.
The retry repeats a POST effect — architecture trade-off
Client times out after order creation and blindly repeats POST; two orders appear. Architecture trade-off: choose a response and a verifiable acceptance gate.
The proxy discards the prefix — architecture trade-off
Service generates redirects without its external path prefix; browser returns to an unrelated root route. Architecture trade-off: choose a response and a verifiable acceptance gate.
The request body is consumed twice — architecture trade-off
Logging middleware reads the entire request stream; downstream JSON parsing sees no bytes. Architecture trade-off: choose a response and a verifiable acceptance gate.
The bulk endpoint has no size bound — architecture trade-off
One authenticated request submits millions of items; parsing and validation exhaust memory before business limits run. Architecture trade-off: choose a response and a verifiable acceptance gate.
The timeout exceeds the caller's deadline — architecture trade-off
Backend waits 60 seconds for a dependency; gateway closes the client request after 10 seconds. Architecture trade-off: choose a response and a verifiable acceptance gate.
The cursor accepts a different filter — architecture trade-off
A continuation token from customer A's search is reused with customer B's filters. Architecture trade-off: choose a response and a verifiable acceptance gate.
The PATCH clears omitted fields — architecture trade-off
A partial JSON update is mapped onto a full object; missing fields become null in storage. Architecture trade-off: choose a response and a verifiable acceptance gate.
The success response hides partial failure — architecture trade-off
Bulk import returns 200 with a single success flag although several item writes failed. Architecture trade-off: choose a response and a verifiable acceptance gate.
The content type is guessed — architecture trade-off
Endpoint receives form data but attempts JSON parsing; clients see misleading internal errors. Architecture trade-off: choose a response and a verifiable acceptance gate.
The range download ignores object versions — architecture trade-off
A client resumes part of a file after the object changes; combined bytes form a corrupt download. Architecture trade-off: choose a response and a verifiable acceptance gate.
The URL parser disagrees with validation — architecture trade-off
Validation checks a hostname string differently from the outbound client; a crafted URL reaches an unintended destination. Architecture trade-off: choose a response and a verifiable acceptance gate.
An ETag update overwrites a newer version — architecture trade-off
Two clients read version 7; both PUT without a precondition and the later write replaces the earlier one. Architecture trade-off: choose a response and a verifiable acceptance gate.
A request body bypasses validation groups — architecture trade-off
A partial update uses the create DTO but skips required update invariants. Architecture trade-off: choose a response and a verifiable acceptance gate.
Offset pagination skips moving records — architecture trade-off
An insertion shifts rows before the client's next offset; one record is repeated and another is skipped. Architecture trade-off: choose a response and a verifiable acceptance gate.
Cybersecurity · 80 scenarios
A cache hit returns another tenant’s data.
A cache key omits tenant identity and crosses an authorization boundary.
The object ID changes the account
Signed-in user changes an invoice ID and receives another user's invoice. Incident investigation: choose a response and a verifiable acceptance gate.
The UI-only admin button
Non-admin hides the button in the browser but can call the same mutation endpoint directly. Incident investigation: choose a response and a verifiable acceptance gate.
The JWT belongs to another audience
A valid signed token issued for a different service is accepted by the payment API. Incident investigation: choose a response and a verifiable acceptance gate.
The role change leaves access open
User is removed from an admin role; long-lived authorization cache still approves privileged operations. Incident investigation: choose a response and a verifiable acceptance gate.
The export job trusts its submitter field
A queued export accepts tenantId from its message without binding it to the authorized job owner. Incident investigation: choose a response and a verifiable acceptance gate.
The password reset token is reusable
A reset link succeeds twice after the first password change. Incident investigation: choose a response and a verifiable acceptance gate.
The redirect accepts any return URL
Sign-in return target accepts an arbitrary external URL provided by the request. Incident investigation: choose a response and a verifiable acceptance gate.
The log contains bearer tokens
Access logs record all request headers; production bearer tokens appear in retained logs. Incident investigation: choose a response and a verifiable acceptance gate.
The upload filename escapes its folder
Server joins a user filename to a storage directory without checking the resolved destination. Incident investigation: choose a response and a verifiable acceptance gate.
The signed webhook parses first
Handler parses and reserializes JSON before checking the signature; valid callbacks fail. Incident investigation: choose a response and a verifiable acceptance gate.
The refund screen trusts a price field
Client sends a purchase amount and server uses it as the authoritative refund basis. Incident investigation: choose a response and a verifiable acceptance gate.
The permission check races deletion
Authorization checks a resource, then an unrelated lookup resolves a reused identifier to a new owner. Incident investigation: choose a response and a verifiable acceptance gate.
The service accepts an empty security config
Missing issuer configuration falls back to decoding tokens without signature verification. Incident investigation: choose a response and a verifiable acceptance gate.
An API accepts a token for another audience
JWT signature and issuer validate; aud names the reporting service rather than this API. Incident investigation: choose a response and a verifiable acceptance gate.
Key rotation makes valid logins fail
JWT kid is new; cached JWKS contains only the retired key; identity provider publishes both. Incident investigation: choose a response and a verifiable acceptance gate.
URL previews reach an internal metadata service
User URL resolves to a private address after a redirect; preview client follows it. Incident investigation: choose a response and a verifiable acceptance gate.
Changing a resource ID exposes another user's record
User alpha requests resource owned by beta; authentication succeeds and record is returned. Incident investigation: choose a response and a verifiable acceptance gate.
Profile updates change a privileged field
PATCH body contains role=admin; generic entity binding persists it. Incident investigation: choose a response and a verifiable acceptance gate.
Cross-site requests modify a cookie-authenticated account
Browser sends a session cookie on an unwanted cross-site POST; no CSRF validation runs. Incident investigation: choose a response and a verifiable acceptance gate.
Credentialed CORS reflects arbitrary origins
Response echoes Origin and allows credentials for an untrusted site. Incident investigation: choose a response and a verifiable acceptance gate.
Dynamic sort fields enter SQL unchanged
ORDER BY is built from a client string; bound parameters protect values but not this identifier. Incident investigation: choose a response and a verifiable acceptance gate.
Polymorphic deserialization instantiates attacker-selected classes
Payload includes a type discriminator naming an unexpected class; deserializer permits arbitrary subtypes. Incident investigation: choose a response and a verifiable acceptance gate.
An uploaded archive writes outside its workspace
Entry name ../../config.env resolves outside the extraction directory. Incident investigation: choose a response and a verifiable acceptance gate.
Webhook signatures fail after JSON reformatting
Provider signature covers raw bytes; handler parses and reserializes JSON before verification. Incident investigation: choose a response and a verifiable acceptance gate.
Login preserves an attacker-known session ID
Pre-login session ID remains identical after authentication. Incident investigation: choose a response and a verifiable acceptance gate.
OAuth callbacks accept a missing state parameter
Callback with a valid code but no matching state completes login. Incident investigation: choose a response and a verifiable acceptance gate.
Return URLs redirect users to a hostile host
URL https://trusted.example.evil.test passes a startsWith check. Incident investigation: choose a response and a verifiable acceptance gate.
An attacker forges operational log entries
User-controlled field contains CRLF and a fake success line; text logs split it into separate records. Incident investigation: choose a response and a verifiable acceptance gate.
Rotating a secret breaks an in-flight deployment
Old workers use key v1 while downstream accepts only v2; errors begin during rollout. Incident investigation: choose a response and a verifiable acceptance gate.
Password recovery reveals which accounts exist
Known email gets 200 in 30ms; unknown email gets 404 immediately. Incident investigation: choose a response and a verifiable acceptance gate.
A forged forwarded IP bypasses rate limits
Client changes X-Forwarded-For; limiter allocates a fresh bucket although connection source is unchanged. Incident investigation: choose a response and a verifiable acceptance gate.
Long-running jobs use expired role credentials
Credential expiry is 11:00; job retries at 11:05 with the same cached access key. Incident investigation: choose a response and a verifiable acceptance gate.
Encrypted objects become unreadable after a key policy change
Object exists and storage permission succeeds; decrypt returns access denied for the workload role. Incident investigation: choose a response and a verifiable acceptance gate.
The object ID changes the account — implementation review
Signed-in user changes an invoice ID and receives another user's invoice. Implementation review: choose a response and a verifiable acceptance gate.
The UI-only admin button — implementation review
Non-admin hides the button in the browser but can call the same mutation endpoint directly. Implementation review: choose a response and a verifiable acceptance gate.
The JWT belongs to another audience — implementation review
A valid signed token issued for a different service is accepted by the payment API. Implementation review: choose a response and a verifiable acceptance gate.
The role change leaves access open — implementation review
User is removed from an admin role; long-lived authorization cache still approves privileged operations. Implementation review: choose a response and a verifiable acceptance gate.
The export job trusts its submitter field — implementation review
A queued export accepts tenantId from its message without binding it to the authorized job owner. Implementation review: choose a response and a verifiable acceptance gate.
The password reset token is reusable — implementation review
A reset link succeeds twice after the first password change. Implementation review: choose a response and a verifiable acceptance gate.
The redirect accepts any return URL — implementation review
Sign-in return target accepts an arbitrary external URL provided by the request. Implementation review: choose a response and a verifiable acceptance gate.
The log contains bearer tokens — implementation review
Access logs record all request headers; production bearer tokens appear in retained logs. Implementation review: choose a response and a verifiable acceptance gate.
The upload filename escapes its folder — implementation review
Server joins a user filename to a storage directory without checking the resolved destination. Implementation review: choose a response and a verifiable acceptance gate.
The signed webhook parses first — implementation review
Handler parses and reserializes JSON before checking the signature; valid callbacks fail. Implementation review: choose a response and a verifiable acceptance gate.
The refund screen trusts a price field — implementation review
Client sends a purchase amount and server uses it as the authoritative refund basis. Implementation review: choose a response and a verifiable acceptance gate.
The permission check races deletion — implementation review
Authorization checks a resource, then an unrelated lookup resolves a reused identifier to a new owner. Implementation review: choose a response and a verifiable acceptance gate.
The service accepts an empty security config — implementation review
Missing issuer configuration falls back to decoding tokens without signature verification. Implementation review: choose a response and a verifiable acceptance gate.
An API accepts a token for another audience — implementation review
JWT signature and issuer validate; aud names the reporting service rather than this API. Implementation review: choose a response and a verifiable acceptance gate.
Key rotation makes valid logins fail — implementation review
JWT kid is new; cached JWKS contains only the retired key; identity provider publishes both. Implementation review: choose a response and a verifiable acceptance gate.
URL previews reach an internal metadata service — implementation review
User URL resolves to a private address after a redirect; preview client follows it. Implementation review: choose a response and a verifiable acceptance gate.
Changing a resource ID exposes another user's record — implementation review
User alpha requests resource owned by beta; authentication succeeds and record is returned. Implementation review: choose a response and a verifiable acceptance gate.
Profile updates change a privileged field — implementation review
PATCH body contains role=admin; generic entity binding persists it. Implementation review: choose a response and a verifiable acceptance gate.
Cross-site requests modify a cookie-authenticated account — implementation review
Browser sends a session cookie on an unwanted cross-site POST; no CSRF validation runs. Implementation review: choose a response and a verifiable acceptance gate.
Credentialed CORS reflects arbitrary origins — implementation review
Response echoes Origin and allows credentials for an untrusted site. Implementation review: choose a response and a verifiable acceptance gate.
Dynamic sort fields enter SQL unchanged — implementation review
ORDER BY is built from a client string; bound parameters protect values but not this identifier. Implementation review: choose a response and a verifiable acceptance gate.
Polymorphic deserialization instantiates attacker-selected classes — implementation review
Payload includes a type discriminator naming an unexpected class; deserializer permits arbitrary subtypes. Implementation review: choose a response and a verifiable acceptance gate.
An uploaded archive writes outside its workspace — implementation review
Entry name ../../config.env resolves outside the extraction directory. Implementation review: choose a response and a verifiable acceptance gate.
Webhook signatures fail after JSON reformatting — implementation review
Provider signature covers raw bytes; handler parses and reserializes JSON before verification. Implementation review: choose a response and a verifiable acceptance gate.
Login preserves an attacker-known session ID — implementation review
Pre-login session ID remains identical after authentication. Implementation review: choose a response and a verifiable acceptance gate.
OAuth callbacks accept a missing state parameter — implementation review
Callback with a valid code but no matching state completes login. Implementation review: choose a response and a verifiable acceptance gate.
Return URLs redirect users to a hostile host — implementation review
URL https://trusted.example.evil.test passes a startsWith check. Implementation review: choose a response and a verifiable acceptance gate.
An attacker forges operational log entries — implementation review
User-controlled field contains CRLF and a fake success line; text logs split it into separate records. Implementation review: choose a response and a verifiable acceptance gate.
Rotating a secret breaks an in-flight deployment — implementation review
Old workers use key v1 while downstream accepts only v2; errors begin during rollout. Implementation review: choose a response and a verifiable acceptance gate.
Password recovery reveals which accounts exist — implementation review
Known email gets 200 in 30ms; unknown email gets 404 immediately. Implementation review: choose a response and a verifiable acceptance gate.
A forged forwarded IP bypasses rate limits — implementation review
Client changes X-Forwarded-For; limiter allocates a fresh bucket although connection source is unchanged. Implementation review: choose a response and a verifiable acceptance gate.
Long-running jobs use expired role credentials — implementation review
Credential expiry is 11:00; job retries at 11:05 with the same cached access key. Implementation review: choose a response and a verifiable acceptance gate.
Encrypted objects become unreadable after a key policy change — implementation review
Object exists and storage permission succeeds; decrypt returns access denied for the workload role. Implementation review: choose a response and a verifiable acceptance gate.
The object ID changes the account — recovery exercise
Signed-in user changes an invoice ID and receives another user's invoice. Recovery exercise: choose a response and a verifiable acceptance gate.
The UI-only admin button — recovery exercise
Non-admin hides the button in the browser but can call the same mutation endpoint directly. Recovery exercise: choose a response and a verifiable acceptance gate.
The JWT belongs to another audience — recovery exercise
A valid signed token issued for a different service is accepted by the payment API. Recovery exercise: choose a response and a verifiable acceptance gate.
The role change leaves access open — recovery exercise
User is removed from an admin role; long-lived authorization cache still approves privileged operations. Recovery exercise: choose a response and a verifiable acceptance gate.
The export job trusts its submitter field — recovery exercise
A queued export accepts tenantId from its message without binding it to the authorized job owner. Recovery exercise: choose a response and a verifiable acceptance gate.
The password reset token is reusable — recovery exercise
A reset link succeeds twice after the first password change. Recovery exercise: choose a response and a verifiable acceptance gate.
The redirect accepts any return URL — recovery exercise
Sign-in return target accepts an arbitrary external URL provided by the request. Recovery exercise: choose a response and a verifiable acceptance gate.
The log contains bearer tokens — recovery exercise
Access logs record all request headers; production bearer tokens appear in retained logs. Recovery exercise: choose a response and a verifiable acceptance gate.
The upload filename escapes its folder — recovery exercise
Server joins a user filename to a storage directory without checking the resolved destination. Recovery exercise: choose a response and a verifiable acceptance gate.
The signed webhook parses first — recovery exercise
Handler parses and reserializes JSON before checking the signature; valid callbacks fail. Recovery exercise: choose a response and a verifiable acceptance gate.
The refund screen trusts a price field — recovery exercise
Client sends a purchase amount and server uses it as the authoritative refund basis. Recovery exercise: choose a response and a verifiable acceptance gate.
The permission check races deletion — recovery exercise
Authorization checks a resource, then an unrelated lookup resolves a reused identifier to a new owner. Recovery exercise: choose a response and a verifiable acceptance gate.
The service accepts an empty security config — recovery exercise
Missing issuer configuration falls back to decoding tokens without signature verification. Recovery exercise: choose a response and a verifiable acceptance gate.
System design & architecture · 80 scenarios
An expired lease holder still writes
Worker A pauses past lease expiry; worker B acquires lease; A resumes and commits. Incident investigation: choose a response and a verifiable acceptance gate.
A saga compensation cannot undo a delivered effect
External delivery has completed; rollback step only deletes the local request row. Incident investigation: choose a response and a verifiable acceptance gate.
Outbox replay repeats a downstream effect
Publisher restarts after send but before marking delivered; event is sent again. Incident investigation: choose a response and a verifiable acceptance gate.
An idempotency key is reused for a different request
Same key appears with changed amount or target; server returns the old result. Incident investigation: choose a response and a verifiable acceptance gate.
An unbounded queue turns overload into memory failure
Arrival rate exceeds service rate for 20 minutes; queued objects grow until OOM. Incident investigation: choose a response and a verifiable acceptance gate.
Half-open circuit breakers create a probe storm
Every replica opens its breaker then sends 50 trial calls at the same time. Incident investigation: choose a response and a verifiable acceptance gate.
Configuration reload combines incompatible versions
One cache reads config v7 while another reads v8; requests mix routing and validation rules. Incident investigation: choose a response and a verifiable acceptance gate.
Capacity planning ignores fan-out
The design admits 500 requests per second and each starts 12 database operations. Incident investigation: choose a response and a verifiable acceptance gate.
A modular monolith becomes a distributed monolith
Five services deploy independently but each request needs all five available. Incident investigation: choose a response and a verifiable acceptance gate.
Read replicas violate read-after-write expectations
A user updates a profile then reads from a lagging replica and sees the old version. Incident investigation: choose a response and a verifiable acceptance gate.
CQRS adds an untracked lag window
Commands succeed but the projection is delayed and the UI reports the item missing. Incident investigation: choose a response and a verifiable acceptance gate.
Event sourcing loses replay compatibility
An old event lacks a field now treated as mandatory by the new projection. Incident investigation: choose a response and a verifiable acceptance gate.
A saga compensates an irreversible action incorrectly
A shipment has left the warehouse but compensation only removes its local row. Incident investigation: choose a response and a verifiable acceptance gate.
Active-active writes create conflicting ownership
Two regions accept changes to the same entity while replication is partitioned. Incident investigation: choose a response and a verifiable acceptance gate.
Sharding creates a hot tenant
One tenant owns 60 percent of requests and all its records map to one shard. Incident investigation: choose a response and a verifiable acceptance gate.
Strangler migration routes one operation twice
Old and new services both receive a write during routing cutover. Incident investigation: choose a response and a verifiable acceptance gate.
Dual writes drift during a schema migration
Old store commits while the new store fails; retry changes only the new representation. Incident investigation: choose a response and a verifiable acceptance gate.
An ADR lacks its decision trigger
A team chooses a broker without documenting throughput, ordering or recovery needs. Incident investigation: choose a response and a verifiable acceptance gate.
Multi-tenancy lacks a noisy-neighbor budget
One tenant consumes every worker and unrelated tenants time out. Incident investigation: choose a response and a verifiable acceptance gate.
An asynchronous API has no completion contract
POST returns 202 but no status URL or durable operation identity is stored. Incident investigation: choose a response and a verifiable acceptance gate.
Backup success does not prove recovery
Backup jobs report success but no restore has been attempted with the required keys. Incident investigation: choose a response and a verifiable acceptance gate.
Build-versus-buy ignores exit costs
A service depends on provider-specific identity and data formats with no export proof. Incident investigation: choose a response and a verifiable acceptance gate.
Cross-service queries leak domain ownership
A reporting feature directly joins several services' private database tables. Incident investigation: choose a response and a verifiable acceptance gate.
An expired lease holder still writes — implementation review
Worker A pauses past lease expiry; worker B acquires lease; A resumes and commits. Implementation review: choose a response and a verifiable acceptance gate.
A saga compensation cannot undo a delivered effect — implementation review
External delivery has completed; rollback step only deletes the local request row. Implementation review: choose a response and a verifiable acceptance gate.
Outbox replay repeats a downstream effect — implementation review
Publisher restarts after send but before marking delivered; event is sent again. Implementation review: choose a response and a verifiable acceptance gate.
An idempotency key is reused for a different request — implementation review
Same key appears with changed amount or target; server returns the old result. Implementation review: choose a response and a verifiable acceptance gate.
An unbounded queue turns overload into memory failure — implementation review
Arrival rate exceeds service rate for 20 minutes; queued objects grow until OOM. Implementation review: choose a response and a verifiable acceptance gate.
Half-open circuit breakers create a probe storm — implementation review
Every replica opens its breaker then sends 50 trial calls at the same time. Implementation review: choose a response and a verifiable acceptance gate.
Configuration reload combines incompatible versions — implementation review
One cache reads config v7 while another reads v8; requests mix routing and validation rules. Implementation review: choose a response and a verifiable acceptance gate.
Capacity planning ignores fan-out — implementation review
The design admits 500 requests per second and each starts 12 database operations. Implementation review: choose a response and a verifiable acceptance gate.
A modular monolith becomes a distributed monolith — implementation review
Five services deploy independently but each request needs all five available. Implementation review: choose a response and a verifiable acceptance gate.
Read replicas violate read-after-write expectations — implementation review
A user updates a profile then reads from a lagging replica and sees the old version. Implementation review: choose a response and a verifiable acceptance gate.
CQRS adds an untracked lag window — implementation review
Commands succeed but the projection is delayed and the UI reports the item missing. Implementation review: choose a response and a verifiable acceptance gate.
Event sourcing loses replay compatibility — implementation review
An old event lacks a field now treated as mandatory by the new projection. Implementation review: choose a response and a verifiable acceptance gate.
A saga compensates an irreversible action incorrectly — implementation review
A shipment has left the warehouse but compensation only removes its local row. Implementation review: choose a response and a verifiable acceptance gate.
Active-active writes create conflicting ownership — implementation review
Two regions accept changes to the same entity while replication is partitioned. Implementation review: choose a response and a verifiable acceptance gate.
Sharding creates a hot tenant — implementation review
One tenant owns 60 percent of requests and all its records map to one shard. Implementation review: choose a response and a verifiable acceptance gate.
Strangler migration routes one operation twice — implementation review
Old and new services both receive a write during routing cutover. Implementation review: choose a response and a verifiable acceptance gate.
Dual writes drift during a schema migration — implementation review
Old store commits while the new store fails; retry changes only the new representation. Implementation review: choose a response and a verifiable acceptance gate.
An ADR lacks its decision trigger — implementation review
A team chooses a broker without documenting throughput, ordering or recovery needs. Implementation review: choose a response and a verifiable acceptance gate.
Multi-tenancy lacks a noisy-neighbor budget — implementation review
One tenant consumes every worker and unrelated tenants time out. Implementation review: choose a response and a verifiable acceptance gate.
An asynchronous API has no completion contract — implementation review
POST returns 202 but no status URL or durable operation identity is stored. Implementation review: choose a response and a verifiable acceptance gate.
Backup success does not prove recovery — implementation review
Backup jobs report success but no restore has been attempted with the required keys. Implementation review: choose a response and a verifiable acceptance gate.
Build-versus-buy ignores exit costs — implementation review
A service depends on provider-specific identity and data formats with no export proof. Implementation review: choose a response and a verifiable acceptance gate.
Cross-service queries leak domain ownership — implementation review
A reporting feature directly joins several services' private database tables. Implementation review: choose a response and a verifiable acceptance gate.
An expired lease holder still writes — recovery exercise
Worker A pauses past lease expiry; worker B acquires lease; A resumes and commits. Recovery exercise: choose a response and a verifiable acceptance gate.
A saga compensation cannot undo a delivered effect — recovery exercise
External delivery has completed; rollback step only deletes the local request row. Recovery exercise: choose a response and a verifiable acceptance gate.
Outbox replay repeats a downstream effect — recovery exercise
Publisher restarts after send but before marking delivered; event is sent again. Recovery exercise: choose a response and a verifiable acceptance gate.
An idempotency key is reused for a different request — recovery exercise
Same key appears with changed amount or target; server returns the old result. Recovery exercise: choose a response and a verifiable acceptance gate.
An unbounded queue turns overload into memory failure — recovery exercise
Arrival rate exceeds service rate for 20 minutes; queued objects grow until OOM. Recovery exercise: choose a response and a verifiable acceptance gate.
Half-open circuit breakers create a probe storm — recovery exercise
Every replica opens its breaker then sends 50 trial calls at the same time. Recovery exercise: choose a response and a verifiable acceptance gate.
Configuration reload combines incompatible versions — recovery exercise
One cache reads config v7 while another reads v8; requests mix routing and validation rules. Recovery exercise: choose a response and a verifiable acceptance gate.
Capacity planning ignores fan-out — recovery exercise
The design admits 500 requests per second and each starts 12 database operations. Recovery exercise: choose a response and a verifiable acceptance gate.
A modular monolith becomes a distributed monolith — recovery exercise
Five services deploy independently but each request needs all five available. Recovery exercise: choose a response and a verifiable acceptance gate.
Read replicas violate read-after-write expectations — recovery exercise
A user updates a profile then reads from a lagging replica and sees the old version. Recovery exercise: choose a response and a verifiable acceptance gate.
CQRS adds an untracked lag window — recovery exercise
Commands succeed but the projection is delayed and the UI reports the item missing. Recovery exercise: choose a response and a verifiable acceptance gate.
Event sourcing loses replay compatibility — recovery exercise
An old event lacks a field now treated as mandatory by the new projection. Recovery exercise: choose a response and a verifiable acceptance gate.
A saga compensates an irreversible action incorrectly — recovery exercise
A shipment has left the warehouse but compensation only removes its local row. Recovery exercise: choose a response and a verifiable acceptance gate.
Active-active writes create conflicting ownership — recovery exercise
Two regions accept changes to the same entity while replication is partitioned. Recovery exercise: choose a response and a verifiable acceptance gate.
Sharding creates a hot tenant — recovery exercise
One tenant owns 60 percent of requests and all its records map to one shard. Recovery exercise: choose a response and a verifiable acceptance gate.
Strangler migration routes one operation twice — recovery exercise
Old and new services both receive a write during routing cutover. Recovery exercise: choose a response and a verifiable acceptance gate.
Dual writes drift during a schema migration — recovery exercise
Old store commits while the new store fails; retry changes only the new representation. Recovery exercise: choose a response and a verifiable acceptance gate.
An ADR lacks its decision trigger — recovery exercise
A team chooses a broker without documenting throughput, ordering or recovery needs. Recovery exercise: choose a response and a verifiable acceptance gate.
Multi-tenancy lacks a noisy-neighbor budget — recovery exercise
One tenant consumes every worker and unrelated tenants time out. Recovery exercise: choose a response and a verifiable acceptance gate.
An asynchronous API has no completion contract — recovery exercise
POST returns 202 but no status URL or durable operation identity is stored. Recovery exercise: choose a response and a verifiable acceptance gate.
Backup success does not prove recovery — recovery exercise
Backup jobs report success but no restore has been attempted with the required keys. Recovery exercise: choose a response and a verifiable acceptance gate.
Build-versus-buy ignores exit costs — recovery exercise
A service depends on provider-specific identity and data formats with no export proof. Recovery exercise: choose a response and a verifiable acceptance gate.
Cross-service queries leak domain ownership — recovery exercise
A reporting feature directly joins several services' private database tables. Recovery exercise: choose a response and a verifiable acceptance gate.
An expired lease holder still writes — architecture trade-off
Worker A pauses past lease expiry; worker B acquires lease; A resumes and commits. Architecture trade-off: choose a response and a verifiable acceptance gate.
A saga compensation cannot undo a delivered effect — architecture trade-off
External delivery has completed; rollback step only deletes the local request row. Architecture trade-off: choose a response and a verifiable acceptance gate.
Outbox replay repeats a downstream effect — architecture trade-off
Publisher restarts after send but before marking delivered; event is sent again. Architecture trade-off: choose a response and a verifiable acceptance gate.
An idempotency key is reused for a different request — architecture trade-off
Same key appears with changed amount or target; server returns the old result. Architecture trade-off: choose a response and a verifiable acceptance gate.
An unbounded queue turns overload into memory failure — architecture trade-off
Arrival rate exceeds service rate for 20 minutes; queued objects grow until OOM. Architecture trade-off: choose a response and a verifiable acceptance gate.
Half-open circuit breakers create a probe storm — architecture trade-off
Every replica opens its breaker then sends 50 trial calls at the same time. Architecture trade-off: choose a response and a verifiable acceptance gate.
Configuration reload combines incompatible versions — architecture trade-off
One cache reads config v7 while another reads v8; requests mix routing and validation rules. Architecture trade-off: choose a response and a verifiable acceptance gate.
Capacity planning ignores fan-out — architecture trade-off
The design admits 500 requests per second and each starts 12 database operations. Architecture trade-off: choose a response and a verifiable acceptance gate.
A modular monolith becomes a distributed monolith — architecture trade-off
Five services deploy independently but each request needs all five available. Architecture trade-off: choose a response and a verifiable acceptance gate.
Read replicas violate read-after-write expectations — architecture trade-off
A user updates a profile then reads from a lagging replica and sees the old version. Architecture trade-off: choose a response and a verifiable acceptance gate.
CQRS adds an untracked lag window — architecture trade-off
Commands succeed but the projection is delayed and the UI reports the item missing. Architecture trade-off: choose a response and a verifiable acceptance gate.
Testing & quality · 80 scenarios
The release uses a stale dependency cache
CI cache restores dependencies from a different lockfile; release behavior differs from a clean install. Incident investigation: choose a response and a verifiable acceptance gate.
The rollback cannot read new rows
New release writes a new required enum value; old code fails immediately after rollback. Incident investigation: choose a response and a verifiable acceptance gate.
The feature flag differs across request steps
One workflow evaluates a mutable flag twice and mixes old and new business behavior. Incident investigation: choose a response and a verifiable acceptance gate.
The migration runs on every replica
Every starting replica executes the same non-idempotent schema migration concurrently. Incident investigation: choose a response and a verifiable acceptance gate.
The build reads an uncommitted file
Developer's build uses a local config ignored by Git; CI produces a different artifact. Incident investigation: choose a response and a verifiable acceptance gate.
The canary gets only easy traffic
Canary receives health checks and low-risk users; large-tenant requests remain on the old version. Incident investigation: choose a response and a verifiable acceptance gate.
The deployment passes before assets upload
Backend references a new asset hash while upload is still incomplete; clients receive missing scripts. Incident investigation: choose a response and a verifiable acceptance gate.
The database backup was never restored
Backups report success; the first restore attempt reveals missing encryption-key access. Incident investigation: choose a response and a verifiable acceptance gate.
The smoke test uses an admin account
Admin smoke tests pass while ordinary purchasers cannot access their paid content. Incident investigation: choose a response and a verifiable acceptance gate.
The rollback switches code but not config
Old binary restarts with renamed required variables from the new release and cannot initialize. Incident investigation: choose a response and a verifiable acceptance gate.
The secret is embedded in the frontend build
A build-time variable is bundled into public JavaScript; the app treats it as a server credential. Incident investigation: choose a response and a verifiable acceptance gate.
The artifact changes after approval
Release job rebuilds from a moving branch after tests; deployed bytes differ from tested bytes. Incident investigation: choose a response and a verifiable acceptance gate.
The dependency outage blocks every deployment
Build fetches an unpinned remote script that becomes unavailable or changes behavior. Incident investigation: choose a response and a verifiable acceptance gate.
A mocked repository hides a uniqueness race
Unit tests return an empty lookup for both requests; production inserts conflict. Incident investigation: choose a response and a verifiable acceptance gate.
Transactional tests never exercise commit behavior
A test rolls back automatically and never observes a deferred constraint checked at commit. Incident investigation: choose a response and a verifiable acceptance gate.
An H2 test masks PostgreSQL behavior
A query passes in H2 but production PostgreSQL rejects its syntax or type inference. Incident investigation: choose a response and a verifiable acceptance gate.
Sleep-based concurrency tests pass by chance
A test sleeps 50 ms before asserting while worker scheduling varies across runs. Incident investigation: choose a response and a verifiable acceptance gate.
A property test only checks one example
The test is named propertyBased but asserts one fixed input. Incident investigation: choose a response and a verifiable acceptance gate.
A contract test accepts breaking nulls
Schema tests check field names but not a new null value in a formerly required field. Incident investigation: choose a response and a verifiable acceptance gate.
Performance tests hide a growing backlog
The generator waits for every response before sending the next request. Incident investigation: choose a response and a verifiable acceptance gate.
Assertions ignore business effects
A payment test asserts HTTP 200 while two ledger rows are written. Incident investigation: choose a response and a verifiable acceptance gate.
A fault test fails before the important window
The stub always fails before sending; it never loses a response after remote commit. Incident investigation: choose a response and a verifiable acceptance gate.
Mutation testing reveals a missing rejection assertion
Removing an ownership check leaves the test suite green. Incident investigation: choose a response and a verifiable acceptance gate.
Test fixtures couple independent cases
One test changes a shared static fixture and the next assumes its old state. Incident investigation: choose a response and a verifiable acceptance gate.
An equality assertion skips ordering semantics
A pagination test compares a set of IDs although the API promises a stable order. Incident investigation: choose a response and a verifiable acceptance gate.
Clock-based tests fail near midnight
The test reads the real clock separately for setup and assertion. Incident investigation: choose a response and a verifiable acceptance gate.
A retry test never checks attempt count
The final result is correct but the handler made 30 calls for one request. Incident investigation: choose a response and a verifiable acceptance gate.
Generated test data violates the intended domain
Random monetary inputs include NaN and unsupported currencies without categorization. Incident investigation: choose a response and a verifiable acceptance gate.
Containerized integration tests reuse dirty state
A reused database container retains rows from a prior failed run. Incident investigation: choose a response and a verifiable acceptance gate.
An exception test accepts any failure
assertThrows(Exception.class) passes because of a null pointer before validation. Incident investigation: choose a response and a verifiable acceptance gate.
Security tests exercise only the browser
The UI hides an admin field but a direct API call can still set it. Incident investigation: choose a response and a verifiable acceptance gate.
A canary compares traffic with different mixes
The canary handles only cache-hit reads while baseline serves expensive writes. Incident investigation: choose a response and a verifiable acceptance gate.
A flaky test quarantine has no owner
A failing concurrency test is skipped indefinitely and the same race reaches production. Incident investigation: choose a response and a verifiable acceptance gate.
The release uses a stale dependency cache — implementation review
CI cache restores dependencies from a different lockfile; release behavior differs from a clean install. Implementation review: choose a response and a verifiable acceptance gate.
The rollback cannot read new rows — implementation review
New release writes a new required enum value; old code fails immediately after rollback. Implementation review: choose a response and a verifiable acceptance gate.
The feature flag differs across request steps — implementation review
One workflow evaluates a mutable flag twice and mixes old and new business behavior. Implementation review: choose a response and a verifiable acceptance gate.
The migration runs on every replica — implementation review
Every starting replica executes the same non-idempotent schema migration concurrently. Implementation review: choose a response and a verifiable acceptance gate.
The build reads an uncommitted file — implementation review
Developer's build uses a local config ignored by Git; CI produces a different artifact. Implementation review: choose a response and a verifiable acceptance gate.
The canary gets only easy traffic — implementation review
Canary receives health checks and low-risk users; large-tenant requests remain on the old version. Implementation review: choose a response and a verifiable acceptance gate.
The deployment passes before assets upload — implementation review
Backend references a new asset hash while upload is still incomplete; clients receive missing scripts. Implementation review: choose a response and a verifiable acceptance gate.
The database backup was never restored — implementation review
Backups report success; the first restore attempt reveals missing encryption-key access. Implementation review: choose a response and a verifiable acceptance gate.
The smoke test uses an admin account — implementation review
Admin smoke tests pass while ordinary purchasers cannot access their paid content. Implementation review: choose a response and a verifiable acceptance gate.
The rollback switches code but not config — implementation review
Old binary restarts with renamed required variables from the new release and cannot initialize. Implementation review: choose a response and a verifiable acceptance gate.
The secret is embedded in the frontend build — implementation review
A build-time variable is bundled into public JavaScript; the app treats it as a server credential. Implementation review: choose a response and a verifiable acceptance gate.
The artifact changes after approval — implementation review
Release job rebuilds from a moving branch after tests; deployed bytes differ from tested bytes. Implementation review: choose a response and a verifiable acceptance gate.
The dependency outage blocks every deployment — implementation review
Build fetches an unpinned remote script that becomes unavailable or changes behavior. Implementation review: choose a response and a verifiable acceptance gate.
A mocked repository hides a uniqueness race — implementation review
Unit tests return an empty lookup for both requests; production inserts conflict. Implementation review: choose a response and a verifiable acceptance gate.
Transactional tests never exercise commit behavior — implementation review
A test rolls back automatically and never observes a deferred constraint checked at commit. Implementation review: choose a response and a verifiable acceptance gate.
An H2 test masks PostgreSQL behavior — implementation review
A query passes in H2 but production PostgreSQL rejects its syntax or type inference. Implementation review: choose a response and a verifiable acceptance gate.
Sleep-based concurrency tests pass by chance — implementation review
A test sleeps 50 ms before asserting while worker scheduling varies across runs. Implementation review: choose a response and a verifiable acceptance gate.
A property test only checks one example — implementation review
The test is named propertyBased but asserts one fixed input. Implementation review: choose a response and a verifiable acceptance gate.
A contract test accepts breaking nulls — implementation review
Schema tests check field names but not a new null value in a formerly required field. Implementation review: choose a response and a verifiable acceptance gate.
Performance tests hide a growing backlog — implementation review
The generator waits for every response before sending the next request. Implementation review: choose a response and a verifiable acceptance gate.
Assertions ignore business effects — implementation review
A payment test asserts HTTP 200 while two ledger rows are written. Implementation review: choose a response and a verifiable acceptance gate.
A fault test fails before the important window — implementation review
The stub always fails before sending; it never loses a response after remote commit. Implementation review: choose a response and a verifiable acceptance gate.
Mutation testing reveals a missing rejection assertion — implementation review
Removing an ownership check leaves the test suite green. Implementation review: choose a response and a verifiable acceptance gate.
Test fixtures couple independent cases — implementation review
One test changes a shared static fixture and the next assumes its old state. Implementation review: choose a response and a verifiable acceptance gate.
An equality assertion skips ordering semantics — implementation review
A pagination test compares a set of IDs although the API promises a stable order. Implementation review: choose a response and a verifiable acceptance gate.
Clock-based tests fail near midnight — implementation review
The test reads the real clock separately for setup and assertion. Implementation review: choose a response and a verifiable acceptance gate.
A retry test never checks attempt count — implementation review
The final result is correct but the handler made 30 calls for one request. Implementation review: choose a response and a verifiable acceptance gate.
Generated test data violates the intended domain — implementation review
Random monetary inputs include NaN and unsupported currencies without categorization. Implementation review: choose a response and a verifiable acceptance gate.
Containerized integration tests reuse dirty state — implementation review
A reused database container retains rows from a prior failed run. Implementation review: choose a response and a verifiable acceptance gate.
An exception test accepts any failure — implementation review
assertThrows(Exception.class) passes because of a null pointer before validation. Implementation review: choose a response and a verifiable acceptance gate.
Security tests exercise only the browser — implementation review
The UI hides an admin field but a direct API call can still set it. Implementation review: choose a response and a verifiable acceptance gate.
A canary compares traffic with different mixes — implementation review
The canary handles only cache-hit reads while baseline serves expensive writes. Implementation review: choose a response and a verifiable acceptance gate.
A flaky test quarantine has no owner — implementation review
A failing concurrency test is skipped indefinitely and the same race reaches production. Implementation review: choose a response and a verifiable acceptance gate.
The release uses a stale dependency cache — recovery exercise
CI cache restores dependencies from a different lockfile; release behavior differs from a clean install. Recovery exercise: choose a response and a verifiable acceptance gate.
The rollback cannot read new rows — recovery exercise
New release writes a new required enum value; old code fails immediately after rollback. Recovery exercise: choose a response and a verifiable acceptance gate.
The feature flag differs across request steps — recovery exercise
One workflow evaluates a mutable flag twice and mixes old and new business behavior. Recovery exercise: choose a response and a verifiable acceptance gate.
The migration runs on every replica — recovery exercise
Every starting replica executes the same non-idempotent schema migration concurrently. Recovery exercise: choose a response and a verifiable acceptance gate.
The build reads an uncommitted file — recovery exercise
Developer's build uses a local config ignored by Git; CI produces a different artifact. Recovery exercise: choose a response and a verifiable acceptance gate.
The canary gets only easy traffic — recovery exercise
Canary receives health checks and low-risk users; large-tenant requests remain on the old version. Recovery exercise: choose a response and a verifiable acceptance gate.
The deployment passes before assets upload — recovery exercise
Backend references a new asset hash while upload is still incomplete; clients receive missing scripts. Recovery exercise: choose a response and a verifiable acceptance gate.
The database backup was never restored — recovery exercise
Backups report success; the first restore attempt reveals missing encryption-key access. Recovery exercise: choose a response and a verifiable acceptance gate.
The smoke test uses an admin account — recovery exercise
Admin smoke tests pass while ordinary purchasers cannot access their paid content. Recovery exercise: choose a response and a verifiable acceptance gate.
The rollback switches code but not config — recovery exercise
Old binary restarts with renamed required variables from the new release and cannot initialize. Recovery exercise: choose a response and a verifiable acceptance gate.
The secret is embedded in the frontend build — recovery exercise
A build-time variable is bundled into public JavaScript; the app treats it as a server credential. Recovery exercise: choose a response and a verifiable acceptance gate.
The artifact changes after approval — recovery exercise
Release job rebuilds from a moving branch after tests; deployed bytes differ from tested bytes. Recovery exercise: choose a response and a verifiable acceptance gate.
The dependency outage blocks every deployment — recovery exercise
Build fetches an unpinned remote script that becomes unavailable or changes behavior. Recovery exercise: choose a response and a verifiable acceptance gate.
A mocked repository hides a uniqueness race — recovery exercise
Unit tests return an empty lookup for both requests; production inserts conflict. Recovery exercise: choose a response and a verifiable acceptance gate.
Cloud & delivery · 56 scenarios
The rollout kills in-flight requests
Pod receives termination; process exits immediately while requests are still running. Incident investigation: choose a response and a verifiable acceptance gate.
The liveness probe causes a restart loop
A temporary database outage makes liveness fail; every pod restarts and repeats cold startup. Incident investigation: choose a response and a verifiable acceptance gate.
The process exits below its heap limit
Container is OOM-killed while Java heap usage is below Xmx; native buffers and threads consume the rest. Incident investigation: choose a response and a verifiable acceptance gate.
The CPU limit creates latency spikes
CPU throttling rises during bursts although node-wide CPU looks available. Incident investigation: choose a response and a verifiable acceptance gate.
The readiness check warms too late
Pod enters service before required caches or migrations are ready; first requests fail. Incident investigation: choose a response and a verifiable acceptance gate.
The temporary disk fills the node
Application writes uploads to ephemeral storage without cleanup; eviction affects unrelated pods. Incident investigation: choose a response and a verifiable acceptance gate.
The secret changes but the process does not
Mounted secret rotates; application reads it only once at startup and keeps the old value. Incident investigation: choose a response and a verifiable acceptance gate.
The autoscaler ignores queue age
CPU is low while workers wait on I/O; queue age grows and CPU-based scaling never triggers. Incident investigation: choose a response and a verifiable acceptance gate.
The local file disappears on reschedule
A user upload is stored in the container filesystem; pod replacement removes the only copy. Incident investigation: choose a response and a verifiable acceptance gate.
The image tag changes under the rollout
A mutable tag points to different builds; nominally identical replicas run different code. Incident investigation: choose a response and a verifiable acceptance gate.
The job overlaps its previous run
Scheduled import takes longer than its interval; multiple jobs update the same records. Incident investigation: choose a response and a verifiable acceptance gate.
The service listens only on loopback
Container process starts successfully; peer probes cannot reach a socket bound only to localhost. Incident investigation: choose a response and a verifiable acceptance gate.
The graceful shutdown waits forever
Worker drain has no deadline; termination eventually kills it midway through an unknown operation. Incident investigation: choose a response and a verifiable acceptance gate.
A workload role can modify unrelated resources
Policy grants service:* on resource * although the workload uses one queue. Incident investigation: choose a response and a verifiable acceptance gate.
Object lifecycle removes source files before processing
Objects expire after one day; backlog age reaches 30 hours; consumers see missing keys. Incident investigation: choose a response and a verifiable acceptance gate.
Regional failover still sends traffic to an unhealthy endpoint
DNS record changes but clients use a cached address; the old region still receives requests. Incident investigation: choose a response and a verifiable acceptance gate.
Outbound requests exhaust NAT ports
Many new TCP connections target one host; NAT reports port allocation errors. Incident investigation: choose a response and a verifiable acceptance gate.
Private-network calls fail TLS hostname validation
Client uses an internal IP; certificate names the service DNS endpoint. Incident investigation: choose a response and a verifiable acceptance gate.
Function retries repeat an irreversible action
Invocation returns timeout after the external operation succeeds; provider retries the event. Incident investigation: choose a response and a verifiable acceptance gate.
Object notifications arrive out of order
Update version 12 is processed before version 11; projection is overwritten with older data. Incident investigation: choose a response and a verifiable acceptance gate.
A CDN caches an authenticated response for everyone
Cache key includes path only; user beta gets user alpha's response with a cache hit. Incident investigation: choose a response and a verifiable acceptance gate.
Monitoring cost explodes with per-request dimensions
Every request ID becomes a metric dimension; series count grows with traffic volume. Incident investigation: choose a response and a verifiable acceptance gate.
Managed identity tokens target the wrong resource
Token acquisition succeeds; downstream rejects audience intended for a different API. Incident investigation: choose a response and a verifiable acceptance gate.
Pub/Sub messages are redelivered during long processing
Handler duration exceeds ack deadline; delivery attempt increases while work is still active. Incident investigation: choose a response and a verifiable acceptance gate.
Readiness depends on an unrelated external service
Every pod becomes unready during an optional analytics outage although core requests can succeed. Incident investigation: choose a response and a verifiable acceptance gate.
Liveness restarts pods during database trouble
Database latency rises; liveness calls the database; pods restart repeatedly. Incident investigation: choose a response and a verifiable acceptance gate.
CPU limits throttle otherwise healthy requests
Container CPU throttled seconds rise; node has spare CPU; request p99 jumps. Incident investigation: choose a response and a verifiable acceptance gate.
Native memory causes a container OOM
Heap remains below Xmx; container RSS reaches its limit and exit code is 137. Incident investigation: choose a response and a verifiable acceptance gate.
Autoscaling uses stale metrics
HPA metrics timestamp is 12 minutes old; load rises but replicas do not change. Incident investigation: choose a response and a verifiable acceptance gate.
A disruption budget blocks a planned node drain
One replica is available; PDB requires one available; drain cannot evict it. Incident investigation: choose a response and a verifiable acceptance gate.
Replicas concentrate in one failure zone
All ready replicas run in zone A; zone B has capacity but scheduling constraints are incomplete. Incident investigation: choose a response and a verifiable acceptance gate.
Shutdown drops in-flight requests
SIGTERM closes the process immediately; ingress still has active requests. Incident investigation: choose a response and a verifiable acceptance gate.
An application rollback cannot read the migrated schema
New release drops a column; old binary restored during rollback still queries it. Incident investigation: choose a response and a verifiable acceptance gate.
A proxy sidecar exits before the main worker drains
Main container tries to finalize requests after sidecar network proxy has exited. Incident investigation: choose a response and a verifiable acceptance gate.
Sampling hides the rare error path
Error rate is 0.1%; uniform 1% sampling retains no examples in the inspection window. Incident investigation: choose a response and a verifiable acceptance gate.
High-cardinality labels saturate monitoring
Metric label includes object ID; active series rises by one for each new object. Incident investigation: choose a response and a verifiable acceptance gate.
The rollout kills in-flight requests — implementation review
Pod receives termination; process exits immediately while requests are still running. Implementation review: choose a response and a verifiable acceptance gate.
The liveness probe causes a restart loop — implementation review
A temporary database outage makes liveness fail; every pod restarts and repeats cold startup. Implementation review: choose a response and a verifiable acceptance gate.
The process exits below its heap limit — implementation review
Container is OOM-killed while Java heap usage is below Xmx; native buffers and threads consume the rest. Implementation review: choose a response and a verifiable acceptance gate.
The CPU limit creates latency spikes — implementation review
CPU throttling rises during bursts although node-wide CPU looks available. Implementation review: choose a response and a verifiable acceptance gate.
The readiness check warms too late — implementation review
Pod enters service before required caches or migrations are ready; first requests fail. Implementation review: choose a response and a verifiable acceptance gate.
The temporary disk fills the node — implementation review
Application writes uploads to ephemeral storage without cleanup; eviction affects unrelated pods. Implementation review: choose a response and a verifiable acceptance gate.
The secret changes but the process does not — implementation review
Mounted secret rotates; application reads it only once at startup and keeps the old value. Implementation review: choose a response and a verifiable acceptance gate.
The autoscaler ignores queue age — implementation review
CPU is low while workers wait on I/O; queue age grows and CPU-based scaling never triggers. Implementation review: choose a response and a verifiable acceptance gate.
The local file disappears on reschedule — implementation review
A user upload is stored in the container filesystem; pod replacement removes the only copy. Implementation review: choose a response and a verifiable acceptance gate.
The image tag changes under the rollout — implementation review
A mutable tag points to different builds; nominally identical replicas run different code. Implementation review: choose a response and a verifiable acceptance gate.
The job overlaps its previous run — implementation review
Scheduled import takes longer than its interval; multiple jobs update the same records. Implementation review: choose a response and a verifiable acceptance gate.
The service listens only on loopback — implementation review
Container process starts successfully; peer probes cannot reach a socket bound only to localhost. Implementation review: choose a response and a verifiable acceptance gate.
The graceful shutdown waits forever — implementation review
Worker drain has no deadline; termination eventually kills it midway through an unknown operation. Implementation review: choose a response and a verifiable acceptance gate.
A workload role can modify unrelated resources — implementation review
Policy grants service:* on resource * although the workload uses one queue. Implementation review: choose a response and a verifiable acceptance gate.
Object lifecycle removes source files before processing — implementation review
Objects expire after one day; backlog age reaches 30 hours; consumers see missing keys. Implementation review: choose a response and a verifiable acceptance gate.
Regional failover still sends traffic to an unhealthy endpoint — implementation review
DNS record changes but clients use a cached address; the old region still receives requests. Implementation review: choose a response and a verifiable acceptance gate.
Outbound requests exhaust NAT ports — implementation review
Many new TCP connections target one host; NAT reports port allocation errors. Implementation review: choose a response and a verifiable acceptance gate.
Private-network calls fail TLS hostname validation — implementation review
Client uses an internal IP; certificate names the service DNS endpoint. Implementation review: choose a response and a verifiable acceptance gate.
Function retries repeat an irreversible action — implementation review
Invocation returns timeout after the external operation succeeds; provider retries the event. Implementation review: choose a response and a verifiable acceptance gate.
Object notifications arrive out of order — implementation review
Update version 12 is processed before version 11; projection is overwritten with older data. Implementation review: choose a response and a verifiable acceptance gate.
Observability & reliability · 40 scenarios
The average hides the slow customers
Mean latency stays low while a small group experiences multi-second responses. Incident investigation: choose a response and a verifiable acceptance gate.
The dashboard mixes seconds and milliseconds
New exporter reports seconds; old panel labels and thresholds still assume milliseconds. Incident investigation: choose a response and a verifiable acceptance gate.
The error rate uses the wrong denominator
Panel divides failing requests by successful requests rather than total completed requests. Incident investigation: choose a response and a verifiable acceptance gate.
The trace ends at the queue
HTTP spans stop before publication; the consumer starts an unrelated trace with no message correlation. Incident investigation: choose a response and a verifiable acceptance gate.
The request ID becomes a metric label
Each request adds a unique ID label; time-series count grows with traffic. Incident investigation: choose a response and a verifiable acceptance gate.
The alert never fires during no traffic
Query returns no series when the service stops emitting; threshold comparison evaluates nothing. Incident investigation: choose a response and a verifiable acceptance gate.
The logs cannot establish ordering
Concurrent services log local timestamps without trace or operation identity. Incident investigation: choose a response and a verifiable acceptance gate.
The sampler drops every rare failure
Sampling happens before the eventual error is known; low-rate failures rarely have retained traces. Incident investigation: choose a response and a verifiable acceptance gate.
The latency excludes queued time
Timer starts when a worker begins; users wait seconds in the queue that the metric omits. Incident investigation: choose a response and a verifiable acceptance gate.
The deployment label never changes
New pods inherit an old release label; incident graphs appear to blame the previous build. Incident investigation: choose a response and a verifiable acceptance gate.
The counter drops after restart
A dashboard subtracts raw counter values across restarts and reports negative throughput. Incident investigation: choose a response and a verifiable acceptance gate.
The health check says only process alive
A service returns healthy while its required database connection is unusable. Incident investigation: choose a response and a verifiable acceptance gate.
The successful HTTP status hides failed jobs
API returns accepted; workers fail later, but all monitoring counts only HTTP success. Incident investigation: choose a response and a verifiable acceptance gate.
The average hides the slow customers — implementation review
Mean latency stays low while a small group experiences multi-second responses. Implementation review: choose a response and a verifiable acceptance gate.
The dashboard mixes seconds and milliseconds — implementation review
New exporter reports seconds; old panel labels and thresholds still assume milliseconds. Implementation review: choose a response and a verifiable acceptance gate.
The error rate uses the wrong denominator — implementation review
Panel divides failing requests by successful requests rather than total completed requests. Implementation review: choose a response and a verifiable acceptance gate.
The trace ends at the queue — implementation review
HTTP spans stop before publication; the consumer starts an unrelated trace with no message correlation. Implementation review: choose a response and a verifiable acceptance gate.
The request ID becomes a metric label — implementation review
Each request adds a unique ID label; time-series count grows with traffic. Implementation review: choose a response and a verifiable acceptance gate.
The alert never fires during no traffic — implementation review
Query returns no series when the service stops emitting; threshold comparison evaluates nothing. Implementation review: choose a response and a verifiable acceptance gate.
The logs cannot establish ordering — implementation review
Concurrent services log local timestamps without trace or operation identity. Implementation review: choose a response and a verifiable acceptance gate.
The sampler drops every rare failure — implementation review
Sampling happens before the eventual error is known; low-rate failures rarely have retained traces. Implementation review: choose a response and a verifiable acceptance gate.
The latency excludes queued time — implementation review
Timer starts when a worker begins; users wait seconds in the queue that the metric omits. Implementation review: choose a response and a verifiable acceptance gate.
The deployment label never changes — implementation review
New pods inherit an old release label; incident graphs appear to blame the previous build. Implementation review: choose a response and a verifiable acceptance gate.
The counter drops after restart — implementation review
A dashboard subtracts raw counter values across restarts and reports negative throughput. Implementation review: choose a response and a verifiable acceptance gate.
The health check says only process alive — implementation review
A service returns healthy while its required database connection is unusable. Implementation review: choose a response and a verifiable acceptance gate.
The successful HTTP status hides failed jobs — implementation review
API returns accepted; workers fail later, but all monitoring counts only HTTP success. Implementation review: choose a response and a verifiable acceptance gate.
The average hides the slow customers — recovery exercise
Mean latency stays low while a small group experiences multi-second responses. Recovery exercise: choose a response and a verifiable acceptance gate.
The dashboard mixes seconds and milliseconds — recovery exercise
New exporter reports seconds; old panel labels and thresholds still assume milliseconds. Recovery exercise: choose a response and a verifiable acceptance gate.
The error rate uses the wrong denominator — recovery exercise
Panel divides failing requests by successful requests rather than total completed requests. Recovery exercise: choose a response and a verifiable acceptance gate.
The trace ends at the queue — recovery exercise
HTTP spans stop before publication; the consumer starts an unrelated trace with no message correlation. Recovery exercise: choose a response and a verifiable acceptance gate.
The request ID becomes a metric label — recovery exercise
Each request adds a unique ID label; time-series count grows with traffic. Recovery exercise: choose a response and a verifiable acceptance gate.
The alert never fires during no traffic — recovery exercise
Query returns no series when the service stops emitting; threshold comparison evaluates nothing. Recovery exercise: choose a response and a verifiable acceptance gate.
The logs cannot establish ordering — recovery exercise
Concurrent services log local timestamps without trace or operation identity. Recovery exercise: choose a response and a verifiable acceptance gate.
The sampler drops every rare failure — recovery exercise
Sampling happens before the eventual error is known; low-rate failures rarely have retained traces. Recovery exercise: choose a response and a verifiable acceptance gate.
The latency excludes queued time — recovery exercise
Timer starts when a worker begins; users wait seconds in the queue that the metric omits. Recovery exercise: choose a response and a verifiable acceptance gate.
The deployment label never changes — recovery exercise
New pods inherit an old release label; incident graphs appear to blame the previous build. Recovery exercise: choose a response and a verifiable acceptance gate.
The counter drops after restart — recovery exercise
A dashboard subtracts raw counter values across restarts and reports negative throughput. Recovery exercise: choose a response and a verifiable acceptance gate.
The health check says only process alive — recovery exercise
A service returns healthy while its required database connection is unusable. Recovery exercise: choose a response and a verifiable acceptance gate.
The successful HTTP status hides failed jobs — recovery exercise
API returns accepted; workers fail later, but all monitoring counts only HTTP success. Recovery exercise: choose a response and a verifiable acceptance gate.
The average hides the slow customers — architecture trade-off
Mean latency stays low while a small group experiences multi-second responses. Architecture trade-off: choose a response and a verifiable acceptance gate.
Web & client fundamentals · 32 scenarios
An older response overwrites a newer search
Search A starts before search B but A finishes last and replaces B's results. Incident investigation: choose a response and a verifiable acceptance gate.
Optimistic updates survive a rejected write
The client marks a booking confirmed before POST returns; rejection leaves it confirmed. Incident investigation: choose a response and a verifiable acceptance gate.
An offline retry creates two operations
The client retries a timed-out submit with a fresh operation identity. Incident investigation: choose a response and a verifiable acceptance gate.
Keyboard users cannot dismiss a dialog
Focus escapes the modal and its close control is unreachable by keyboard. Incident investigation: choose a response and a verifiable acceptance gate.
A client stores secrets in localStorage
A long-lived credential is readable by every script executing in the origin. Incident investigation: choose a response and a verifiable acceptance gate.
Error pages erase a completed submit
The client treats a lost response as a failed order and clears the operation ID. Incident investigation: choose a response and a verifiable acceptance gate.
A large table blocks every input
The UI renders thousands of rows synchronously after each keystroke. Incident investigation: choose a response and a verifiable acceptance gate.
Stale authentication leaves the UI misleading
A protected request returns 401 but the client still displays an authenticated purchase state. Incident investigation: choose a response and a verifiable acceptance gate.
An older response overwrites a newer search — implementation review
Search A starts before search B but A finishes last and replaces B's results. Implementation review: choose a response and a verifiable acceptance gate.
Optimistic updates survive a rejected write — implementation review
The client marks a booking confirmed before POST returns; rejection leaves it confirmed. Implementation review: choose a response and a verifiable acceptance gate.
An offline retry creates two operations — implementation review
The client retries a timed-out submit with a fresh operation identity. Implementation review: choose a response and a verifiable acceptance gate.
Keyboard users cannot dismiss a dialog — implementation review
Focus escapes the modal and its close control is unreachable by keyboard. Implementation review: choose a response and a verifiable acceptance gate.
A client stores secrets in localStorage — implementation review
A long-lived credential is readable by every script executing in the origin. Implementation review: choose a response and a verifiable acceptance gate.
Error pages erase a completed submit — implementation review
The client treats a lost response as a failed order and clears the operation ID. Implementation review: choose a response and a verifiable acceptance gate.
A large table blocks every input — implementation review
The UI renders thousands of rows synchronously after each keystroke. Implementation review: choose a response and a verifiable acceptance gate.
Stale authentication leaves the UI misleading — implementation review
A protected request returns 401 but the client still displays an authenticated purchase state. Implementation review: choose a response and a verifiable acceptance gate.
An older response overwrites a newer search — recovery exercise
Search A starts before search B but A finishes last and replaces B's results. Recovery exercise: choose a response and a verifiable acceptance gate.
Optimistic updates survive a rejected write — recovery exercise
The client marks a booking confirmed before POST returns; rejection leaves it confirmed. Recovery exercise: choose a response and a verifiable acceptance gate.
An offline retry creates two operations — recovery exercise
The client retries a timed-out submit with a fresh operation identity. Recovery exercise: choose a response and a verifiable acceptance gate.
Keyboard users cannot dismiss a dialog — recovery exercise
Focus escapes the modal and its close control is unreachable by keyboard. Recovery exercise: choose a response and a verifiable acceptance gate.
A client stores secrets in localStorage — recovery exercise
A long-lived credential is readable by every script executing in the origin. Recovery exercise: choose a response and a verifiable acceptance gate.
Error pages erase a completed submit — recovery exercise
The client treats a lost response as a failed order and clears the operation ID. Recovery exercise: choose a response and a verifiable acceptance gate.
A large table blocks every input — recovery exercise
The UI renders thousands of rows synchronously after each keystroke. Recovery exercise: choose a response and a verifiable acceptance gate.
Stale authentication leaves the UI misleading — recovery exercise
A protected request returns 401 but the client still displays an authenticated purchase state. Recovery exercise: choose a response and a verifiable acceptance gate.
An older response overwrites a newer search — architecture trade-off
Search A starts before search B but A finishes last and replaces B's results. Architecture trade-off: choose a response and a verifiable acceptance gate.
Optimistic updates survive a rejected write — architecture trade-off
The client marks a booking confirmed before POST returns; rejection leaves it confirmed. Architecture trade-off: choose a response and a verifiable acceptance gate.
An offline retry creates two operations — architecture trade-off
The client retries a timed-out submit with a fresh operation identity. Architecture trade-off: choose a response and a verifiable acceptance gate.
Keyboard users cannot dismiss a dialog — architecture trade-off
Focus escapes the modal and its close control is unreachable by keyboard. Architecture trade-off: choose a response and a verifiable acceptance gate.
A client stores secrets in localStorage — architecture trade-off
A long-lived credential is readable by every script executing in the origin. Architecture trade-off: choose a response and a verifiable acceptance gate.
Error pages erase a completed submit — architecture trade-off
The client treats a lost response as a failed order and clears the operation ID. Architecture trade-off: choose a response and a verifiable acceptance gate.
A large table blocks every input — architecture trade-off
The UI renders thousands of rows synchronously after each keystroke. Architecture trade-off: choose a response and a verifiable acceptance gate.
Stale authentication leaves the UI misleading — architecture trade-off
A protected request returns 401 but the client still displays an authenticated purchase state. Architecture trade-off: choose a response and a verifiable acceptance gate.
Data integrity & pipelines · 16 scenarios
The money total drifts by cents
Repeated binary floating-point operations produce a total differing from the invoice's decimal rules. Incident investigation: choose a response and a verifiable acceptance gate.
The local time occurs twice
A scheduled transfer uses a local wall-clock time during a daylight-saving fallback and runs twice. Incident investigation: choose a response and a verifiable acceptance gate.
The unique email accepts alternate forms
Application normalizes email for lookup but the uniqueness check uses a different representation. Incident investigation: choose a response and a verifiable acceptance gate.
The CSV import evaluates a formula
Exported user text begins with a spreadsheet formula marker; opening the CSV executes spreadsheet behavior. Incident investigation: choose a response and a verifiable acceptance gate.
The deletion leaves a dangling record
A parent is removed while dependent rows remain; reads fail when dereferencing the missing parent. Incident investigation: choose a response and a verifiable acceptance gate.
The soft-deleted record blocks reuse
A business key is globally unique even though policy allows reuse after soft deletion. Incident investigation: choose a response and a verifiable acceptance gate.
The timezone is discarded at ingestion
Importer strips the supplied offset and stores local text as UTC; event ordering shifts by hours. Incident investigation: choose a response and a verifiable acceptance gate.
The null passes the validation rule
A database CHECK expression evaluates unknown for null; application assumed it also required a value. Incident investigation: choose a response and a verifiable acceptance gate.
The dedup key expires before retries stop
Provider retries old events after local dedup records have been deleted; effects repeat. Incident investigation: choose a response and a verifiable acceptance gate.
The aggregate uses mixed currencies
Report adds numeric amounts across USD and JPY without currency grouping or conversion policy. Incident investigation: choose a response and a verifiable acceptance gate.
The migration truncates historical values
A column is narrowed after checking only recent rows; old values exceed the new limit. Incident investigation: choose a response and a verifiable acceptance gate.
The inventory cannot explain its balance
System stores only current stock and overwrites it for every adjustment; investigation has no durable change history. Incident investigation: choose a response and a verifiable acceptance gate.
The uniqueness rule ignores tenant scope
Database declares username globally unique; valid users in separate tenants conflict. Incident investigation: choose a response and a verifiable acceptance gate.
CDC updates arrive out of order
Projection applies source version 9 after version 10; data regresses. Incident investigation: choose a response and a verifiable acceptance gate.
A stalled replication slot retains WAL
Consumer stopped yesterday; retained WAL grows and disk free space falls. Incident investigation: choose a response and a verifiable acceptance gate.
Replica reads miss a just-committed change
Primary commit succeeds; immediate read from replica returns the old version. Incident investigation: choose a response and a verifiable acceptance gate.
AI integrations · 16 scenarios
Retrieved text overrides assistant instructions
Retrieved document includes “ignore the system rules”; tool audit shows an export request absent from the user prompt. Incident investigation: choose a response and a verifiable acceptance gate.
Vector search leaks another tenant's document
Search uses top_k=8 without a tenant filter; one returned document belongs to tenant beta. Incident investigation: choose a response and a verifiable acceptance gate.
The order assistant can see the wrong customer
A Java support service takes an order number from an agent. Decide which identity its tool may trust.
One agent request opens two support cases
An agent retries after a timeout. Work out how to recover the first result and keep one support case.
Token usage exceeds the tenant budget
One tenant sends 90 parallel requests; budget checks read the same remaining balance. Incident investigation: choose a response and a verifiable acceptance gate.
Context truncation drops an operational constraint
Prompt builder keeps the last 16k tokens; the retention rule was at the beginning and is absent from the final request. Incident investigation: choose a response and a verifiable acceptance gate.
Generated JSON bypasses the schema boundary
Response contains unknown action and numeric owner ID; parser accepts it and schedules work. Incident investigation: choose a response and a verifiable acceptance gate.
A partial model stream is saved as a complete answer
Client disconnects after 340 tokens; stored answer is marked complete without a finish reason. Incident investigation: choose a response and a verifiable acceptance gate.
Evaluation scores hide dataset leakage
Evaluation accuracy is 98%; held-out prompts exactly match examples inserted into the retrieval corpus. Incident investigation: choose a response and a verifiable acceptance gate.
A model upgrade silently changes tool behavior
Canary on a new model version sends 3 tool calls where the pinned version sends 1 for the same request. Incident investigation: choose a response and a verifiable acceptance gate.
New embeddings cannot match the old vector index
Query vector has 1536 dimensions; indexed vectors have 768; migration mixed embedding versions. Incident investigation: choose a response and a verifiable acceptance gate.
Deleted documents remain in retrieval results
Source deletion committed at 10:02; search returns the old chunk at 10:25; indexing watermark is 09:58. Incident investigation: choose a response and a verifiable acceptance gate.
The answer cites a document that was never retrieved
Citation ID doc-999 is absent from the retrieval result; fluent answer still links to it. Incident investigation: choose a response and a verifiable acceptance gate.
Model output injects active markup
Answer includes an image tag with an event handler; UI assigns the answer to innerHTML. Incident investigation: choose a response and a verifiable acceptance gate.
Prompt telemetry stores confidential payloads
Trace storage contains full uploaded document text; support users can search it without document permissions. Incident investigation: choose a response and a verifiable acceptance gate.
An assistant invents a policy exception
Answer approves an exception absent from all retrieved policy passages; confidence text is high. Incident investigation: choose a response and a verifiable acceptance gate.
Java 8 features · 24 scenarios
Parallel stream reduction changes totals
A parallel reduce uses subtraction; results differ from the sequential execution. Incident investigation: choose a response and a verifiable acceptance gate.
Stream reuse fails on the second query
A Java 8 Stream is stored in a field; count runs before collect on the same instance. Incident investigation: choose a response and a verifiable acceptance gate.
A lazy stream runs after its connection closes
A JDBC-backed stream is returned from try-with-resources; its later traversal fails. Incident investigation: choose a response and a verifiable acceptance gate.
Duplicate keys abort a collector
Collectors.toMap encounters two records with the same business key and throws. Incident investigation: choose a response and a verifiable acceptance gate.
Optional fallback runs even when a value exists
orElse calls a costly supplier expression although Optional contains a result. Incident investigation: choose a response and a verifiable acceptance gate.
A lambda captures a mutable holder
A supposedly fixed lambda reads an array element that another request changes. Incident investigation: choose a response and a verifiable acceptance gate.
CompletableFuture fallback hides a domain failure
exceptionally returns an empty order list for a failed authoritative lookup. Incident investigation: choose a response and a verifiable acceptance gate.
thenApply blocks the completion thread
A Java 8 future completes on a small IO executor and thenApply performs a long blocking call. Incident investigation: choose a response and a verifiable acceptance gate.
A parallel collector shares a mutable accumulator
The supplier returns the same ArrayList for all stream partitions. Incident investigation: choose a response and a verifiable acceptance gate.
A default method introduces ambiguous behavior
A class inherits conflicting defaults from two interfaces and cannot compile. Incident investigation: choose a response and a verifiable acceptance gate.
A method reference binds an unintended receiver
A method reference captures one mutable service instance used by multiple request tasks. Incident investigation: choose a response and a verifiable acceptance gate.
Grouping counts retain every source object
groupingBy uses toList when the requirement only needs per-key counts. Incident investigation: choose a response and a verifiable acceptance gate.
LocalDateTime is mistaken for an instant
An event uses LocalDateTime without a zone and becomes ambiguous during a daylight-saving overlap. Incident investigation: choose a response and a verifiable acceptance gate.
Parallel stream reduction changes totals — implementation review
A parallel reduce uses subtraction; results differ from the sequential execution. Implementation review: choose a response and a verifiable acceptance gate.
Stream reuse fails on the second query — implementation review
A Java 8 Stream is stored in a field; count runs before collect on the same instance. Implementation review: choose a response and a verifiable acceptance gate.
A lazy stream runs after its connection closes — implementation review
A JDBC-backed stream is returned from try-with-resources; its later traversal fails. Implementation review: choose a response and a verifiable acceptance gate.
Duplicate keys abort a collector — implementation review
Collectors.toMap encounters two records with the same business key and throws. Implementation review: choose a response and a verifiable acceptance gate.
Optional fallback runs even when a value exists — implementation review
orElse calls a costly supplier expression although Optional contains a result. Implementation review: choose a response and a verifiable acceptance gate.
A lambda captures a mutable holder — implementation review
A supposedly fixed lambda reads an array element that another request changes. Implementation review: choose a response and a verifiable acceptance gate.
CompletableFuture fallback hides a domain failure — implementation review
exceptionally returns an empty order list for a failed authoritative lookup. Implementation review: choose a response and a verifiable acceptance gate.
thenApply blocks the completion thread — implementation review
A Java 8 future completes on a small IO executor and thenApply performs a long blocking call. Implementation review: choose a response and a verifiable acceptance gate.
A parallel collector shares a mutable accumulator — implementation review
The supplier returns the same ArrayList for all stream partitions. Implementation review: choose a response and a verifiable acceptance gate.
A default method introduces ambiguous behavior — implementation review
A class inherits conflicting defaults from two interfaces and cannot compile. Implementation review: choose a response and a verifiable acceptance gate.
A method reference binds an unintended receiver — implementation review
A method reference captures one mutable service instance used by multiple request tasks. Implementation review: choose a response and a verifiable acceptance gate.
Java 21 features · 32 scenarios
Virtual threads pin carriers inside a monitor
Java 21 JFR shows jdk.VirtualThreadPinned; a synchronized method performs a slow blocking call. Incident investigation: choose a response and a verifiable acceptance gate.
Virtual threads overload a limited connection pool
10000 virtual tasks wait for 32 database connections; acquisition latency rises. Incident investigation: choose a response and a verifiable acceptance gate.
ThreadLocal values inflate per-request memory
Each Java 21 virtual thread stores a 1MB buffer; active task count reaches 5000. Incident investigation: choose a response and a verifiable acceptance gate.
Interrupted tasks continue a canceled request
Future cancellation interrupts a task; code catches InterruptedException and continues the loop. Incident investigation: choose a response and a verifiable acceptance gate.
Structured concurrency fails without preview enabled
Java 21 compilation reports StructuredTaskScope as a preview API; deployment lacks --enable-preview. Incident investigation: choose a response and a verifiable acceptance gate.
ScopedValue examples are deployed as a stable API
Java 21 runtime starts without preview flags; code uses ScopedValue. Incident investigation: choose a response and a verifiable acceptance gate.
A switch expression crashes on a null selector
Java 21 switch receives null; no case null exists; NullPointerException occurs before the expected default. Incident investigation: choose a response and a verifiable acceptance gate.
A sealed hierarchy update breaks exhaustive routing
One component adds a new permitted subtype; an older exhaustive switch sees it at runtime. Incident investigation: choose a response and a verifiable acceptance gate.
A reversed sequenced view changes the original collection
Java 21 list.reversed().removeFirst() also removes the original list's last entry. Incident investigation: choose a response and a verifiable acceptance gate.
A record exposes mutable component state
Record contains a List; caller mutates the original list and stored values change. Incident investigation: choose a response and a verifiable acceptance gate.
A record pattern skips null input
A null value does not match the expected record pattern; fallback path omits required handling. Incident investigation: choose a response and a verifiable acceptance gate.
Guarded switch ordering hides a specific route
An unguarded broad type case precedes a narrower guarded case; compiler reports dominance. Incident investigation: choose a response and a verifiable acceptance gate.
String template preview examples break a portability promise
Java 21 source uses STR templates but the CI compiler disables preview. Incident investigation: choose a response and a verifiable acceptance gate.
Native blocking pins a virtual thread's carrier
Java 21 carrier stack remains in a long native operation while requests queue. Incident investigation: choose a response and a verifiable acceptance gate.
Blocking work starves the common pool
CompletableFuture.supplyAsync performs slow I/O; common-pool workers are occupied and unrelated tasks wait. Incident investigation: choose a response and a verifiable acceptance gate.
Executor close waits beyond the request deadline
A Java 21 try-with-resources executor waits for a task that ignores cancellation. Incident investigation: choose a response and a verifiable acceptance gate.
Concurrent traversal sees an inconsistent business snapshot
Concurrent map iteration combines entries from different update moments; totals violate the cross-entry invariant. Incident investigation: choose a response and a verifiable acceptance gate.
A stop flag is never observed by a worker
Plain boolean is written by one thread and read in a tight loop by another without synchronization. Incident investigation: choose a response and a verifiable acceptance gate.
Virtual threads pin carriers inside a monitor — implementation review
Java 21 JFR shows jdk.VirtualThreadPinned; a synchronized method performs a slow blocking call. Implementation review: choose a response and a verifiable acceptance gate.
Virtual threads overload a limited connection pool — implementation review
10000 virtual tasks wait for 32 database connections; acquisition latency rises. Implementation review: choose a response and a verifiable acceptance gate.
ThreadLocal values inflate per-request memory — implementation review
Each Java 21 virtual thread stores a 1MB buffer; active task count reaches 5000. Implementation review: choose a response and a verifiable acceptance gate.
Interrupted tasks continue a canceled request — implementation review
Future cancellation interrupts a task; code catches InterruptedException and continues the loop. Implementation review: choose a response and a verifiable acceptance gate.
Structured concurrency fails without preview enabled — implementation review
Java 21 compilation reports StructuredTaskScope as a preview API; deployment lacks --enable-preview. Implementation review: choose a response and a verifiable acceptance gate.
ScopedValue examples are deployed as a stable API — implementation review
Java 21 runtime starts without preview flags; code uses ScopedValue. Implementation review: choose a response and a verifiable acceptance gate.
A switch expression crashes on a null selector — implementation review
Java 21 switch receives null; no case null exists; NullPointerException occurs before the expected default. Implementation review: choose a response and a verifiable acceptance gate.
A sealed hierarchy update breaks exhaustive routing — implementation review
One component adds a new permitted subtype; an older exhaustive switch sees it at runtime. Implementation review: choose a response and a verifiable acceptance gate.
A reversed sequenced view changes the original collection — implementation review
Java 21 list.reversed().removeFirst() also removes the original list's last entry. Implementation review: choose a response and a verifiable acceptance gate.
A record exposes mutable component state — implementation review
Record contains a List; caller mutates the original list and stored values change. Implementation review: choose a response and a verifiable acceptance gate.
A record pattern skips null input — implementation review
A null value does not match the expected record pattern; fallback path omits required handling. Implementation review: choose a response and a verifiable acceptance gate.
Guarded switch ordering hides a specific route — implementation review
An unguarded broad type case precedes a narrower guarded case; compiler reports dominance. Implementation review: choose a response and a verifiable acceptance gate.
String template preview examples break a portability promise — implementation review
Java 21 source uses STR templates but the CI compiler disables preview. Implementation review: choose a response and a verifiable acceptance gate.
Native blocking pins a virtual thread's carrier — implementation review
Java 21 carrier stack remains in a long native operation while requests queue. Implementation review: choose a response and a verifiable acceptance gate.