Design a Background Agent Orchestration System
Last updated: May 21, 2025
Quick Overview
Design the system that powers Cursor's Background Agents, which perform multi-step coding tasks autonomously. Cover task planning, execution sandboxing, progress reporting, and human-in-the-loop checkpoints.
Cursor
May 21, 202514
7
4,815 solved
Design the system that powers Cursor's Background Agents, which perform multi-step coding tasks autonomously. Cover task planning, execution sandboxing, progress reporting, and human-in-the-loop checkpoints.
Background Agents are one of Cursor's most advanced features. They take a high-level task description and autonomously plan and execute multi-step coding changes across a project. This question tests your ability to design an agentic system with proper sandboxing, progress visibility, and safety controls.
What the Interviewer Expects
- Design a task planning system that breaks high-level instructions into executable steps
- Implement execution sandboxing to prevent destructive actions
- Build a progress reporting system that gives users visibility into agent actions
- Design human-in-the-loop checkpoints for risky operations
- Handle failure recovery and partial rollback
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How would you prevent the agent from making destructive changes to production systems?
- How would you handle a task that requires more context than fits in a single LLM call?
- How would you evaluate agent task completion quality at scale?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
- Functional Requirements:
- Task planning: Break down high-level coding tasks into executable steps.
- Execution sandboxing: Execute code changes in isolated environments to prevent system co...
Capacity Estimation
- Assume Cursor has 10,000 active users, with 20% using background agents daily.
- If each user triggers an average of 3 tasks per day, that results in 6,000 tasks daily.
- To accommodate peak usage, ...