Exam Questions Flashcards

1
Q

A consumer is configured with enable.auto.commit=false. What happens when close() is called on the consumer object?

A

A rebalance in the consumer group will happen immediately

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens when broker.rack configuration is provided in broker configuration in Kafka cluster?

A

Replicas for a partition are spread across different racks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You want to send a message of size 3 MB to a topic with default message size configuration. How does KafkaProducer handle large messages?

A

MessageSizeTooLarge exception will be thrown, KafkaProducer will not retry and return exception immediately

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What exceptions may be caught by the producer sending data to Kafka?

A

SerializationException
BufferExhaustedException

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What Kafka Streams operators are stateless?

A

map, filter, flatMap, branch, groupBy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what happens if you write the following code in your producer?
Producer.send(producerRecord).get()

A

Throughput will be decreased because .get() will wait for a reply from Kafka.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Can you change number of partitions after the topic is created? T/F

A

Yes, but you can only increase the number of partitions but not reduce it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What’s the default size of a log segment, eg. log.segment.bytes

A

1 GB

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In a KafkaProducer program our send() was configured with a callback onCompletion. The send was called and the callback parameters has RecordMetadata object that was null. What does this tell us about send method?

A

Object metadata being null means there was an error during send

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Where does Kafka Connector for Filestream Source track its offset?

A

Local File

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following defines map operation correctly from a Streaming Application perspective

A

Creates a new KStream by transforming each element in the current stream into a different element in the new stream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following defines flatMap operation correctly from a Streaming Application perspective?

A

Takes one record and produces zero, one, or more records. You can modify the record keys and values, including their types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Transactional Coordinator in Kafka?

A

A special module on any Broker

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How to implement authentication in Kafka?

A

Using Kerberos

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which of the below is not supported by Kafka?

(A)
Data in motion encryption
(B)
Data at rest encryption
(C)LUKS encryption
(D)
Kerberos with LDAP authentication

A

Data at rest encryption

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What’s the default path of log4j.properties?

A

/etc/kafka

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Authorization in Kafka is based on how many tuples match?

A

5

18
Q

How to configure Client quota?

A

Use kafka-configs command

19
Q

At the end of this code, which all topics will the consumer be sbscribed to: Properties props = new Properties(); props.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, “broker1:9092”); props.put(ConsumerConfig.GROUP_ID_CONFIG, “samplegroup”); props.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class); props.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class); KafkaConsumer consumer = new KafkaConsumer<>(props); consumer.subscribe(Arrays.asList(“my_topic”, “my_other_topic”)); consumer.subscribe(Arrays.asList(“last_topic”));

A

last_topic

20
Q

Which of the following is not a streaming framework?
(A) Kafka Streams
(B) Apache Storm
(C) Apache Samza
(D) Spark Streaming
(E) Kafka Connect
(F) Hive

A

Kafka Connect and Hive

21
Q

Number of Controllers in a 40 broker cluster are

A

1

22
Q

If a leader for a partition is lost due to failure, the new leader is elected by

A

Controller

23
Q

What does Offset mean/correspond to for the Kafka Connector Source for a database input?

A

timestamp or sequence id

24
Q

What does Offset mean/correspond to for the Kafka Connector Source for a file-based connector?

A

Position in the file or file name.

25
Q

Which metrics are critical for understanding Broker performance?
(A) LeaderCount
(B) FollowCount
(C) PartitionCount
(D) ISRCount

A

LeaderCount and ISRCount

26
Q

How does round robin partition works?

A

Fills messages evenly across partitions.

27
Q

What’s the role for a controller in Kafka?

A

In a Kafka cluster, one of the brokers serves as the controller, which is responsible for managing the states of partitions and replicas and for performing administrative tasks like reassigning partitions. At any given time there is only one controller broker in your cluster.
Reassgning partition leader too.

28
Q

Which method is used to start the streaming data in a Kafka Streams Application:

(A) start()
(B) stream()
(C) begin()
(D) consume
(E) subscribe

A

start()

29
Q

What is the default value for processing.guarantee in Kafka Streams:

A

at least once

30
Q

For Production workloads which is a preferred way to run KSQL:

(A) Headless
(B) Interactive

A

Headless

31
Q

True or False: Schema Registry runs as a separate JVM process

A

True

32
Q

Which of the following are internal Kafka-Connect topics? [Choose Two]

(A) connect-jars
(B) connect-offsets
(C) connect-status
(D) connect-schema

A

connect-offsets
connect-status

33
Q

What’s the default value of tasks.max in kafka connect?

A

1

34
Q

What does RecordMetadata contain?

A

Offset, Partition and Topic

35
Q

Which are correct signatures of send method(more than one option can be correct):
Incorrect
(A) producer.send(record)
(B) producer.send(record, callback)
(C) producer.send(record, exception)
(D) producer.send(record, callback, exception)

A

(A) producer.send(record)
(B) producer.send(record, callback)

36
Q

What is the main advantage of storing offsets outside Kafka in a transactional store :

A

For Achieving Exactly Once Semantic

37
Q

Where does KSQL store its data?

A

Kafka Cluster

38
Q

What is the difference between GroupByKey and GroupBy API in KStreams Library?
A) GroupBy causes always repartition
(B) GroupByKey causes always repartition
(C) GroupBy may cause repartition
(D) GroupByKey may cause repartition

A

(A) GroupBy causes always repartition
(D) GroupByKey may cause repartition

39
Q

What is the default Quota given to each client?

A

Infinite

40
Q

Which of the below metrics indicates Consumer lag?
(A) Records-lag-min
(B) Records-lag-max
(C) Consumer-lag-min
(D) Consumer-lag-max

A

(B) Records-lag-max

41
Q

What’s unclean.leader.election.enable?

A

unclean.leader.election.enable= true allows non ISR replicas to become leader, ensuring availability but losing consistency as data loss will occur.