This week I had a technical interview for a fintech tech support role.
I didn't have direct hands-on experience in fintech support, even though almost all the underlying engineering skills—tracing distributed requests, reading logs, debugging APIs—are transferable. The real problem was that I hadn't written SQL queries by hand in a long time, and I wanted to actually remember how a payment pipeline is wired together, where logs live, and where things break in practice.
Reading documentation or "how payment gateways work" articles doesn't stick for me. I need to touch the system with my own hands—break a request, watch the error hit the logs, open a terminal, and trace it down to the database row.
So I built Payment Chaos Lab: a small, local Docker Compose sandbox that simulates a real payment flow, lets you trigger specific failures on purpose, and gives you a stack to trace and fix them.
The goal wasn't to spend time learning Docker or babysitting infrastructure—I wanted to focus purely on terminal logs and SQL.
The whole environment is wrapped in a Makefile:
make upstarts the stack.make resetwipes the database and logs back to a clean seed whenever you want to try a scenario again.
Inside, it simulates a typical payment aggregator setup:
[ Merchant Simulator ]
│
▼
[ Nginx ]
│
▼
[ Aggregator API (FastAPI) ] ── MariaDB (Transactions & Fees)
│ ── Redis (Idempotency Locks)
▼
[ Telco Mock ]
│
▼
Promtail ──▶ Loki ──▶ Grafana (Structured JSON Logs)You get structured JSON logs flowing into Loki and Grafana, plus Adminer and a CLI SQL shell so you can inspect the MariaDB tables directly from the terminal.
Across 7 labs and a handful of pre-seeded database anomalies, you trigger real payment failures and figure out what happened:
- Upstream timeouts and outages: Trigger
504timeouts,503outages, dropped callbacks, and malformed payloads from the telco mock, then trace where the transaction got stuck. - Broken merchant webhooks: Simulate a merchant WAF blocking callbacks (
403), unexpected302redirects,500crashes, and HMAC signature mismatches (400), then run manual retries. - Timezone & reconciliation mismatches: Match aggregator records stored in UTC against telco settlement records in East Africa Time (UTC+3) using raw SQL to catch missing fees, commission discrepancies, and stuck
PENDINGpayments. - Idempotency under load: Fire duplicate retry storms and concurrent requests to watch how Redis idempotency locks behave in real time.
Everything runs locally with fake data and zero external dependencies.
The main reason I wanted a running stack instead of a checklist is that payment bugs rarely tell you what happened in a single place.
Take a 504 Gateway Timeout from an upstream telco. In a normal web app, a 504 just means "retry the request." In payments, blindly retrying a 504 without checking upstream state is how you double-charge a user.
In the lab, working through a failure like that forces you to follow the actual trail across services:
- Check the proxy vs. the aggregator: Look at the JSON logs in Grafana/Loki to see whether Nginx timed out waiting on FastAPI, or FastAPI timed out waiting on the telco mock.
- Verify upstream state: Check whether the telco mock actually accepted and debited the transaction before the connection dropped—or if the callback got lost on the way back.
- Inspect the ledger by hand: Open the MariaDB CLI shell and query the transaction and fee tables directly to see if the row is stuck in
PENDING, whether a commission was miscalculated, or if aUTCvsUTC+3midnight shift pushed the record into the wrong settlement batch. - Test the retry path: When a merchant's webhook endpoint rejects a callback (
403from a WAF or400from a broken HMAC signature), trace the payload, fix the mismatch, and trigger a retry without creating duplicate ledger entries.
Doing that loop a few times by hand in the terminal builds way more recall than memorizing definitions ever could.
I put the repo up at github.com/Evgenii-Zinner/payment-chaos-lab for anyone else who needs to shake the rust off their SQL or incident-tracing skills.
It definitely helped me get my head back into raw queries and log correlation before the interview. That said, since I haven't worked in fintech support full-time, some of the mocks or failure modes might behave slightly differently than they do in real production gateways.
If you work in payments and spot something that works differently in the wild—or want to add a real-world failure scenario you've had to debug—PRs and issues are very welcome.