Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
51 small wins to finish your pathNext question →

Q48HardSystem design

Design a multi-tenant platform where customers can deploy their own agents (code execution, tools, memory).

30-second answerSay your answer out loud first, then reveal.
A multi-tenant agent platform: the control plane API feeds a per-tenant fair run queue and kill switch, the queue feeds durable orchestrator workers, and the workers use a model gateway, a sandbox pool whose traffic leaves through a per-tenant egress proxy, a tool gateway, tenant-namespaced memory, and tracing and billing.

Key areas

  1. Compute isolation: untrusted, model-generated code must never run on shared hosts unsandboxed. Use microVMs or gVisor per session; CPU/memory/time limits; ephemeral filesystems; destroy after the run.
  2. Network: deny by default; egress through a proxy with per-tenant allow-lists. This blocks data exfiltration and abuse such as crypto-mining or attacks from your IPs.
  3. Data isolation: tenant ID enforced at the storage layer (separate indexes or row-level security), not just in app code. Test for cross-tenant leakage.
  4. Secrets: a vault, injected at the tool gateway; never in prompts, logs or sandbox env vars unless required.
  5. Fairness and quotas: per-tenant concurrency limits, token budgets, rate limits at the model gateway, priority queues.
  6. Reliability: durable execution for long runs; retries; regional failover.
  7. Observability and billing: per-tenant traces, cost metering (tokens, compute seconds, tool calls), anomaly alerts.
  8. Governance: audit logs, data retention controls, abuse detection, an emergency kill switch per tenant or agent.

Trade-offs to discuss: microVM cold-start latency vs isolation strength (warm pools help); shared vs dedicated vector indexes (cost vs isolation); letting tenants bring their own model keys.

Slow is fine. Stopping is the only problem.