Preparing your design workspace

Loading the problem and your latest saved attempt…

Grounded Document-Vault Question Answering

Design a permission-aware RAG service that answers questions over a large document vault with verifiable citations.

Problem statement

For this exercise, assume organizations maintain a large vault of versioned, text-bearing PDF documents. The ingestion pipeline preserves each immutable PDF, parses its text and page structure, chunks the extracted content, creates embeddings, and publishes a searchable vector-index generation.

An authorized user submits a natural-language question and receives an answer grounded only in document versions that user may read, together with citations that identify supporting passages and PDF page locations.

Documents can be added, replaced, or access-revoked; indexing and answer generation may be asynchronous internally, but the user-facing query should complete interactively.

A completed answer must never cite an unauthorized, unpublished, or partially indexed version, and the system must make unsupported or partial results explicit rather than fabricate evidence.

Design the PDF ingestion, parsing, chunking, embedding, vector retrieval, generation, citation, authorization, and failure paths. Exclude document editing, image-only OCR, billing, model training, and legal conclusions.

For a model-and-infrastructure follow-up, compare how you would choose embedding, retrieval, optional reranking and answer-generation methods, and how you would optimize document processing, index publication and the online query path.

Explain what evidence would justify the quality, freshness, latency and cost trade-offs while preserving authorization and grounded citations. Specific models, vendors and optimization order are design choices for this exercise.

What to build

  1. An authorized administrator can publish or revoke an immutable PDF version and inspect parsing, chunking, embedding, vector-index, and final searchable-readiness states.
  2. An authorized user can ask a question over a permitted vault scope and receive a concise answer whose claims link to supporting document passages.
  3. Every retrieval and citation is restricted to currently authorized published versions, and the service reports insufficient evidence or partial failure explicitly.

At scale

  • Assume a large tenant may hold 10 million document versions and 20 billion indexed text chunks.
  • Support 2,000 question requests per second globally, with p95 completed-answer latency below 8 seconds under normal load.
  • Publish new or replaced document versions into searchable state within 15 minutes, while access revocation must affect new queries within 60 seconds.
  • Retain immutable source versions and index manifests for seven years; tolerate zone failure without exposing a partially published version.