Senior interview questionAsked at Databricks · interview write-up
You're designing retrieval for a coding agent. What do you index, how do you chunk and rank, how do you keep noise out, and how do you measure it?
Model answer
Index more than files: parsed symbols with signatures and docstrings, the import and call graph, tests, docs and recent diffs. Chunk on syntax boundaries, a whole function with its path and class, not fixed windows.
Rank with several signals: exact identifier search, embeddings for intent, and graph expansion from symbols in the open file or stack trace, then a reranker. Cut noise by skipping vendored, generated and build files. Measure recall of the files the real fix touched, then task success: do the tests pass?
Practise the rest
22 RAG questions, 492 in all, each with a model answer. Free.
More from Databricks interview questions.
More RAG interview questions
- What is retrieval-augmented generation, and how does it reduce hallucination?
- How do you choose a chunking strategy for RAG?
- Why combine keyword and embedding search, and where does a reranker fit?
- How do you evaluate a RAG pipeline?
- Your RAG chatbot keeps giving wrong answers. How do you find out why, and fix it?
- Design a RAG system that has to meet strict latency and cost targets while serving many tenants.