Launch price: every exam for $29.99 a year, for the first 300 buyers. See the price

CertStreak
Menu

Implement scaling and control of multi-agent spawning, batching, and concurrent execution

A worked example

Single answer

An orchestrator fans out four independent research agents in Microsoft Foundry and then synthesizes their results. Based on deployment monitoring, operations has established a maximum of two simultaneous agent calls. The design must meet these requirements:

  • Run as many agents at the same time as this concurrency limit allows.
  • Never exceed the operational concurrency limit.
  • Proceed to synthesis when at least three of the four agents succeed, and stop when fewer than three succeed.

Which concurrency control and failure policy should you implement?

Choose one answer
Why

A shared semaphore with two permits allows two agent calls at once while other calls wait for a permit. A minimum-quorum threshold of three implements the required success condition. Best-effort could accept too few results, while fail-fast could stop despite three successful agents.

  • Not correct: One shared asyncio.Semaphore(4) around agent calls, with a minimum-quorum policy of three agents. The quorum threshold is correct, but four semaphore permits allow the orchestrator to exceed the operational limit of two simultaneous calls.
  • Correct: One shared asyncio.Semaphore(2) around agent calls, with a minimum-quorum policy of three agents. The shared semaphore allows at most two simultaneous agent calls, and minimum-quorum requires at least three successful results before synthesis.
  • Not correct: One shared asyncio.Semaphore(2) around agent calls, with a best-effort policy. The semaphore meets the concurrency requirement, but best-effort permits synthesis with available results even when fewer than three agents succeed.
  • Not correct: One shared asyncio.Semaphore(2) around agent calls, with a fail-fast policy. The semaphore meets the concurrency requirement, but fail-fast stops on one failure even when the remaining three agents could satisfy the success threshold.
  • Not correct: One shared asyncio.Lock around agent calls, with a minimum-quorum policy of three agents. The quorum threshold is correct, but holding a shared lock throughout each call permits only one agent call at a time, below the required maximum allowed concurrency.

Practise this topic until it's automatic.

Ten questions a day, every answer explained, and misses that come back until you beat them.

Start free