Code RoomOnline secondary index build
HardPrep Room Coding #3415

Online secondary index build

System designDatabases & SQLSenior–Staff~50 min

A write-heavy primary table (3B rows, 120k writes/sec — inserts, updates, deletes) needs a new secondary index added on a column to support a query that's currently doing full scans. You cannot take downtime and cannot let writes stall while the index builds, which will take hours. Design the online index build: how the index is backfilled from existing rows while concurrent writes keep mutating the table, how you guarantee the finished index is consistent (no missing or stale entries), and how you protect foreground write latency during the build.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify5:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.