Bird
0
0

A bug causes the Dispatch Service to assign multiple drivers to the same ride request. What is the best way to fix this issue?

medium📝 Analysis Q7 of 15
Microservices - Real-World Architecture Case Studies
A bug causes the Dispatch Service to assign multiple drivers to the same ride request. What is the best way to fix this issue?
AIncrease the number of drivers in the system
BImplement a distributed lock to ensure one assignment per ride
CDisable the Notification Service temporarily
DAdd retries in the Payment Service
Step-by-Step Solution
Solution:
  1. Step 1: Understand the Problem

    Multiple drivers assigned means race condition or concurrency issue in Dispatch Service.
  2. Step 2: Choose Correct Fix

    Distributed locking prevents simultaneous assignments for the same ride.
  3. Final Answer:

    Implement a distributed lock to ensure one assignment per ride -> Option B
  4. Quick Check:

    Prevent race condition with distributed lock [OK]
Quick Trick: Use distributed lock to avoid duplicate assignments [OK]
Common Mistakes:
  • Increasing drivers won't fix assignment bug
  • Disabling Notification unrelated
  • Payment retries irrelevant here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes