Identify the multi-agent topology most prone to deadlock and the minimal defence
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Peer swarms deadlock when agents wait on each other with no central coordinator. The minimal defence is a watchdog timer on per-agent inactivity, not just max_turns.
Two kids at a doorway, each politely insisting the other goes first. Neither moves. Nobody is being rude, nobody is stuck in an infinite loop; they are just both waiting. That is what deadlock looks like in a peer swarm of agents. A supervisor topology avoids it because a parent figure is always making the next call. The fix in the swarm is a hall monitor with a stopwatch: if nobody has moved for 30 seconds, the monitor steps in, picks one kid, and tells them to go. The stopwatch is the watchdog, and you need it as well as a hard time limit on the whole game, because the game can be inside its time limit while the kids are still frozen at the door.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
6 to 8 min: why peer swarms deadlock and others do not + the difference from loops and from max_turns overruns + watchdog mechanics + the arbiter handler + complementary defences (cycle detection, typed protocols, timeouts).
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Assuming max_turns prevents deadlock. Max_turns counts turns taken; if no agent is taking a turn (both blocked on each other's result), the counter never advances and the run hangs until the wall-clock kills it.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.