Code Room
System designHard
Question
Design a retrieval-augmented generation backend for an enterprise knowledge assistant over a customer's internal docs (10M documents, frequent edits, strict per-document ACLs). Answers must cite sources, must never surface a doc the asking user can't access, and a doc edited 2 minutes ago should be reflected in answers. Throughput is 50 QPS of question traffic. Cover the indexing pipeline, how retrieval respects per-user permissions without rebuilding indexes per user, and how you keep the vector index fresh under constant edits.
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.
Learn the concepts
Loading whiteboard…
Run or narrate your approach, then ask the coach.