Bird
0
0

Given the following pseudocode snippet for blue-green deployment traffic switching, which line correctly completes the switch?

easy📝 Conceptual Q3 of 15
Microservices - CI/CD for Microservices
Given the following pseudocode snippet for blue-green deployment traffic switching, which line correctly completes the switch?
active_env = "green"
new_env = "blue"
if active_env == "green":
    active_env = _____
else:
    active_env = new_env
Anew_env
B"green"
C"blue"
Dactive_env
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the condition

    If the active environment is green, we want to switch traffic to blue.
  2. Step 2: Complete the assignment

    Assigning active_env = "blue" correctly switches traffic to the new environment.
  3. Final Answer:

    "blue" -> Option C
  4. Quick Check:

    Switch active_env to the other environment name [OK]
Quick Trick: Switch active environment to the other color string [OK]
Common Mistakes:
  • Assigning active_env to itself causing no switch
  • Using variable new_env instead of string literal
  • Confusing the if-else branches

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes