Design an AI Agent Task Runner

HardAIWorkflow OrchestrationSandboxingLLMsLong-running TasksAbout 45 minutes

Design a platform that runs AI agents for users: an agent gets a task (for example 'fix this failing test in my repository'), plans, calls tools such as code execution, web search, and APIs in a loop, and may run for up to an hour. Users watch progress live and can stop it. Plan for 100,000 agent runs per day and 2,000 running at once.

How the interview goes

Five phases, and questions the interviewer is likely to ask in each.

  1. 1. Requirements

    • What is the most an agent run may cost?
    • Which actions need a human's approval?
    Show a hint

    Ask what the agent is allowed to touch, and what must be approved.

  2. 2. High-level design

    • What state must survive a worker crash?
    • Where do tool calls run?
    Show a hint

    Treat a run as a durable workflow rather than a long function call.

  3. 3. Deep dive

    • Walk me through resuming a run whose worker died during step 14.
    • How do you cancel a tool that is mid-execution?
    Show a hint

    Code the agent writes is untrusted code.

  4. 4. Scaling

    • 2,000 concurrent sandboxes: how do you start them fast enough?
    • How do you share capacity fairly between users?
    Show a hint

    Limits need to be enforced by the platform, not left to the model.

  5. 5. Trade-offs

    • Checkpoint every step or replay from the event log?
    • Containers versus microVMs for isolation?
    Show a hint

    Stronger isolation usually means slower startup.

Practice this with an AI interviewer

Write your design doc with live diagrams while the interviewer asks one question at a time and pushes on your choices. Get a scored debrief with what to study next.

Start this interview