Skip to main content

Three agents work in parallel on one codebase, keep overwriting each other's changes, and two of them made opposite design decisions. How do you redesign the system?

Agents and tools · Pro 2

Short answer

The agents share state without ownership or a shared record of decisions. I would give each agent a separate area and an isolated workspace such as its own branch, let one coordinator make cross-cutting decisions and write them where all agents read them, and merge through tests. Tightly coupled work should go back to one agent or run in sequence.

Deeper answer

Parallel agents are like a team that never talks and has no version control. Each one has its own context, so none knows what the others decided. Two fixes are needed: isolation for the work, and a shared source of truth for decisions.

Isolation means each agent works on its own branch or copy, on files it owns, and changes are merged in a controlled step with tests. A shared decision record means choices that affect everyone, such as the API shape or the error format, are made once by the coordinator and written to a file that every agent's brief includes. If two tasks touch the same module, they are not independent, so I would run them one after the other. I would also ask whether three agents are needed at all. Parallel work pays when tasks are truly separate, like research on different topics. Interviewers listen for ownership, isolation, one place for decisions, and the honesty to reduce the number of agents.

What a strong answer covers

Answer it out loud in the mock interview about 2 min

Follow-ups to expect

Common mistakes

Learn it

Multi-agent systems

Practice Agents and tools questions

More on this topic

Today's AI turns are used

Lessons, roadmaps, videos, practice cards and the code playground stay free with your account, with no limit.