Migrate live payments database schema
You're tasked with a database migration on a live payments system: add a new column, backfill ~80M rows, dual-write during transition, then cut reads over — across a Postgres schema and the Go services that touch it. You have an AI agent that can write migrations, code, and scripts. Decompose this into agent-delegable steps versus human-owned steps, and place the verification/rollback gates.
Implement
plan_backfill_batches(total_rows: int, batch_size: int, observed_lag_ms: list[int], lag_limit_ms: int) → list[int]Examples
in
[250,100,[10,10,10],500]out[100,100,50]in
[300,100,[10,900,10,10],500]out[100,0,100,100]in
[1000,100,[900,900,900,10],500]out[0,0,-1,0]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 22 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.