Bird
0
0

Consider this pseudocode snippet in a microservice:

medium📝 Analysis Q13 of 15
Microservices - CI/CD for Microservices
Consider this pseudocode snippet in a microservice:
if (featureFlags.isEnabled('beta_feature')) {
  return 'Beta feature active';
} else {
  return 'Beta feature inactive';
}
What will be the output if the flag beta_feature is set to false?
ABeta feature inactive
BBeta feature active
CError: flag not found
DNo output
Step-by-Step Solution
Solution:
  1. Step 1: Understand flag value effect on condition

    The condition checks if beta_feature is enabled (true). If false, it goes to else branch.
  2. Step 2: Determine output when flag is false

    Since the flag is false, the else block executes returning 'Beta feature inactive'.
  3. Final Answer:

    Beta feature inactive -> Option A
  4. Quick Check:

    Flag false triggers else = Beta feature inactive [OK]
Quick Trick: False flag runs else block output [OK]
Common Mistakes:
  • Assuming false flag runs if block
  • Expecting error when flag is false
  • Ignoring else branch output

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes