Bird
0
0

Which pseudo-code correctly implements auto-scaling to add a broker if CPU usage exceeds 85% and remove a broker if it falls below 25%?

hard📝 Application Q8 of 15
Kafka - Kubernetes and Cloud Deployment
Which pseudo-code correctly implements auto-scaling to add a broker if CPU usage exceeds 85% and remove a broker if it falls below 25%?
Aif (cpu > 85) { add_broker() } else if (cpu < 25) { remove_broker() }
Bif (cpu < 25) { add_broker() } else if (cpu > 85) { remove_broker() }
Cif (cpu >= 85) { remove_broker() } else if (cpu <= 25) { add_broker() }
Dif (cpu > 25 && cpu < 85) { add_broker() } else { remove_broker() }
Step-by-Step Solution
Solution:
  1. Step 1: Understand conditions

    Add broker if CPU > 85%, remove if < 25%.
  2. Step 2: Evaluate options

    if (cpu > 85) { add_broker() } else if (cpu < 25) { remove_broker() } matches logic exactly.
  3. Final Answer:

    Option A -> Option A
  4. Quick Check:

    Correct thresholds and actions in if (cpu > 85) { add_broker() } else if (cpu < 25) { remove_broker() } [OK]
Quick Trick: Correct thresholds and actions in Option A [OK]
Common Mistakes:
  • Reversing add and remove actions
  • Using incorrect threshold comparisons
  • Combining conditions incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes