Recall & Review
beginner
What does the filter operation do in Kafka Streams?
The filter operation keeps only the records that match a given condition, removing all others from the stream.
Click to reveal answer
beginner
What is the purpose of the map operation in Kafka Streams?
The map operation transforms each record in the stream by applying a function to change its key and/or value.
Click to reveal answer
intermediate
How do filter and map operations work together in a Kafka Streams pipeline?
First, filter removes unwanted records, then map changes the remaining records to a new form for further processing.
Click to reveal answer
beginner
In Kafka Streams, what type of function do you pass to the filter method?
You pass a predicate function that returns true for records to keep and false for records to discard.
Click to reveal answer
beginner
What does the map function return for each record in Kafka Streams?
It returns a new key-value pair, which can be different from the original record's key and value.
Click to reveal answer
What does the
filter operation do in Kafka Streams?✗ Incorrect
The filter operation keeps only records that satisfy the given condition.
What does the
map operation do in Kafka Streams?✗ Incorrect
Map transforms each record by applying a function to change its key and/or value.
Which function type is passed to
filter in Kafka Streams?✗ Incorrect
Filter requires a predicate function that returns true or false.
What happens if a record does not pass the
filter condition?✗ Incorrect
Records that do not meet the filter condition are removed from the stream.
In Kafka Streams, what is the output of the
map operation?✗ Incorrect
Map outputs a stream where each record is transformed to a new key-value pair.
Explain how you would use filter and map operations together in a Kafka Streams application.
Think about cleaning data first, then changing it.
You got /3 concepts.
Describe the type of function you pass to the filter operation and what it returns.
It's like a yes/no question for each record.
You got /3 concepts.