Bird
0
0

Consider this migration step code snippet for routing traffic:

medium📝 Analysis Q13 of 15
Microservices - Migration from Monolith
Consider this migration step code snippet for routing traffic:
if (user.isBetaTester) {
  routeToNewService();
} else {
  routeToOldService();
}
What will happen if a user is not a beta tester?
AUser traffic is dropped
BUser traffic goes to the new service
CUser traffic goes to the old service
DUser traffic causes an error
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the condition

    If user.isBetaTester is false, the else branch runs.
  2. Step 2: Determine routing for else branch

    The else branch calls routeToOldService(), so traffic goes to old service.
  3. Final Answer:

    User traffic goes to the old service -> Option C
  4. Quick Check:

    Non-beta users = old service routing [OK]
Quick Trick: False condition triggers else branch routing [OK]
Common Mistakes:
  • Assuming all users go to new service
  • Thinking traffic is dropped or errors occur
  • Ignoring the else branch logic

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes