Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Managed User-Script Execution Platform

Design a platform that versions, triggers, isolates, and observes user-authored scripts without losing or duplicating executions.

Problem statement

For this exercise, assume teams upload immutable versions of user-authored scripts for two supported runtimes and attach a bounded resource, network, and secret-access policy. A team can invoke a version manually or configure a schedule or authenticated webhook trigger.

Every trigger occurrence must create or recover one durable execution bound to the exact script version, input reference, policy version, and trigger identity.

Scripts are untrusted. They run in isolated sandboxes with CPU, memory, wall-clock, output, and egress limits.

Users can observe queued, starting, running, cancelling, succeeded, failed, timed-out, and uncertain states, stream bounded logs, retrieve a result manifest, request cancellation, and retry according to policy.

Dispatch is at least once, so a lease-expired attempt must not overwrite a newer attempt or publish a second terminal result.

The platform cannot promise exactly-once external side effects made by arbitrary scripts; it must expose stable execution identity and enough evidence for a script or operator to make those effects idempotent or reconcile them.

An interactive IDE, source-control hosting, multi-step DAG workflows, arbitrary build pipelines, and cross-region active-active execution are outside scope.

What to build

  1. Teams can publish immutable script versions with validated runtime, resource, network, and secret-access policy.
  2. Manual, scheduled, or authenticated webhook triggers create or recover one durable execution for each stable trigger occurrence.
  3. The platform runs untrusted scripts in isolated, quota-enforced sandboxes and prevents stale attempts from overwriting the logical execution's authoritative result.
  4. Users can observe status and bounded logs, retrieve results, request cancellation, and reconcile timed-out or externally uncertain executions.

At scale

  • For this exercise, assume 100,000 active trigger definitions, 20 million executions per day, ordinary starts of 1,000 per second, and bursts of 5,000 starts per second.
  • For this exercise, assume up to 10,000 concurrent sandboxes, scripts lasting from one second to thirty minutes, packages up to 25 MB, and bounded logs plus result artifacts up to 100 MB per execution.
  • For this exercise, start 95 percent of admitted executions within thirty seconds and make committed status and log progress visible within two seconds; overload must return an explicit delayed or rejected outcome.
  • For this exercise, acknowledged script versions, triggers, executions, and terminal results survive one process or availability-zone loss; retain execution metadata for thirty days and log or result artifacts for seven days by default.