0
0
Kafkadevops~20 mins

Sink connectors in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Sink Connector Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this Kafka Connect sink connector configuration?
Given the following sink connector configuration snippet, what will be the value of the topics property after parsing?
Kafka
{
  "name": "my-sink-connector",
  "config": {
    "connector.class": "FileStreamSink",
    "tasks.max": "1",
    "topics": "topic1,topic2,topic3",
    "file": "/tmp/output.txt"
  }
}
A["topic1 topic2 topic3"]
B["topic1", "topic2", "topic3"]
Cnull
D"topic1,topic2,topic3"
Attempts:
2 left
💡 Hint
The topics property is a string listing topics separated by commas.
🧠 Conceptual
intermediate
1:30remaining
Which option best describes the role of a Kafka Sink Connector?
What is the main purpose of a Kafka Sink Connector in Kafka Connect?
ATo read data from external systems and write it into Kafka topics.
BTo monitor Kafka broker health and performance.
CTo read data from Kafka topics and write it into external systems.
DTo manage Kafka cluster configurations automatically.
Attempts:
2 left
💡 Hint
Sink connectors move data out of Kafka.
🔧 Debug
advanced
2:30remaining
Identify the error in this sink connector configuration snippet
This sink connector configuration is intended to write Kafka topic data to a file. What error will it cause?
Kafka
{
  "name": "file-sink",
  "config": {
    "connector.class": "FileStreamSink",
    "tasks.max": 1,
    "topics": ["my-topic"],
    "file": "/tmp/output.log"
  }
}
ARuntime error because 'tasks.max' must be a string
BSyntaxError due to JSON array in 'topics' property
CNo error; configuration is valid
DConfiguration error because 'file' path is invalid
Attempts:
2 left
💡 Hint
The 'topics' property expects a string, not an array.
📝 Syntax
advanced
2:00remaining
Which option correctly defines a sink connector with exactly 3 tasks?
Select the valid JSON snippet that sets up a sink connector with 3 parallel tasks.
A{ "name": "sink-connector", "config": { "connector.class": "JdbcSinkConnector", "tasks.max": "3", "topics": "orders", "connection.url": "jdbc:mysql://localhost:3306/shop" } }
B{ "name": "sink-connector", "config": { "connector.class": "JdbcSinkConnector", "tasks.max": 3, "topics": "orders", "connection.url": "jdbc:mysql://localhost:3306/shop" } }
C{ "name": "sink-connector", "config": { "connector.class": "JdbcSinkConnector", "tasks.max": "three", "topics": "orders", "connection.url": "jdbc:mysql://localhost:3306/shop" } }
D{ "name": "sink-connector", "config": { "connector.class": "JdbcSinkConnector", "tasks.max": "3 tasks", "topics": "orders", "connection.url": "jdbc:mysql://localhost:3306/shop" } }
Attempts:
2 left
💡 Hint
The 'tasks.max' property must be a string representing a number.
🚀 Application
expert
3:00remaining
How many tasks will run for this sink connector configuration?
Consider this sink connector config: { "name": "multi-task-sink", "config": { "connector.class": "FileStreamSink", "tasks.max": "5", "topics": "topicA,topicB" } } If the Kafka Connect cluster has only 3 worker nodes available, how many tasks will actually run?
AOnly 1 task will run because FileStreamSink supports a single task.
B5 tasks will run, distributed across the 3 workers.
C3 tasks will run, limited by the number of available workers.
DNo tasks will run due to configuration conflict.
Attempts:
2 left
💡 Hint
Some connectors limit the number of tasks regardless of 'tasks.max'.