Bird
0
0

You want to process tasks in order but also prioritize urgent tasks immediately. Which queue-based approach fits best?

hard📝 Application Q15 of 15
Agentic AI - Production Agent Architecture
You want to process tasks in order but also prioritize urgent tasks immediately. Which queue-based approach fits best?
AUse a single queue and always pop from the front
BRandomly pick tasks from the queue to process
CUse a stack to process tasks last-in, first-out
DUse two queues: one for urgent tasks processed first, then normal tasks
Step-by-Step Solution
Solution:
  1. Step 1: Understand the need for prioritization

    Urgent tasks must be processed before normal tasks, so a single queue is not enough.
  2. Step 2: Choose a structure supporting priority

    Two queues let urgent tasks be handled first, then normal tasks, preserving order within each.
  3. Final Answer:

    Use two queues: one for urgent tasks processed first, then normal tasks -> Option D
  4. Quick Check:

    Two queues = priority handling [OK]
Quick Trick: Separate urgent and normal tasks in two queues [OK]
Common Mistakes:
  • Using one queue loses priority order
  • Using stack reverses task order
  • Random picking breaks order and priority

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Agentic AI Quizzes