KatInterview

Building a Cloud-Hosted Disposable Browser for Untrusted Web Content

System DesignModel answer
MediumModel answerSystem Designsystem-designremote-browser-isolationwebrtc

Last updated

Architect a platform that renders risky web pages in throwaway cloud sandboxes and streams the result to employees, covering isolation, streaming, state, policy and scale for 50k sessions.

Design a Disposable Cloud Browser Service for Employees

Your company wants to protect its workforce from malicious websites. Instead of letting a link open in the employee's own browser, the page should load and run inside a short-lived, locked-down browser in the cloud. The employee sees and interacts with the result through an ordinary browser tab.

Design this service end to end.

What the system must do

  1. Isolation: All HTML, JavaScript and CSS from the visited site is fetched and executed on a remote browser instance, never on the employee's device.
  2. Interactive viewing: The employee should feel as if they were using a normal local browser: scrolling, clicking, typing and watching video should all work smoothly.
  3. Administrator control: Admins can define rules that block particular sites or particular scripts.

Quality goals

  1. Responsiveness: Scrolling and clicking must feel almost immediate.
  2. Scale: Handle 50,000 simultaneous sessions for a globally distributed workforce.
  3. Containment: Nothing malicious may survive from one session to the next, and nothing may break out of the isolated environment.

What your answer should cover

  • The design of the remote browser host: how each instance is packaged and sandboxed (containers, micro-VMs, full virtual desktops, etc.).
  • The protocol that carries visuals from the remote browser to the user and carries input back.
  • How you treat session state, including reconnects and any data that should outlive a session.
  • The trade-off between sending rendered pixels and sending a reconstructed, sanitized version of the page's DOM to the client.

State your assumptions, do rough capacity math, and call out the main risks and trade-offs.

Hints

Hint 1

Start with sizing: estimate memory and CPU per browser instance, then derive host count, regional spread and aggregate egress bandwidth for 50,000 sessions. Also break a ~100 ms input-to-display budget into network, render, encode and decode parts.

Hint 2

Ask what the blast radius is if the browser's own sandbox is escaped. This should drive your choice between containers, user-space kernels and micro-VMs, and push you toward one-session-per-VM, no reuse, and egress only through a filtering proxy.

Hint 3

Separate state into two classes: runtime state (DOM, JS heap) that should never be saved, and opt-in user profile data (cookies for approved apps) that can be encrypted and rehydrated. Then think about enforcing policy at several layers: network proxy, inside the browser, and in the viewer.