Code Room
System designHardsd-g091
Subject Rag llm infraLevel Senior–Staff~50 minCommon in Distributed systems interviewsIndustries Technology

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.

Narrate your design
Loading whiteboard…
Run or narrate your approach, then ask the coach.