Bird
Raised Fist0
Agentic AIml~20 mins

Workflow orchestration across agents in Agentic AI - Practice Problems & Coding Challenges

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Challenge - 5 Problems
🎖️
Master of Workflow Orchestration
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the main role of a workflow orchestrator in multi-agent AI systems?

Imagine you have several AI agents working together to complete a complex task. What does the workflow orchestrator do?

AIt manages the order and timing of tasks among agents to ensure smooth collaboration.
BIt trains each agent individually without coordinating their tasks.
CIt only collects data from agents but does not control their actions.
DIt replaces all agents by performing all tasks itself.
Attempts:
2 left
💡 Hint

Think about how a conductor leads musicians in an orchestra.

Model Choice
intermediate
2:00remaining
Which model architecture best supports workflow orchestration across multiple AI agents?

You want to design a system where multiple AI agents communicate and coordinate their actions. Which architecture is most suitable?

ACentralized controller that sends commands and receives feedback from agents.
BIndependent agents working in isolation without communication.
CSingle monolithic model handling all tasks without delegation.
DRandom task assignment without any coordination.
Attempts:
2 left
💡 Hint

Think about a manager who assigns tasks and checks progress.

Metrics
advanced
2:00remaining
Which metric best measures the efficiency of workflow orchestration across agents?

You want to evaluate how well your orchestrator coordinates multiple agents to complete a task quickly and correctly. Which metric should you use?

AMemory usage of each agent individually.
BNumber of agents in the system.
CTotal task completion time combined with task success rate.
DNumber of lines of code in the orchestrator.
Attempts:
2 left
💡 Hint

Think about measuring speed and correctness together.

🔧 Debug
advanced
2:00remaining
Why does this orchestrator code cause deadlock when coordinating agents?

Consider this simplified pseudocode for an orchestrator:

while not all_tasks_done:
    for agent in agents:
        if agent.waiting_for_response:
            continue
        task = get_next_task(agent)
        send_task(agent, task)
        wait_for_agent_response(agent)

Why might this cause a deadlock?

ABecause agents never receive any tasks.
BBecause the orchestrator waits for each agent's response before sending tasks to others, blocking progress.
CBecause the loop never checks if all tasks are done.
DBecause the orchestrator sends tasks too quickly without waiting.
Attempts:
2 left
💡 Hint

Think about waiting for one agent blocking others.

Predict Output
expert
3:00remaining
What is the output of this multi-agent orchestration simulation?

Given the following Python code simulating two agents coordinated by an orchestrator, what is printed?

Agentic AI
class Agent:
    def __init__(self, name):
        self.name = name
        self.tasks_done = 0
    def perform_task(self):
        self.tasks_done += 1
        return f"{self.name} done task {self.tasks_done}"

class Orchestrator:
    def __init__(self, agents):
        self.agents = agents
    def run(self):
        results = []
        for _ in range(2):
            for agent in self.agents:
                results.append(agent.perform_task())
        return results

agents = [Agent("A1"), Agent("A2")]
orch = Orchestrator(agents)
output = orch.run()
print(output)
A["A2 done task 1", "A1 done task 1", "A2 done task 2", "A1 done task 2"]
B["A1 done task 1", "A1 done task 2", "A2 done task 1", "A2 done task 2"]
C["A1 done task 1", "A2 done task 1"]
D["A1 done task 1", "A2 done task 1", "A1 done task 2", "A2 done task 2"]
Attempts:
2 left
💡 Hint

Look at the nested loops: outer loop runs twice, inner loop runs over agents.

Practice

(1/5)
1. What is the main purpose of workflow orchestration across AI agents?
easy
A. To replace human decision-making completely
B. To organize tasks and coordinate multiple AI agents step-by-step
C. To store large amounts of data for AI agents
D. To train a single AI model faster

Solution

  1. Step 1: Understand workflow orchestration

    Workflow orchestration means managing how different AI agents work together in order.
  2. Step 2: Identify the main goal

    The goal is to organize tasks and share data smoothly between agents, not just training or storage.
  3. Final Answer:

    To organize tasks and coordinate multiple AI agents step-by-step -> Option B
  4. Quick Check:

    Workflow orchestration = Organize tasks [OK]
