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.

MediumTechnical
20 practiced

Explain metadata filtering in a retrieval pipeline. How would you design query-time filters so that retrieved documents are relevant to the user and respect access controls, and what goes wrong with filtered ANN search?

MediumSystem Design
16 practiced

Design a caching and precomputation layer for a RAG system so frequent queries meet a tight latency target while answers still carry citations and the corpus changes every few hours. How do you handle invalidation and the freshness-versus-cost trade-off?

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.

MediumSystem Design
18 practiced

You must choose a vector database for a production semantic search service holding about a million 768-dimension embeddings, with a tight tail-latency target, near-real-time inserts and deletes, and multi-region replication. What criteria drive your choice and how do you validate it?

HardSystem Design
24 practiced

You need to support regulatory compliance (e.g., GDPR) that requires deletion of a user's documents from the RAG index within seconds. Propose an end-to-end design for immediate deletion that covers vector indices, backups, caches, and derived artifacts like fine-tuned models or log-derived features.

That is every published Retrieval-Augmented Generation (RAG) question for Backend Developer so far. Browse the other topics in this category, or practice this one interactively.