Retrieval-Augmented Generation (RAG) Questions

Grounding language-model outputs in external knowledge at inference time. Covers document ingestion, chunking and embedding, sparse, dense and hybrid retrieval (BM25, score fusion, contrastive training of retrievers), vector search and approximate-nearest-neighbour index engineering (HNSW, IVF, product quantization, filtering, updates, sharding), re-ranking with cross-encoders, and context assembly with prompt templates and citations. Also covers reducing hallucination through verification and abstention, evaluating retrieval-augmented systems, and production concerns such as freshness, access control, prompt injection through retrieved documents, deletion and privacy, caching, cost, and weighing retrieval against fine-tuning. Generic LLM evaluation and release gates, the craft of prompts beyond retrieved-context templates, attention internals, parameter-efficient fine-tuning, model serving and distributed inference engineering, database indexes, and whole-product ML system design are covered elsewhere.

HardSystem Design
22 practiced

Design a RAG system for factual question answering over a very large corpus (hundreds of millions of documents) with a high query rate and a strict tail-latency budget. Describe the index, re-ranking, context selection, generation and how you would scale and cache it.

MediumSystem Design
22 practiced

Design a RAG microservice architecture that separates concerns between retrieval, re-ranking, and generation. Include API boundaries, expected inputs/outputs, batching strategies, and where to put caching and authorization checks.

HardSystem Design
24 practiced

Design a RAG system served across multiple regions. How do you store and partition the vector indices, guarantee freshness of new documents, replicate, and keep tail latency low for users far from the primary?

MediumSystem Design
20 practiced

Design access control for a RAG system over sensitive documents so users only retrieve what they are cleared to see. How do authentication, authorization and audit logging fit into the pipeline without hurting latency?

HardSystem Design
24 practiced

Propose a cost-optimized deployment plan for a RAG service that balances CPU-based ANN vs GPU-based re-ranking and generation for mixed query loads (80% short FAQ queries, 20% long-complex research queries). Include autoscaling and prewarming considerations.

Unlock Full Question Bank

Get access to all 11 Retrieval-Augmented Generation (RAG) interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.