Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Online Code Compiler

Design a service that safely compiles and runs untrusted source code and returns durable execution results.

Problem statement

Design an online code compiler. Users submit source code and input, choose a supported language, and receive compilation diagnostics or execution output. Because the source only names the product, treat language count, traffic, retention, and execution limits as explicit interview assumptions.

For this practice version, assume executions are asynchronous, untrusted, isolated, and produce bounded stdout, stderr, status, and timeout results.

What to build

  1. Users can submit bounded source code and input for a supported language runtime.
  2. The platform compiles and runs each submission inside an isolated environment with enforced resource limits.
  3. Users can observe queued, running, and terminal execution states after disconnecting or reconnecting.
  4. Users can retrieve compilation diagnostics, bounded output, exit status, resource usage, or a timeout reason.
  5. Users can request cancellation of a queued or running submission.

At scale

  • Source fact: the interview prompt was to design an online code compiler.
  • No language count, traffic target, retention period, or runtime limit was supplied; candidates must state and justify those quantities.
  • Authoring assumption for practice: submitted programs are untrusted and must not access the host, other tenants, cloud credentials, or the public network.
  • Authoring assumption for practice: executions are asynchronous and return bounded output or an explicit terminal failure reason.