Hint: Think: Who manages the team of AI agents? [OK]
Common Mistakes:
  • Confusing orchestration with data storage
  • Thinking it only speeds up training
  • Assuming it replaces humans fully
2. Which syntax correctly defines a simple orchestrator function that calls two agents sequentially in Python?
easy
A. def orchestrate():\n agent1()\n agent2()
B. function orchestrate { agent1(); agent2(); }
C. orchestrate() => { agent1(); agent2(); }
D. def orchestrate[]: agent1() agent2()

Solution

  1. Step 1: Identify correct Python function syntax

    Python functions use 'def name():' and indentation for the body.
  2. Step 2: Check each option

    def orchestrate():\n agent1()\n agent2() uses correct Python syntax; others use JavaScript or invalid syntax.
  3. Final Answer:

    def orchestrate():\n agent1()\n agent2() -> Option A
  4. Quick Check:

    Python function = def + colon + indent [OK]
Hint: Python functions start with 'def' and use indentation [OK]
Common Mistakes:
  • Using JavaScript or other language syntax in Python
  • Missing colon after function name
  • Not indenting function body
3. Given this Python code for orchestrating agents:
def agent1():
    return 'data1'
def agent2(input_data):
    return input_data + '_processed'
def orchestrate():
    d1 = agent1()
    d2 = agent2(d1)
    return d2
print(orchestrate())

What is the output?
medium
A. data1_processed
B. data1
C. processed_data1
D. None

Solution

  1. Step 1: Trace agent1() output

    agent1() returns 'data1', stored in d1.
  2. Step 2: Trace agent2(d1) output

    agent2('data1') returns 'data1_processed', stored in d2.
  3. Step 3: Return and print d2

    orchestrate() returns 'data1_processed', which is printed.
  4. Final Answer:

    data1_processed -> Option A
  5. Quick Check:

    agent2 output = input + '_processed' [OK]
Hint: Follow data flow step-by-step through functions [OK]
Common Mistakes:
  • Ignoring return values
  • Confusing input and output of agents
  • Assuming print shows None
4. This orchestrator code has an error:
def agent1():
    return 'step1'
def agent2(data):
    return data + ' step2'
def orchestrate():
    d1 = agent1
    d2 = agent2(d1)
    return d2
print(orchestrate())

What is the error and how to fix it?
medium
A. agent2 should not take any arguments; remove data parameter
B. print statement syntax is wrong; use print[orchestrate()]
C. orchestrate() should not return anything; remove return
D. agent1 is missing parentheses; fix by calling agent1()

Solution

  1. Step 1: Identify how agent1 is used

    agent1 is assigned without parentheses, so d1 is a function, not a string.
  2. Step 2: Fix by calling agent1()

    Change d1 = agent1 to d1 = agent1() to get the return value.
  3. Final Answer:

    agent1 is missing parentheses; fix by calling agent1() -> Option D
  4. Quick Check:

    Function call needs () [OK]
Hint: Remember: functions need () to run and return values [OK]
Common Mistakes:
  • Confusing function object with function call
  • Changing unrelated parts like print syntax
  • Removing needed parameters
5. You want to design a workflow where Agent A fetches data, Agent B cleans it, and Agent C analyzes it. Which orchestration approach best ensures data flows correctly and each step waits for the previous one?
hard
A. Call Agent C first, then Agent B, then Agent A
B. Run all agents in parallel without waiting for outputs
C. Use a sequential orchestrator that calls Agent A, then B with A's output, then C with B's output
D. Let each agent run independently and save results to separate files

Solution

  1. Step 1: Understand the workflow dependencies

    Agent B needs data from Agent A, and Agent C needs data from Agent B, so order matters.
  2. Step 2: Choose orchestration that respects order

    Sequential orchestration ensures each agent runs after the previous finishes and passes data forward.
  3. Final Answer:

    Use a sequential orchestrator that calls Agent A, then B with A's output, then C with B's output -> Option C
  4. Quick Check:

    Sequential calls = correct data flow [OK]
Hint: Follow data dependencies step-by-step in order [OK]
Common Mistakes:
  • Running agents in parallel ignoring dependencies
  • Reversing the order of agents
  • Letting agents save results separately without coordination