0
0
Kafkadevops~20 mins

Cross-datacenter replication in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Cross-Datacenter Replication 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 MirrorMaker2 configuration snippet?
Given the following MirrorMaker2 configuration snippet, what will be the value of source.cluster.bootstrap.servers after parsing?
Kafka
clusters = {
  "source": {
    "bootstrap.servers": "source1:9092,source2:9092"
  },
  "target": {
    "bootstrap.servers": "target1:9092"
  }
}

source_bootstrap = clusters["source"]["bootstrap.servers"]
print(source_bootstrap)
A"target1:9092"
B"source1:9092,source2:9092"
C"source1:9092"
DKeyError
Attempts:
2 left
💡 Hint
Look at how the dictionary keys are accessed for the source cluster.
🧠 Conceptual
intermediate
1:30remaining
Which option best describes the role of MirrorMaker2 in cross-datacenter replication?
Select the correct description of MirrorMaker2's function in Kafka cross-datacenter replication.
AIt replicates Kafka topics from one cluster to another to ensure data availability across data centers.
BIt compresses Kafka messages to reduce network bandwidth usage within a single cluster.
CIt manages Kafka consumer group offsets locally without replication.
DIt provides a user interface for Kafka topic configuration.
Attempts:
2 left
💡 Hint
Think about what cross-datacenter replication means for Kafka data.
🔧 Debug
advanced
2:30remaining
What error does this MirrorMaker2 connector configuration cause?
Consider this MirrorMaker2 connector config snippet: ``` "source.cluster": "clusterA", "target.cluster": "clusterB", "topics": "^important-.*", "tasks.max": "two" ``` What error will occur when starting the connector?
AValueError: invalid literal for int() with base 10: 'two'
BNo error, connector starts successfully
CKeyError: 'tasks.max' not found
DTypeError: unsupported operand type(s) for +: 'int' and 'str'
Attempts:
2 left
💡 Hint
Check the expected data type for 'tasks.max' in Kafka connector configs.
📝 Syntax
advanced
1:30remaining
Which option correctly defines a Kafka Connect replication policy class in MirrorMaker2?
Choose the correct Java class name syntax for a custom replication policy in MirrorMaker2 configuration.
Acom.example.kafka.replication.customReplicationPolicy
Bcom.example.kafka.replication.CustomReplicationPolicy()
Ccom.example.kafka.replication.CustomReplicationPolicy
Dcom.example.kafka.replication.Custom_Replication_Policy
Attempts:
2 left
💡 Hint
Java class names follow a specific naming convention and do not include parentheses.
🚀 Application
expert
3:00remaining
How many topics will be replicated with this MirrorMaker2 topic regex?
If the source Kafka cluster has topics: ["orders", "orders-2023", "payments", "payments-2023", "logs", "logs-archive"], and MirrorMaker2 is configured with: ``` topics = "^(orders|payments)-2023$" ``` How many topics will MirrorMaker2 replicate?
A3
B1
C4
D2
Attempts:
2 left
💡 Hint
Check which topic names exactly match the regex pattern.