All questions
Showing of 55What is Retrieval-Augmented Generation, and what problem does it solve?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Retrieval-Augmented Generation (RAG) finds relevant information from an external collection and gives it to a language model before the model answers. It connects generated text to sources that the model did not memorize during training.
A typical system searches company documents, product manuals, or other approved data for the user's question. It places the best passages in the prompt and asks the model to answer from them.
RAG helps with private, detailed, and changing knowledge. It can also support citations and easier updates. It does not guarantee truth, because retrieval can miss the right passage and the model can still misunderstand or ignore good evidence.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why would a team choose RAG over simply relying on a frontier model's built-in knowledge?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
RAG supplies information that model weights may not contain, such as internal policies, customer records, or recent documentation. The team can update the knowledge source without retraining or waiting for a new model.
Retrieved passages provide evidence that can be cited and inspected. Access filters can also limit which documents each user may see. These controls are difficult when facts exist only inside a model's weights.
Built-in knowledge is still useful for general language and reasoning. Use RAG when the answer depends on private, current, or source-specific facts. Evaluate retrieval carefully, since adding irrelevant documents can make the final answer worse.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Walk me through the canonical stages of a RAG pipeline.
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A RAG pipeline has an ingestion path and a query path. During ingestion, it parses documents, splits them into useful chunks, creates embeddings, and stores text, vectors, metadata, and access rules.
During a query, it:
- Rewrites or expands the user's question when needed.
- Retrieves candidate chunks with vector, keyword, or hybrid search.
- Filters and reranks the candidates.
- Builds a prompt from the best evidence.
- Generates an answer with source references.
The application then validates citations, logs the stages, and collects feedback from real users. Each stage needs separate evaluation so a retrieval miss is not mistaken for a generation failure.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is an embedding, and why is it central to RAG?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
An embedding is a numeric vector that represents the meaning of text. Similar ideas tend to produce nearby vectors, even when they use different words.
For RAG, the system embeds document chunks during ingestion and stores their vectors. It embeds the user's question with the same model, compares that query vector with stored vectors, and returns nearby chunks. This enables semantic search across vocabulary differences.
Embeddings are central but not sufficient. They can miss exact names, numbers, or rare terms, so keyword search and reranking often help. The embedding model, chunking method, metadata, and evaluation data all affect retrieval quality.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is a vector database, and why not just compare the query against every stored vector?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
A vector database stores embeddings with their source text and metadata, then supports fast similarity search. It also provides indexing, filtering, updates, deletion, replication, and operational controls.
Comparing a query with every vector gives exact nearest neighbors, but the work grows linearly with the collection. That can be too slow and expensive for millions of vectors or high query traffic.
Vector databases use approximate nearest neighbor indexes to examine a much smaller candidate set. This trades a little recall for large speed gains. Exact search is still reasonable for small collections, offline evaluation, or a final reranking step after filtering.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
Why do we chunk documents instead of embedding and retrieving whole documents?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Whole documents often contain several topics, so one embedding blurs their meaning. Retrieving the entire document also wastes context tokens and can hide the exact passage needed for an answer.
Chunking creates smaller units that are easier to match and fit into a prompt. Each chunk should carry metadata that connects it to the source, section, page, and access policy.
Chunks that are too small lose context; chunks that are too large reduce retrieval precision. Start with natural sections or paragraphs, then tune size and overlap on real questions. Preserve a way to expand around a winning chunk when neighboring text changes its meaning.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
What is chunk overlap, and why is it commonly used?
Answer it yourself first - out loud, or typed below.
How should your speech become text?
Listening… your words appear above as you speak - tap Stop when you're done.
Recording · cr - tap Stop & transcribe when you're done.
Transcribing with AI…
Voice:
Last attempt -
Chunk overlap repeats some text at the boundary between neighboring chunks. It reduces the chance that a sentence, definition, or important relationship is split so neither chunk contains enough context.
Overlap can improve retrieval, but it increases embedding cost, storage, and duplicate results. Too much overlap may fill the final prompt with repeated evidence and reduce source diversity.
Use the smallest overlap that fixes measured boundary failures. Structural chunking may need less overlap because headings and paragraphs already create meaningful boundaries. Deduplicate or merge adjacent retrieved chunks before generation, and evaluate overlap with real queries rather than selecting a percentage by habit.
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
Why there's no diagram: “”
The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓
How does dense retrieval differ from keyword search like BM25?
What does top-k mean in retrieval, and how do you think about choosing k?
What does grounding mean in the context of RAG, and how do citations typically work?
RAG is often said to reduce hallucinations. Why does it help, and why does it not eliminate them?
How is the final prompt constructed in a RAG system, and what belongs in it?
Which similarity metric should you use for embeddings - cosine, dot product, or Euclidean - and when does normalization matter?
Compare fixed-size, recursive, semantic, and structural chunking. When would you pick each?
What are the tradeoffs between small chunks and large chunks?
What is hybrid retrieval, and why does it usually outperform pure dense retrieval?
Explain Reciprocal Rank Fusion. Why is it preferred over combining raw scores?
What is a cross-encoder reranker, and why is it more accurate than the bi-encoder used for retrieval?
Why do production systems use two-stage retrieval instead of one great model?
In a multi-turn chat, why can't you embed the user's latest message directly, and what do you do instead?
What are query expansion and query decomposition, and when does each help?
Explain HyDE. What problem does it address and what are its risks?
Define recall@k, MRR, and nDCG. When is each the right retrieval metric?
How do you evaluate the generation side of RAG, in the style of frameworks like RAGAS?
How would you build an evaluation dataset for a RAG system when none exists?
What is the lost-in-the-middle problem, and how do you mitigate it in RAG?
A user reports the assistant said "I couldn't find anything" but the document exists in the corpus. How do you debug this retrieval miss?
How does metadata filtering work in vector search, and what is the difference between pre-filtering and post-filtering?
What factors matter when choosing an embedding model for RAG?
Compare HNSW and IVF indexes, and explain where quantization fits in.
When should you use RAG versus fine-tuning versus just using a long context window?
How do you route a query across multiple knowledge sources, and how do you decide not to retrieve at all?
What is parent-document (small-to-big) retrieval, and how does it differ from just using larger chunks?
What is contextual retrieval (contextual chunk enrichment), and what failure of naive chunking does it fix?
What is GraphRAG, and when is it worth the added complexity?
What makes a RAG system "agentic," and what does that buy you over a fixed pipeline?
How do you handle multi-hop questions in RAG?
Explain Self-RAG and Corrective RAG. What production patterns did they inspire?
How do you detect and prevent hallucinated citations in RAG outputs?
How do you keep a RAG index fresh as documents are created, edited, and deleted?
How do you implement multi-tenancy and document-level access control in RAG retrieval?
Walk through the latency budget of a production RAG query. Where does time go and how do you optimize?
What caching strategies apply to RAG, and what are the invalidation pitfalls?
How do you handle tables, images, and other non-prose content in a RAG corpus?
Compare cross-encoder rerankers with LLM-based rerankers. How would you choose?
Your embedding model is being deprecated. How do you migrate a large production index without downtime or quality regression?
How do you assemble the final context when many chunks survive reranking? Discuss ordering, deduplication, and token budgeting.
Design the evaluation program for a RAG product from prototype to production. What do you measure, when, and how do you keep the metrics trustworthy?
Your dashboards show retrieval recall is high, yet users report wrong answers. Walk through your systematic diagnosis.
Design retrieval for a corpus of 100M+ documents with strict latency SLOs. What changes relative to a small-scale RAG stack?
What security threats are specific to RAG systems, and how do you mitigate them?
Build the economic decision framework: when does RAG lose to long-context stuffing or fine-tuning? Include the cost math.
Design a RAG system for a high-stakes domain (legal or medical) where wrong answers carry liability. What changes relative to a standard assistant?
How do you do RAG over structured data such as SQL tables or APIs instead of documents?
When are learned sparse retrieval (SPLADE) or late-interaction models (ColBERT) worth using instead of a dense plus BM25 hybrid?
This answer is part of Pro.
The full written answer, with the trade-offs and follow-ups an interviewer will probe.
No matches
Try a different filter or search term.
RAG (Retrieval-Augmented Generation) cheatsheet
- The 30-second mental model01
- The pipeline end to end02
- Chunking decision guide03
- Retrieval technique catalog04
- Reranking05
- Query transformation06
- Context assembly07
- Grounding and citations08
- Evaluation09
- Failure modes and fixes10
- Advanced patterns11
- RAG vs long-context vs fine-tuning12
- + 3 more inside
- + 9 more inside
48 of 55 RAG (Retrieval-Augmented Generation) answers are in Pro.
Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.
- Full answers + code
- AI explanations, simpler or deeper
- 1,000 AI credits / month
- Cancel anytime
Change topic
Pick a different technology or stack. Your current topic stays put until you choose a new one.
MEAN
MongoDB, Express, Angular, Node.jsMERN
MongoDB, Express, React, Node.jsDjango
Python Full-Stack DevelopmentRuby on Rails
Convention over ConfigurationServerless on AWS
Serverless Architecture on AWSInterviewers also test these - they're common to every stack, whichever one you picked above.
Flutter Mobile
Flutter Cross-Platform Mobile DevelopmentInterviewers also test these - they're common to every stack, whichever one you picked above.
Spring Boot
Enterprise Java Development.NET
Microsoft EcosystemVue
Vue.js, Vite, TypeScript, Tailwind, Node.jsGo Backend
Golang, gRPC, PostgreSQL, Redis, RabbitMQInterviewers also test these - they're common to every stack, whichever one you picked above.
FastAPI
Python, FastAPI, SQLAlchemy, PostgreSQLReact Native
React, TypeScript, Redux, FirebaseiOS Native
Swift, SwiftUI, UIKit, FirebaseAndroid Native
Java, Jetpack Compose, FirebaseDevOps / Platform
Docker, Kubernetes, Terraform, CI/CDInterviewers also test these - they're common to every stack, whichever one you picked above.
AI Engineer
LLMs, RAG, Agents, EvalsAI-Powered Developer
Claude Code, Copilot, Agentic WorkflowsCore SWE Interview Prep
Data structures, algorithms, OS, concurrency, networking, gitInterviewers also test these - they're common to every stack, whichever one you picked above.
Interviewers also test these - they're common to every stack, whichever one you picked above.