Operations Quiz
Last Updated: 2026-12-01 Status: Complete
Test your judgment on observability, testing and scaling for payment platforms. Answers are collapsed; try each question before opening it.
Question 1: The single decline-rate alert
Your CEO asks what decline rate is acceptable and wants a single alert at that number. What do you build?
View answer
No universal acceptable decline rate exists; it varies by merchant type, card mix, region and card-present or not. Build baselines per segment (processor, BIN range, merchant, MCC, region, hour of week) and alert on the rate deviating from its own seasonal baseline. Require a minimum sample, so a segment with a handful of transactions does not alert by chance, and keep both platform-wide and per-segment alerts so a local problem is not averaged away. Page on the symptom, not the cause. See Observability.
Question 2: Timeouts at one processor
Authorization calls to one processor start timing out. What should the platform do with those payments?
View answer
Each timeout is a payment in the explicit unknown state. Do not authorize again: the processor may have approved the first attempt. A resolver job queries the processor by its identifiers or sends a reversal, then moves the payment to a definite state with a single ledger effect. Alert on the unknown-outcome count, and consider routing new payments to another processor while the first is degraded. See Idempotency and Observability.
Question 3: Where does the trace break?
Support gets a ticket about a webhook for a payment, but the trace was sampled out. How could you still reconstruct what happened?
View answer
Traces are sampled and break at asynchronous hops, so do not depend on them alone. Store the trace id and a business correlation id (the payment id) on the payment row, the journal entry and the outbox event. Support can then start from the payment id and find the processor call, ledger entries and delivery attempts. Keep PAN and PII out of span attributes and log fields; use your own ids. See Observability.
Question 4: Load testing against the sandbox
A teammate wants to run the load test against the processor's sandbox. What do you advise?
View answer
Do not. Sandboxes are rate-limited and not intended for load, so the result would measure the sandbox, and you risk throttling. Build a fake processor with configurable latency and error mix, run the same contract tests against the fake and the sandbox so differences surface, and load test your own platform against the fake with production-like skew, where a few merchants dominate volume. Keep a small sandbox end-to-end suite for realism. See Testing.
Question 5: Simulating a chargeback
Product wants to demo the dispute workflow, but real chargebacks take weeks. How do you test it?
View answer
Use the vendor's simulation first: Stripe documents dispute test cards and evidence values, and Adyen documents holderName keywords, though not every dispute type can be simulated and Adyen's can take up to 24 hours. For speed and coverage, build a test-only dispute simulator that emits processor-shaped, signed webhooks for each stage and can advance time past evidence deadlines. That exercises webhook verification, the dispute state machine and the ledger entries. See Testing.
Question 6: Concurrent identical requests
A client bug sends the same create-payment request 20 times in parallel with one idempotency key. How do you prove the platform behaves correctly?
View answer
Write a concurrency test against a real database, since the guarantee comes from a unique constraint and transaction isolation that mocks do not reproduce. Fire the requests with Promise.allSettled, and assert that the fake processor was called once, that all successful responses carry the same payment id, and that any rejections are in-progress conflicts. Add a test that the same key with different parameters is rejected as a client error. Run it repeatedly in CI. See Testing.
Question 7: Hot fee account
Every transaction updates one fee revenue account and throughput has plateaued. What are your options?
View answer
The account is a hot row. Split it into sub-accounts chosen by hash of the payment id, with the logical balance as their sum, or record fees in a pending table in the same transaction and post aggregated entries from a batched worker. This is safe because nothing gates on the revenue balance. Accounts that guard payouts or overdrafts must stay synchronous, and any clearing account used while postings are deferred should return to zero, with its age monitored. See Scaling.
Question 8: Balances from a replica
A team wants the payout service to read merchant balances from a read replica to reduce load on the primary. Do you agree?
View answer
No. Replicas lag the primary, so a stale balance can allow an overdraft or a double payout. Payout and balance decisions read the primary inside the transaction that acts on the result, with the ledger's guards. Replicas suit reports, exports and dashboards, ideally showing a freshness timestamp, and replication lag should itself be monitored. The same reasoning forbids caching balances or idempotency state for decisions. See Scaling and Balances.
Question 9: Choosing a shard key
Your single ledger database can no longer take the write load. Someone proposes sharding by payment id for even distribution. What do you say?
View answer
Even distribution is not the main goal; keeping a merchant's ledger together is. Sharding by payment id scatters one merchant's balance across shards, so a balance check and its postings would span shards and need distributed transactions. Shard by tenant or merchant id instead, accept some skew from large merchants, and send platform-level reporting to a warehouse or CQRS read model. Before sharding, confirm vertical scaling, indexing and time partitioning are exhausted. See Scaling.
Question 10: The slow transactions list
The merchant dashboard's transactions list is slow and gets slower on deep pages. What do you check and change?
View answer
Read the query plan first. Add a composite index led by tenant then time, covering the displayed columns where useful. Replace offset pagination with keyset pagination, which seeks from the last row seen using an index instead of reading and discarding skipped rows. Partition by time and archive cold partitions, and move aggregate or analytic queries to a replica or warehouse. Expose the cursor as an opaque token in the API. See Scaling.
Related Topics
- Observability — signals, SLOs, tracing and alerting
- Testing Payment Systems — strategy, simulators and failure injection
- Scaling Payment Platforms — hot accounts, partitioning, replicas and capacity