Bird
Raised Fist0

Which of the following is the correct way to declare a Protobuf message field for an integer id?

easy📝 Syntax Q3 of Q15
Kafka - Schema Registry
Which of the following is the correct way to declare a Protobuf message field for an integer id?
Afloat id = 1;
Bstring id = 1;
Cint32 id = 1;
Dbool id = 1;
Step-by-Step Solution
Solution:
  1. Step 1: Recall Protobuf field syntax

    Protobuf fields use type, name, and tag number like 'int32 id = 1;'.
  2. Step 2: Match field type to integer

    int32 is the correct integer type; string, bool, float are different types.
  3. Final Answer:

    int32 id = 1; -> Option C
  4. Quick Check:

    Protobuf integer field = int32 [OK]
Quick Trick: Use int32 for integer fields in Protobuf [OK]
Common Mistakes:
MISTAKES
  • Using string type for numbers
  • Confusing bool with integer
  • Using float instead of int32

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kafka Quizzes