Home / AI Architecture & System Design

S2

RAG & Retrieval

Retrieval-augmented generation end to end: chunking, embeddings, indexes, reranking and evaluation.

Guides

01

The RAG pipeline end to end

Ingestion, chunking, embedding, retrieval, reranking and generation, plus where each step goes wrong.

11 min
02

Embeddings and vector indexes

Similarity metrics, exact vs. approximate search, HNSW and IVF, quantization, and filtering.

9 min
03

Evaluating RAG systems

Separate retrieval metrics from generation metrics, build a golden set, and use LLM-as-judge carefully.

7 min

Interview questions

30-second answer plus a full 40-minute walkthrough for each.

Q1

Walk me through how you'd build a RAG system over a company's internal docs.

Mid
Q2

How do you choose chunk size?

Mid
Q3

Why use hybrid search instead of only vector search?

Mid
Q4

What is a reranker and why is it more accurate than the first-stage retriever?

Mid
Q5

Explain HNSW and its main parameters.

Senior
Q6

HNSW vs. IVF-PQ: when would you choose each?

Senior
Q7

How do you enforce document permissions in RAG?

Senior
Q8

How do you evaluate a RAG system?

Mid
Q9

What is 'lost in the middle' and how do you mitigate it?

Mid
Q10

Your embedding provider releases a better model. How do you migrate?

Senior
Q11

When does long context make RAG unnecessary?

Senior
Q12

What is HyDE?

Mid