Bird
0
0

Consider this pseudocode for a microservice using feature toggles:

medium📝 Analysis Q13 of 15
Microservices - Configuration and Secrets Management
Consider this pseudocode for a microservice using feature toggles:
if (featureToggle.isEnabled('betaFeature')) {
  return 'Beta feature active';
} else {
  return 'Beta feature inactive';
}
If the toggle betaFeature is OFF, what will be the output?
A'Beta feature active'
BError: toggle not found
C'Beta feature inactive'
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Understand toggle state effect on code flow

    If betaFeature is OFF, isEnabled returns false, so else branch runs.
  2. Step 2: Identify output from else branch

    Else branch returns 'Beta feature inactive'.
  3. Final Answer:

    'Beta feature inactive' -> Option C
  4. Quick Check:

    Toggle OFF = else output [OK]
Quick Trick: Toggle OFF triggers else branch output [OK]
Common Mistakes:
  • Assuming toggle OFF triggers if branch
  • Expecting error when toggle is off
  • Ignoring else branch output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes