rag
Applied AI interview questions tagged rag, across every topic.
50 questions · 8 unlocked for you
Concepts behind "rag"
The curriculum that explains the ideas these questions test.
Foundational
The Context WindowThe context window is the maximum number of tokens a model can attend to at once, prompt plus generation. It is bounded by attention's quadratic cost, the KV cache's linear memory growth, and the length the model was trained on. A bigger window is not free or uniformly useful (models lose information in the middle), which is why retrieval often beats stuffing everything into context. Applied-AI interviews probe it because it shapes cost, latency, and the RAG-vs-long-context decision.🧠 Foundations of LLMs & GenAI
Foundational
HallucinationA hallucination is fluent, confident output that is wrong or unsupported. It happens because a language model is trained to produce plausible continuations, not to know what it knows; it has no built-in truth check. You reduce it with grounding (RAG), letting the model abstain, low temperature on factual tasks, and verification, and you detect it with faithfulness checks against sources. Applied-AI interviews probe it because hallucination is the number-one reason LLM features fail in production, and because the fix is system design, not a magic prompt.🧠 Foundations of LLMs & GenAI
Foundational
The RAG PipelineRetrieval-Augmented Generation grounds an LLM in external knowledge: at query time you retrieve the most relevant chunks from a knowledge base and put them in the prompt, so the model answers from real sources instead of memory. It is the default fix for hallucination and stale knowledge, and it updates without retraining. The pipeline is ingest and chunk, embed and index, retrieve (often rerank), then generate with citations. Applied-AI interviews probe it because RAG is the modal production LLM architecture.🤖 Retrieval & Agents
Foundational
Citations and GroundingGrounding means the model answers only from provided sources; citations make each claim traceable to the exact passage that supports it. Together they are the trust mechanism of RAG: they let users verify, let you detect hallucination (an uncited or unsupported claim is a red flag), and are mandatory in high-stakes domains. Applied-AI interviews probe it because 'it gave a great answer' is worthless if you cannot tell whether it is true, and citations are how production AI earns trust.🤖 Retrieval & Agents
Foundational
RAG EvaluationEvaluating a RAG system means evaluating retrieval and generation separately, because a bad answer is usually a retrieval failure (the right context was never fetched) and you cannot fix what you cannot localize. Retrieval is scored with recall@k (the ceiling for the whole system), precision, and rank metrics; generation is scored for faithfulness (is each claim supported by the context?) and answer quality. Applied-AI interviews probe it because measuring RAG end-to-end, and knowing which half failed, is the core debugging skill.📊 Evaluation & ML Foundations
Core
Prompting vs RAG vs Fine-TuningGiven an LLM use case, the senior move is matching the technique to what is missing rather than defaulting to one. Need external or changing knowledge? RAG. Need a specific behavior, format, or skill? Fine-tuning. Need to take actions or use live systems? Tools/agents. Just need better instructions? Prompting. They combine, and you escalate from cheapest (prompting) to most involved (fine-tuning). Applied-AI interviews probe it because choosing wrong wastes months, fine-tuning to inject changing facts is the classic mistake.🧠 Foundations of LLMs & GenAISign in
