KatInterview

Build a Pausable GPU Workspace Platform for Research Teams

System DesignModel answer
HardModel answerSystem Designsystem-designgpu-schedulingpersistent-storage

Last updated

Design a service that hands out isolated, GPU-backed Jupyter-style workspaces that can be started, paused, and resumed on any host without losing files or packages, while controlling idle GPU spend.

Problem

Your company wants an internal platform where machine learning engineers can request a personal compute workspace with one or more GPUs attached. The workspace runs a Jupyter-style notebook server. The engineer opens it in a browser, trains models and analyzes data, pauses it when they step away, and later resumes it with their files and installed packages exactly as they left them.

Design this platform end to end.

Things to settle up front

No scale, latency, or cost numbers are provided. State your own assumptions explicitly, for example:

  • The number of engineers and the peak count of concurrent workspaces.
  • The GPU types and counts a single workspace can request, and whether they can change after creation.
  • Target time for a new workspace to become usable, and for a paused one to resume. Is a short queue acceptable when no matching GPU is free?
  • What must survive a pause: only files, or also installed packages, background processes, and open terminals?
  • Whether workspaces start from a base image plus a setup spec, or start blank.
  • What counts as "idle" for automatic pausing: no browser connection, no GPU activity, or both.

Fixed requirements

  • Workspaces execute arbitrary user code, so each must be isolated from other workspaces and from the platform's control plane.
  • A workspace is stateful and long-lived. It may hold days of unsaved notebook state, installed libraries, large datasets, and model checkpoints.
  • GPUs are scarce and expensive. Idle GPU-backed workspaces must not consume budget indefinitely.

What to cover

  1. The workspace lifecycle: states, valid transitions, and the API surface.
  2. A latency budget for create and resume, and which steps can be prepared ahead of time.
  3. Storage that survives pause/resume and, ideally, host failure.
  4. How a browser reaches a workspace that may come back on a different machine.
  5. An idle-detection and auto-pause policy, and its cost versus user-experience trade-off.
  6. Isolation between workspaces and between workspaces and the control plane.

Hints

Hint 1

Separate what must be durable (files, installed packages, checkpoints) from what can be thrown away (the host, the container). If compute is disposable, resuming on a different machine stops being a special case.

Hint 2

Users should never hold a host address. Put a stable per-workspace endpoint in front, backed by a routing table the scheduler updates whenever a workspace is placed or moved.

Hint 3

Break startup into steps (image pull, GPU selection, volume attach, container start, connection) and ask which can be done before the user clicks. Pre-warmed images and a per-host free-GPU inventory remove most of the wait.

Hint 4

For idle detection, GPU utilization is a better signal of waste than an open browser tab. Pair any auto-pause with an advance warning and one-click resume.