Bird
Raised Fist0
Agentic AIml~20 mins

CrewAI for multi-agent teams 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
🎖️
CrewAI Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding CrewAI's Team Coordination

In CrewAI, multiple agents work together to solve complex tasks. What is the primary mechanism that enables these agents to coordinate effectively?

AAgents share a centralized memory to exchange information and update their states.
BEach agent works independently without any communication to avoid conflicts.
CAgents randomly select tasks without any coordination to increase diversity.
DAgents rely solely on external human input to decide their next actions.
Attempts:
2 left
💡 Hint

Think about how agents can keep track of what others are doing to avoid repeating work.

Predict Output
intermediate
2:00remaining
Output of CrewAI Agent Interaction Code

Consider the following simplified Python code snippet simulating two CrewAI agents updating a shared task list. What will be the final content of shared_tasks after running?

Agentic AI
shared_tasks = ['task1']

def agent1():
    shared_tasks.append('task2')

def agent2():
    shared_tasks.append('task3')

agent1()
agent2()
print(shared_tasks)
A['task2', 'task3']
B['task1', 'task2', 'task3']
C['task1', 'task3', 'task2']
D['task1']
Attempts:
2 left
💡 Hint

Both agents add tasks sequentially to the shared list.

Model Choice
advanced
2:30remaining
Choosing the Best Model Architecture for CrewAI Agents

You want to design CrewAI agents that can remember past interactions and adapt their strategies over time. Which model architecture is best suited for this?

ASimple linear regression model
BFeedforward Neural Network without memory components
CConvolutional Neural Network (CNN) designed for image data
DRecurrent Neural Network (RNN) with gated units like LSTM or GRU
Attempts:
2 left
💡 Hint

Think about models that can handle sequences and remember previous inputs.

Hyperparameter
advanced
2:30remaining
Optimizing CrewAI Agent Collaboration via Hyperparameters

In CrewAI, agents communicate through messages. Which hyperparameter adjustment would most likely improve the quality of their collaboration?

ADisabling message passing to speed up computation
BReducing the number of agents to a single agent
CIncreasing the message passing frequency between agents
DSetting the learning rate to zero
Attempts:
2 left
💡 Hint

More frequent communication can help agents stay updated.

🔧 Debug
expert
3:00remaining
Debugging CrewAI Agent Deadlock Scenario

Two CrewAI agents are stuck waiting for each other's messages indefinitely, causing a deadlock. Which change will fix this deadlock?

Agentic AI
agent1_waiting = True
agent2_waiting = True

while agent1_waiting and agent2_waiting:
    # Both agents wait for each other's message
    pass

# Fix needed here
AIntroduce a timeout mechanism so agents stop waiting after a fixed time
BIgnore message passing and let agents act randomly
CMake both agents wait longer to ensure messages arrive
DRemove the while loop to let agents run without waiting
Attempts:
2 left
💡 Hint

Think about how to prevent infinite waiting in real life.

Practice

(1/5)
1. What is the main purpose of CrewAI in multi-agent teams?
easy
A. To replace human workers completely
B. To train a single AI model faster
C. To let multiple AI agents work together as a team
D. To store large amounts of data

Solution

  1. Step 1: Understand CrewAI's role

    CrewAI is designed to enable multiple AI agents to collaborate.
  2. Step 2: Compare options

    Only To let multiple AI agents work together as a team correctly describes teamwork among AI agents, while others describe unrelated tasks.
  3. Final Answer:

    To let multiple AI agents work together as a team -> Option C
  4. Quick Check:

    CrewAI teamwork = To let multiple AI agents work together as a team [OK]
Hint: CrewAI means teamwork among AI agents [OK]
Common Mistakes:
  • Thinking CrewAI trains a single model
  • Confusing data storage with teamwork
  • Assuming CrewAI replaces humans fully
