The Desi Architect
Notes / Design Interview Problems / Design Document Q&A with RAG (Ingestion, Vectors, Citations)
Track 5 · Design Interview Problems

Design Document Q&A with RAG (Ingestion, Vectors, Citations)

How an enterprise platform extracts text and tables from 50 lakh scanned PDFs, searches across 40 crore chunks using hybrid BM25 and vector retrieval, and generates verified answers with exact page citations.

Architecture for an enterprise document intelligence and question-answering system using Retrieval-Augmented Generation (RAG). Covers layout-aware OCR, structure-aware chunking, hybrid retrieval, cross-encoder reranking, and coordinate-grounded citation attribution.

Interview problem45 min read
On this page
  1. Why this problem is hard
  2. What are we building?
  3. Entities, API and numbers
  4. Building it up, one step at a time
  5. Where it gets hard
  6. Failure modes at a glance
  7. The whole picture
  8. How interviewers judge this
  9. Questions that come next
  10. Saying it out loud in 45 minutes
  11. Sources and assumptions