TL;DR: Isolate at every layer a tenant's data or code touches. Compute: a microVM (or gVisor sandbox) per session, never reused, with dedicated host pools for tenants who require them. Network: per-session egress through brokers, no traffic between sandboxes. Storage: per-session workspaces, per-tenant encryption keys, persisted workspaces keyed by tenant. Credentials: minted per session by a broker. Shared caches (packages, build artefacts, images, model responses): keyed by tenant or limited to public content. Observability: tenant-tagged, access-controlled. Then size the fleet, enforce quotas against noisy neighbours, and prove isolation with cross-tenant canary tests.
How to approach it
List every layer a session touches, give the isolation mechanism for each, then do the capacity arithmetic and finish with how you would prove it holds.
A strong answer
The layers.
| Layer | Mechanism | The usual leak |
|---|---|---|
| Compute | MicroVM per session, destroyed after; dedicated hosts for regulated tenants | Reusing sandboxes for speed |
| Network | Egress only to brokers and mirrors; no sandbox-to-sandbox traffic; metadata blocked | A flat network between sandboxes |
| Storage | Session scratch disks; persisted workspaces per tenant, encrypted with per-tenant keys | Shared volumes or snapshots containing tenant code |
| Credentials | Broker mints short-lived per-session tokens | Long-lived tokens in images |
| Shared caches | Package mirror for public packages only; build caches keyed by tenant; snapshots per tenant repository | A shared build cache that one tenant can poison or read |
| Model calls and logs | Requests and caches keyed by tenant; logs tagged and access-controlled | A response cache keyed by prompt only |
Shared caches deserve the attention. Caching is how the platform stays fast at this scale, and it is the easiest way to move one tenant's bytes into another's session: a build cache entry produced from tenant A's code and reused by tenant B, a snapshot of a private repository used as a base for others, a response cache keyed without the tenant. Rule: content derived from a tenant's code or data is cached only under that tenant's key; only public content (open-source packages from a verified mirror) is shared.
Capacity.
from math import ceil
def fleet(sessions, vcpu, mem_gb, host_vcpu=96, host_mem_gb=768,
overcommit_cpu=2.0, headroom=0.2):
per_host_cpu = host_vcpu * overcommit_cpu // vcpu
per_host_mem = host_mem_gb // mem_gb # memory is not overcommitted
per_host = int(min(per_host_cpu, per_host_mem) * (1 - headroom))
return per_host, ceil(sessions / per_host)
print(fleet(20_000, vcpu=2, mem_gb=8)) # => (76, 264)
With 2 vCPUs and 8 GB per session, a host fits 96 sessions by memory and, with CPU overcommitted twofold, 96 by CPU; 76 after headroom, so about 264 hosts. Without the overcommit, CPU would cap it at 48 and the fleet would double. Coding sessions are mostly idle between bursts, which is why CPU can be overcommitted while memory usually is not.
Noisy neighbours. Per-session limits on CPU, memory, disk I/O and network; per-tenant quotas on concurrent sessions; scheduling that spreads a tenant's sessions so one tenant's burst does not starve a host.
Prove it. Canary tests across every path: a marker written in tenant A's workspace, build cache, snapshot and logs, then searched for from a session of tenant B through each read path, in CI and periodically in production. Hostile-snippet tests for each sandbox image. Regular review of cache keying when new caches are added.
What interviewers probe next
"Per-session microVMs are expensive at this scale." Snapshots and warm pools keep start-up cheap; density comes from memory sizing and idle-time overcommit of CPU. The cost of a cross-tenant incident is far higher.
"Enterprise customers ask for dedicated infrastructure." Dedicated host pools per tenant with the same images and controls; the isolation model does not change, only the sharing of hardware.
"Where do model provider calls fit?" Requests carry tenant identifiers for internal accounting; provider-side caching is per account, and any internal caching follows the tenant-keyed rule.
How it's scored
Weak: Containers per session on a shared cluster.
Hire: MicroVM or gVisor per session, egress control, per-session credentials and per-tenant storage.
Strong Hire: Covers compute, network, storage, credentials, shared caches and observability with the typical leak for each, keys every derived cache by tenant, sizes the fleet with memory-bound density and CPU overcommit, controls noisy neighbours, offers dedicated pools, and proves isolation with cross-tenant canaries and hostile-snippet tests.
Common mistakes
- Isolating compute and forgetting caches and snapshots.
- Reusing sandboxes between sessions for start-up speed.
- A flat network where sandboxes can reach each other.
- No tests that actually try to cross tenants.