Multi-Tenant
multi-tenant
Practice Problems
Leakage-Safe Context Selection
Select the documents a user may see from trusted identity alone, rank them by query terms in the title and body, and return at most maxItems minimized context items without ever exposing an internal note.
RAG Chunk Eligibility
Return the first reason a retrieved chunk is excluded for a user (tenant, deletion, publication state, revision, or department), or null when the chunk is eligible.
Validated Tool Adapter
Validate a model-proposed get_ticket call (tool name, exact arguments, ID format), take the tenant and read permission from trusted context, and return a copy of only that tenant's ticket or a controlled error code.
System Design
Multi-Region, Multi-Tenant Architecture
Going from one region to many is one of the largest architectural commitments a company can make. The motivations are real (latency for global users, regulatory data residency, disaster recovery, regional uptime SLOs) and so are the costs (cross-region replication latency, conflict resolution, deployment complexity, blast-radius management, double or triple infrastructure spend). Multi-tenancy adds another orthogonal axis: how do you share the same infrastructure safely across hundreds or thousands of customers without one of them noisy-neighboring everyone else? This lesson covers active-active vs active-passive deployments, the data layer (replication, conflict handling, GDPR-style data residency), DNS and traffic routing, deployment topology, and the tenancy patterns (silo, pool, bridge) along with when each is the right answer.
AI Engineering
Design hybrid retrieval within a latency budget
Design hybrid retrieval with reranking for a multi-tenant help center, choose a configuration from measured quality and latency gates, and keep access rules intact through timeouts and model migrations.
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.
Implement a validated, tenant-scoped tool adapter
Implement a get_ticket adapter that validates model-proposed arguments, takes tenant scope from trusted context, and passes a fixture table, then explain how a bounded orchestrator handles timeouts, invalid calls, and parallel lookups.
Extend a tool adapter with a search tool
Extend the validated ticket adapter with a paginated search_tickets tool behind a tool registry under a 3-hour cap, hand in tests and a README, then review a sample submission as the interviewer would.
Prove a context selector cannot leak data
Implement a context selector that enforces tenant, group, and deletion rules before ranking, then design tests proving that forbidden records and internal notes never reach the model-bound payload.
Threat-model an agent with private data
Threat-model a multi-tenant assistant that reads private documents, keeps conversation summaries, and sends approved notifications, naming where each control is enforced and what risk remains.
