All Questions
Ai Coding And Product Systems medium

Your code assistant's chat runs against a 2-million-line monorepo. When asked about a function, it often hallucinates the signatures of helpers defined in other files. A teammate proposes including more of the repository in the prompt. What context strategy should you adopt?

  1. A Concatenate the whole repository into the prompt, since giving the model every file guarantees it sees the relevant helper definitions.
  2. B Include only the currently open file, because adding other files dilutes attention and raises latency more than it improves answers.
  3. C Fine-tune the model on the repository nightly so it memorizes the helper signatures and needs no retrieved context at request time.
  4. D Rank candidate files by imports, symbol references, open tabs, and embedding similarity, then pack the best ones within a token budget.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions