Confluent Certified Developer for Apache Kafka CCDAK Exam Questions

Page: 1 / 14
Total 150 questions
Question 1

StreamsBuilder builder = new StreamsBuilder();

KStream textLines = builder.stream("word-count-input");

KTable wordCounts = textLines

.mapValues(textLine -> textLine.toLowerCase())

.flatMapValues(textLine -> Arrays.asList(textLine.split("\W+")))

.selectKey((key, word) -> word)

.groupByKey()

.count(Materialized.as("Counts"));

wordCounts.toStream().to("word-count-output", Produced.with(Serdes.String(), Serdes.Long()));

builder.build();

What is an adequate topic configuration for the topic word-count-output?



Answer : D

Result is aggregated into a table with key as the unique word and value its frequency. We have to enable log compaction for this topic to align the topic's cleanup policy with KTable semantics.


Question 2

We have a store selling shoes. What dataset is a great candidate to be modeled as a KTable in Kafka Streams?



Answer : A, C

Aggregations of stream are stored in table, whereas Streams must be modeled as a KStream to avoid data explosion


Question 3

We would like to be in an at-most once consuming scenario. Which offset commit strategy would you recommend?



Answer : D

Here, we must commit the offsets right after receiving a batch from a call to .poll()


Question 4

A consumer starts and has auto.offset.reset=none, and the topic partition currently has data for offsets going from 45 to 2311. The consumer group has committed the offset 10 for the topic before. Where will the consumer read from?



Answer : C

auto.offset.reset=none means that the consumer will crash if the offsets it's recovering from have been deleted from Kafka, which is the case here, as 10 < 45


Question 5

A consumer starts and has auto.offset.reset=latest, and the topic partition currently has data for offsets going from 45 to 2311. The consumer group has committed the offset 643 for the topic before. Where will the consumer read from?



Answer : C

The offsets are already committed for this consumer group and topic partition, so the property auto.offset.reset is ignored


Question 6

How will you read all the messages from a topic in your KSQL query?



Answer : C

Consumers can set auto.offset.reset property to earliest to start consuming from beginning. For KSQL, SET 'auto.offset.reset'='earliest';


Question 7

Using the Confluent Schema Registry, where are Avro schema stored?



Answer : D

The Schema Registry stores all the schemas in the _schemas Kafka topic


Page:    1 / 14   
Total 150 questions