Code RoomLarge table migration safety
HardPrep Room Coding #4496

Large table migration safety

Vibe & agenticAlgorithms & data structuresSenior–Staff~22 min

An agent generated a Postgres migration to backfill a new `normalized_email` column across a 200-million-row users table and ran fine against your local 5,000-row dev database. You don't fully understand its locking behavior or the backfill batching. It's queued for production. How do you verify it's safe to run against the real table without taking the site down?

Implement
plan_backfill_batches(last_done_id: int, max_id: int, batch_size: int, max_batches: int) → list[list[int]]
Examples
in[0,10,4,10]out[[1,4],[5,8],[9,10]]
in[8,10,4,10]out[[9,10]]
in[0,200000000,5000000,3]out[[1,5000000],[5000001,10000000],[10000001,15000000]]
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.