Kafka MCQs – Kafka Schema Registry (Avro Support)

21.) What is the default Avro compression codec?

A) gzip
B) snappy
C) deflate
D) null

Answer: Option D

Explanation: Avro uses no compression (null) by default but supports others like deflate and snappy.

22.) Which library is used to compile .avsc files to Java classes?

A) Avro Tools
B) Kafka Streams
C) Zookeeper Tools
D) Confluent CLI

Answer: Option A

Explanation: Apache Avro Tools can generate Java classes from .avsc files.

23.) What is the benefit of using Avro over JSON in Kafka?

A) Larger file sizes
B) Better human readability
C) Schema evolution support and compact binary format
D) Lack of schema validation

Answer: Option C

Explanation: Avro is schema-aware and more compact than JSON.

24.) How is a schema uniquely identified in the registry?

A) By its schema ID
B) By its version number
C) By its subject name
D) By the broker

Answer: Option A

Explanation: Each schema is assigned a unique schema ID used during serialization.

25.) What happens if a producer sends Avro data without schema ID?

A) Schema is auto-assigned
B) Data is rejected
C) Kafka assigns a random ID
D) Data is serialized in JSON

Answer: Option B

Explanation: The Avro serializer includes the schema ID from Schema Registry for deserialization.

Leave a Reply

Your email address will not be published. Required fields are marked *