Phase 06 · AI AgentsLesson 4 of 4
Project: Multi-Agent DSA Solver
Combine everything so far: a team of agents that solves coding problems.
The problem
This project brings the whole track together: Python, DSA and multi-agent design. You'll build a small team of agents that can read a coding problem, write a solution, test it and improve it, much like a pair-programming session where every role is played by an AI.
The concept
Deep dive: 2h 47m video. You don’t need it all in one sitting. Watch the first 20 minutes for the core idea, read the write-up below, and come back for the rest when you need it.
The team design#
| Agent | Responsibility | Tools |
|---|---|---|
| Problem analyst | Restates the problem, identifies inputs, outputs and edge cases | None |
| Coder | Writes a Python solution and explains its time complexity | None |
| Tester | Writes test cases (including edge cases) and runs the code | Code execution |
| Reviewer | Checks correctness, efficiency and readability; approves or requests changes | None |
- Problem
- Analyst
- Coder
- Tester
- fails
- Coderfix
- passes
- Reviewer
- Approve
- Final answer
Why separate roles help#
A single model asked to "solve this problem" often produces code that looks right but fails edge cases. Splitting the job forces each step to happen explicitly: someone must think about edge cases, someone must actually run tests. This is the same reason human teams separate writing and reviewing.
Build it step by step#
- Start with one agent: the coder alone, on an easy problem (two-sum). Confirm the basic setup works.
- Add the tester with code execution in a sandbox. Watch the coder fix its own errors from real test output.
- Add the analyst in front, and compare: do solutions handle edge cases better?
- Add the reviewer with a clear rule: approve only if all tests pass and complexity is stated.
- Add termination: stop on approval or after a maximum number of rounds.
Make it observable#
Log every message with the agent's name and the round number. When the system fails, the log shows exactly where: was the problem misunderstood, was the code wrong, or were the tests weak?
Evaluate it properly#
Create a set of 10–20 problems of mixed difficulty with known correct answers. Track:
- How many are solved correctly
- How many rounds each takes
- Total tokens (cost) per problem
Then improve one thing at a time (a clearer instruction, a better test prompt) and re-run the same set. That's real engineering, not guesswork.
Try it
Your task · about 10 minutes
Rebuild the project with a different task, such as summarising articles or reviewing pull requests, and add it to your portfolio.
Recap & next
Key takeaways
- Split the job into roles: one agent understands the problem, one writes code, one reviews and tests.
- Give agents tools to execute and verify code rather than trusting the first answer.
- Log every step so you can see where the team goes wrong and improve prompts.
- A project like this makes a strong portfolio piece because it shows agents, Python and DSA together.
Quick check
2 questions · instant feedback
Go deeper
The full course on AI agents
Udemy course
Building AI Agents & Agentic AI System via Microsoft AutoGen
View course (opens Udemy in a new tab)
Want to train your team on this? Talk about corporate training
Finished this lesson?
Mark it complete to track your progress and keep your streak going.