Bird
0
0

Which of the following is the correct syntax to check CPU usage and add a broker in Kafka auto-scaling pseudo-code?

easy📝 Syntax Q3 of 15
Kafka - Kubernetes and Cloud Deployment
Which of the following is the correct syntax to check CPU usage and add a broker in Kafka auto-scaling pseudo-code?
Aif cpu_usage > 80% then add_broker()
Bif (cpu_usage > 80) add_broker()
Cif cpu_usage > 80 { add_broker }
Dif (cpu_usage > 80%) { add_broker() }
Step-by-Step Solution
Solution:
  1. Step 1: Review correct conditional syntax

    In many languages, conditions use parentheses and braces for blocks, but percentage signs are not valid in numeric comparisons.
  2. Step 2: Match syntax to pseudo-code style

    if (cpu_usage > 80) add_broker() uses correct syntax without invalid percentage sign.
  3. Final Answer:

    if (cpu_usage > 80) add_broker() -> Option B
  4. Quick Check:

    Correct syntax uses parentheses and no percentage sign [OK]
Quick Trick: Use parentheses and avoid % sign in conditions [OK]
Common Mistakes:
MISTAKES
  • Including percentage sign in condition
  • Missing parentheses or braces
  • Omitting function call parentheses

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes