Serializers & Schema Registry — Concept Check
Questions on Serializers & Schema Registry. Serializers convert Java objects to bytes; the Confluent Schema Registry enforces Avro/JSON/Protobuf schemas and enables schema evolution with backward/forward compatibility.
Questions in this quiz
8 questions on Serializers & Schema Registry — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A Kafka producer is configured with KafkaAvroSerializer. What happens when it sends a message for the first time?
- AThe schema ID is appended to the message after sending.
- BThe schema is registered in the Schema Registry and schema ID is prepended to the message.
- CThe schema is registered only if the consumer requests it.
- DThe message is sent without schema registration and schema ID.
2.You add a new field with a default value to an existing Avro schema. What compatibility rule does this follow?
- ABACKWARD compatibility
- BFORWARD compatibility
- CFULL compatibility
- DNo compatibility
3.A team decides to remove a required field from an Avro schema. What impact will this have?
- AIt only affects consumers using JSON Schema.
- BIt enhances forward compatibility, as new consumers can ignore missing fields.
- CIt has no impact on compatibility, as fields are optional by default.
- DIt breaks backward compatibility, as old consumers expect the field.
4.A developer uses Spring Kafka's JsonSerializer without Schema Registry. What is a potential risk?
- AMessages cannot be serialized, causing application failure.
- BConsumers cannot deserialize messages, leading to data loss.
- CSerialization becomes slower due to lack of registry.
- DSchema governance is lost, leading to potential data inconsistencies.
5.In a Spring Boot application, what property is used to configure the Schema Registry URL for JSON serialization?
- Aspring.kafka.properties.schema.registry.url
- Bspring.kafka.consumer.registry.url
- Cspring.kafka.producer.schema.url
- Dspring.kafka.schema.registry.endpoint
6.A producer adds a new optional field without a default value. Which compatibility rule does this violate?
- AFULL compatibility
- BBACKWARD compatibility
- CFORWARD compatibility
- DNo compatibility rule is violated
7.A developer believes that JSON Schema in Spring Boot automatically registers schemas. What is the reality?
- ASchemas must be manually registered in the Schema Registry.
- BSchemas are registered only when a consumer requests them.
- CSchemas are never registered in the Schema Registry.
- DSchemas are automatically registered without any configuration.
8.What is the role of the Confluent Schema Registry in a Kafka setup?
- AIt enforces schema evolution and compatibility rules for Avro/JSON/Protobuf.
- BIt serializes Java objects to bytes for Kafka producers.
- CIt provides a backup of all Kafka messages.
- DIt acts as a message broker between producers and consumers.