Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Composable AI Function Platform

Design a shared SDK and runtime for versioned, typed AI functions that execute consistently on developer machines and distributed infrastructure.

Problem statement

For this exercise, assume engineering teams build reusable AI-powered functions through a shared SDK. A function version declares typed input and output schemas, immutable code or handler identity, dependencies on other functions, and optional model or tool capabilities.

Developers must validate and run the same definition locally, then publish it for distributed execution without changing its contract. The platform validates registrations, resolves a versioned acyclic dependency graph, admits executions, schedules ready nodes, and returns a durable terminal result.

Some nodes invoke model inference or registered MCP-compatible tools, so credentials and permissions must remain isolated from function code.

Every distributed run must produce an end-to-end trace that identifies the exact function, dependency, model, tool, and schema versions used and supports debugging and audit review.

Define the extension model, SDK and runtime contracts, registry, execution control plane, worker protocol, observability, and failure recovery. Model training, arbitrary user-supplied infrastructure, a general-purpose package manager, and authoring external tools are outside scope.

What to build

  1. An authorized team can validate and publish an immutable function version with typed input and output schemas, declared function dependencies, and bounded model or tool capabilities.
  2. A developer can execute a versioned function graph locally, and an application can idempotently start the same graph on the distributed runtime with equivalent contract validation and observable outcomes.
  3. The runtime resolves compatible versions, executes ready nodes after their dependencies succeed, and returns explicit success, validation, dependency, cancelled, or failed outcomes.
  4. Authorized developers can inspect a complete run trace that binds inputs and outputs to function, dependency, schema, model, tool, policy, and attempt versions without exposing another team's secrets.

At scale

  • For this exercise, assume 500 engineering teams, 50,000 published function versions, and dependency graphs of at most 50 nodes and 10 levels.
  • For this exercise, assume 5,000 new distributed runs per second at peak with tenfold bursts, while individual model and tool calls may take from milliseconds to five minutes.
  • For this exercise, validate and durably accept a healthy distributed run within 500 milliseconds at p95, and make committed trace events searchable within one minute.
  • For this exercise, retain run and trace metadata for 90 days, and do not lose an accepted run, committed node outcome, or audit record after one availability-zone failure.