Challenge - 5 Problems
Schema Registry Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Schema Registry API call?
Given a Schema Registry REST API call to get the latest schema for a subject, what is the expected output?
Kafka
curl -X GET http://localhost:8081/subjects/user-value/versions/latestAttempts:
2 left
💡 Hint
The latest schema for a subject returns detailed schema info including subject, version, id, and schema string.
✗ Incorrect
The GET request to /subjects/{subject}/versions/latest returns the latest schema version details for that subject, including subject name, version number, schema id, and the schema itself as a JSON string.
🧠 Conceptual
intermediate1:30remaining
What is the main purpose of a Schema Registry in Kafka?
Choose the best description of what a Schema Registry does in a Kafka ecosystem.
Attempts:
2 left
💡 Hint
Think about how Kafka producers and consumers agree on message formats.
✗ Incorrect
Schema Registry stores schemas centrally so producers and consumers can validate and evolve message formats safely, preventing incompatible changes.
🔧 Debug
advanced2:30remaining
Why does this Kafka producer fail when using Schema Registry?
A Kafka producer configured with Schema Registry throws an error when sending messages. What is the likely cause?
Kafka
Producer config:
{
"bootstrap.servers": "localhost:9092",
"key.serializer": "org.apache.kafka.common.serialization.StringSerializer",
"value.serializer": "io.confluent.kafka.serializers.KafkaAvroSerializer",
"schema.registry.url": "http://localhost:8081"
}
Error message: "org.apache.kafka.common.errors.SerializationException: Error serializing Avro message"Attempts:
2 left
💡 Hint
SerializationException often means the schema is missing or incompatible.
✗ Incorrect
KafkaAvroSerializer requires the schema to be registered in Schema Registry before serializing messages. If the schema is missing, serialization fails.
📝 Syntax
advanced2:00remaining
Which Avro schema is valid for registering in Schema Registry?
Select the valid Avro schema JSON string that can be registered in Schema Registry.
Attempts:
2 left
💡 Hint
Avro record fields must be an array of objects with 'name' and 'type' keys.
✗ Incorrect
Option A correctly defines a record with a name and an array of fields, each with 'name' and 'type'. Other options have missing or wrong structure.
🚀 Application
expert3:00remaining
How many schema versions exist after these operations?
You register a schema for subject 'order-value' three times with these schemas:
1) {"type":"record","name":"Order","fields":[{"name":"id","type":"int"}]}
2) {"type":"record","name":"Order","fields":[{"name":"id","type":"int"},{"name":"amount","type":"float"}]}
3) {"type":"record","name":"Order","fields":[{"name":"id","type":"int"},{"name":"amount","type":"float"}]}
How many versions will the subject 'order-value' have in Schema Registry?
Attempts:
2 left
💡 Hint
Schema Registry does not create a new version if the schema is identical to the latest one.
✗ Incorrect
The first registration creates version 1, the second a new version 2 because the schema changed, the third is identical to version 2 so no new version is created.