RAG & Data Pipelines · 3 to 4 hours
Design multi-tenant RAG with deletion
Design a private multi-tenant policy assistant whose answers and citations stay correct through asynchronous updates, retries, permission changes, and deletion.
4 h
Overview
Design a multi-tenant RAG pipeline that remains consistent during updates, retries, permission changes, and deletion. The goal is to defend explicit guarantees for document visibility, source attribution, and recovery, backed by tests and observable state.
Study time: 3 to 4 hours
Interview format: System design
By the end you can
- Define a consistency contract for visibility, deletion, and in-flight answers
- Model documents, immutable revisions, and manifests so publication is conditional and complete
- Stop stale jobs from publishing or resurrecting deleted content with generation checks or fencing
- Keep caches, conversation history, and citations consistent with permission changes and deletion
- Evaluate the pipeline by stage and test lifecycle races, not only answer quality
Prerequisites
Helpful background: Familiarity with transactions, asynchronous jobs, and access control helps.
This topic covers ingestion, grounding, citations, and the document lifecycle. Embeddings & Retrieval covers how candidates are found and ranked.
In this guide
- Define the consistency contract
- Model logical documents and derived revisions
- Stage, validate, and publish
- Retries and out-of-order jobs
- Deletion as a lifecycle operation
- Permission changes are also freshness events
- Citation integrity and document history
- Context and generation policy
- Evaluate end to end and by stage
- Worked race timeline
- Operational targets and trade-offs
Hard questions are part of Premium: the study guide, reference answer, rubric, and exercises unlock with Premium.
Related on CodeSnatch
Lessons, problems, and articles that build the skills this question uses.
System Design
Explains fencing tokens and leases, the tools that stop a stale worker from writing after a newer one.
System Design
Covers erasure across caches, logs, analytics, and backups, plus crypto-shredding, for deletion that reaches every copy.
System Design
Details invalidation races and versioned keys, useful when cached answers must follow permission and document changes.
System Design
Compares silo, pool, and bridge tenancy, the trade-off behind shared or per-tenant indexes and tenant deletion.
AI Engineering
Builds on this design: threat-model an assistant over private documents, summaries, caches, and deletion.
Practice the interview question
Answer it in your own words before you look at the reference answer.
