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

Question

Design the backend for an AI coding agent that answers questions and makes edits over a developer's large monorepo (millions of lines, thousands of files). The agent calls an LLM in a multi-step loop (search code → read files → propose edits → run tests), so a single user request can trigger many LLM calls and tool invocations, and latency/cost compound. Design the retrieval + agent-orchestration + caching system to keep this responsive and affordable at scale.

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.