Design a Permission-Aware RAG Assistant Over Feishu Workspace Documents
Last updated: November 29, 2026
Quick Overview
Design an assistant inside Feishu (Lark) that answers employees' questions using their company's docs, wikis, and chats, citing sources and never revealing content the asking user cannot access.
ByteDance
November 29, 20260
0
0 solved
Design an assistant inside Feishu (Lark) that answers employees' questions using their company's docs, wikis, and chats, citing sources and never revealing content the asking user cannot access.
Feishu's AI features let enterprise users ask questions over their own workspace, and ByteDance offers model serving through Volcano Engine. The interviewer cares about retrieval quality and serving cost, but the core requirement is per-user access control at retrieval time, which naive RAG designs get wrong.
What the Interviewer Expects
- Design ingestion, chunking, embedding, and hybrid retrieval
- Enforce document permissions at query time, not just at indexing
- Handle freshness when documents and permissions change
- Ground answers with citations and refuse when evidence is missing
- Evaluate retrieval and answer quality, plus latency and cost
Key Topics to Cover
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
- How would you handle a user whose access was revoked one minute ago?
- How would you support questions that require aggregating many documents?
- How do you keep per-tenant data isolated in a shared vector index?
- When would you fine-tune the model instead of improving retrieval?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice ML System Design ProblemsSample Answer
Requirements
- Tenants range from 50 to 100,000 employees; tens of millions of documents in large tenants.
- p95 time to first token under 2 seconds.
- Strict tenant isolation and per-document ACLs (owner, groups,...
High-Level Design
An ingestion pipeline subscribes to document change events, extracts text, splits it into structure-aware chunks (by heading, table, or message thread), embeds chunks, and writes them to a per-tenant ...
Submit Your Answer
ByteDance Machine Learning Engineer Interview Guide
Interview process, tips, and preparation timeline