2. Which of the following is the correct way to create a CrewAI team in Python?
easy
A. team = CrewAI.create(['agent1', 'agent2'])
B. crew = create_team(CrewAI, ['agent1', 'agent2'])
C. team = CrewAI(['agent1', 'agent2']).create()
D. crew = CrewAI.create_team(['agent1', 'agent2'])

Solution

  1. Step 1: Recall CrewAI team creation syntax

    The correct method is calling create_team on CrewAI with a list of agents.
  2. Step 2: Check each option

    Only crew = CrewAI.create_team(['agent1', 'agent2']) matches the correct syntax; others misuse method names or order.
  3. Final Answer:

    crew = CrewAI.create_team(['agent1', 'agent2']) -> Option D
  4. Quick Check:

    Correct method call = crew = CrewAI.create_team(['agent1', 'agent2']) [OK]
Hint: Use CrewAI.create_team with agent list [OK]
Common Mistakes:
  • Swapping method and class names
  • Using wrong method like create() or create()
  • Passing agents incorrectly
3. Given this code snippet, what will be the output?
crew = CrewAI.create_team(['agentA', 'agentB'])
results = crew.assign_tasks(['task1', 'task2'])
print(results)
medium
A. {'agentA': 'task1 done', 'agentB': 'task2 done'}
B. ['task1 done', 'task2 done']
C. {'task1': 'agentA done', 'task2': 'agentB done'}
D. Error: assign_tasks method not found

Solution

  1. Step 1: Understand assign_tasks behavior

    assign_tasks assigns each task to an agent and returns a dictionary mapping agents to task results.
  2. Step 2: Match output format

    {'agentA': 'task1 done', 'agentB': 'task2 done'} shows agent-task mapping with completion messages, matching expected output.
  3. Final Answer:

    {'agentA': 'task1 done', 'agentB': 'task2 done'} -> Option A
  4. Quick Check:

    Agent-task result dict = {'agentA': 'task1 done', 'agentB': 'task2 done'} [OK]
Hint: assign_tasks returns agent-task result dictionary [OK]
Common Mistakes:
  • Expecting list instead of dict
  • Swapping keys and values in output
  • Assuming method does not exist
4. Identify the error in this CrewAI code snippet:
crew = CrewAI.create_team(['agent1', 'agent2'])
results = crew.assign_task(['task1', 'task2'])
print(results)
medium
A. Method name should be assign_tasks, not assign_task
B. Agent list should be a string, not a list
C. create_team does not accept a list argument
D. print cannot display results dictionary

Solution

  1. Step 1: Check method names

    The correct method to assign multiple tasks is assign_tasks, not assign_task.
  2. Step 2: Validate other parts

    Agent list as a list is correct; create_team accepts list; print can display dict.
  3. Final Answer:

    Method name should be assign_tasks, not assign_task -> Option A
  4. Quick Check:

    Correct method name = Method name should be assign_tasks, not assign_task [OK]
Hint: Check method names carefully for plurals [OK]
Common Mistakes:
  • Using singular assign_task instead of assign_tasks
  • Thinking agent list must be string
  • Assuming print can't show dict
5. You want to create a CrewAI team where agents share partial results to improve overall problem-solving. Which CrewAI feature should you use?
hard
A. Task delegation without communication
B. Shared memory for agents to exchange information
C. Single-agent mode for faster processing
D. Random task assignment without feedback

Solution

  1. Step 1: Understand collaboration needs

    Sharing partial results requires agents to communicate and exchange information.
  2. Step 2: Identify CrewAI feature

    Shared memory allows agents to share data and improve teamwork effectively.
  3. Step 3: Eliminate wrong options

    Options A, C, and D do not support communication or collaboration.
  4. Final Answer:

    Shared memory for agents to exchange information -> Option B
  5. Quick Check:

    Agent communication = Shared memory = Shared memory for agents to exchange information [OK]
Hint: Use shared memory for agent collaboration [OK]
Common Mistakes:
  • Ignoring communication needs
  • Choosing single-agent mode mistakenly
  • Assuming random assignment helps collaboration