Code RoomOpen issues sorted index
MediumPrep Room Coding #3166

Open issues sorted index

System designDatabases & SQLMid–Senior~35 min

A project-management app's 'my open issues, sorted by updated-at' query is slow: it filters by (assignee_id, status='open') and sorts by updated_at, over a 500M-row issues table, and shows 50 rows per page. The query currently filters on an index but then does 50 random heap fetches per page and re-sorts. p95 is 400ms; target 50ms. Reads vastly outnumber writes but writes are frequent (issues update often). Design the indexing fix, explain why it works, and the cost you're accepting.

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.

Clarify4:00 left
Estimate4:00 planned
Design11:30 planned
Deep dive9:30 planned
Failure6:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.