Apache Kafka PracticeUltimate Exam, Exams of Technology

The Apache Kafka PracticeUltimate Exam is a powerful preparation tool for developers, system administrators, and data engineers seeking expertise in distributed event streaming and real-time data pipelines. This exam covers Kafka architecture, brokers, producers, consumers, topics, partitions, replication, Kafka Streams, Zookeeper coordination, message retention, fault tolerance, cluster configuration, security, and performance optimization. Learners gain hands-on familiarity with enterprise streaming concepts and improve their readiness for Kafka certification exams and production-level deployment scenarios.

Typology: Exams

2025/2026

Available from 05/11/2026

nicky-jone
nicky-jone 🇮🇳

2.9

(44)

28K documents

1 / 56

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Apache Kafka PracticeUltimate Exam
**Question 1. Which component is responsible for maintaining the metadata
of topics, partitions, and broker information in Kafka’s KRaft mode?**
A) ZooKeeper
B) Controller quorum
C) Kafka Streams
D) Schema Registry
Answer: B
Explanation: In KRaft mode the Controller quorum (a set of broker nodes)
stores and manages all metadata, eliminating the need for ZooKeeper.
**Question 2. In the Kafka log, what is the purpose of the index file
associated with each segment?**
A) To store the actual message payloads
B) To map offsets to physical file positions for fast reads
C) To keep track of consumer group offsets
D) To replicate data to followers
Answer: B
Explanation: The index file maps logical offsets to byte positions within the
segment file, enabling efficient random access.
**Question 3. Which configuration determines the minimum number of
in-sync replicas required for a write to be considered successful?**
A) replication.factor
B) min.insync.replicas
C) unclean.leader.election.enable
D) max.in.flight.requests.per.connection
Answer: B
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38

Partial preview of the text

Download Apache Kafka PracticeUltimate Exam and more Exams Technology in PDF only on Docsity!

Question 1. Which component is responsible for maintaining the metadata of topics, partitions, and broker information in Kafka’s KRaft mode? A) ZooKeeper B) Controller quorum C) Kafka Streams D) Schema Registry Answer: B Explanation: In KRaft mode the Controller quorum (a set of broker nodes) stores and manages all metadata, eliminating the need for ZooKeeper. Question 2. In the Kafka log, what is the purpose of the index file associated with each segment? A) To store the actual message payloads B) To map offsets to physical file positions for fast reads C) To keep track of consumer group offsets D) To replicate data to followers Answer: B Explanation: The index file maps logical offsets to byte positions within the segment file, enabling efficient random access. Question 3. Which configuration determines the minimum number of in-sync replicas required for a write to be considered successful? A) replication.factor B) min.insync.replicas C) unclean.leader.election.enable D) max.in.flight.requests.per.connection Answer: B

Explanation: min.insync.replicas specifies how many replicas must acknowledge a write before the producer receives an ack. Question 4. What happens when a leader broker crashes and unclean.leader.election.enable is set to false? A) A new leader is elected from any replica, even if out-of-sync B) No leader is elected until the previous leader recovers C) The partition becomes unavailable until a in-sync replica is promoted D) All data is lost for that partition Answer: C Explanation: With unclean leader election disabled, only in-sync replicas can become leaders, preventing potential data loss. Question 5. Which default partitioner strategy does Kafka use when a record key is null? A) Sticky partitioner B) Round-robin partitioner C) Uniform sticky partitioner D) Custom hash partitioner Answer: B Explanation: When the key is null, the default partitioner distributes records across partitions in a round-robin fashion. Question 6. In a custom partitioner, which method must be implemented to decide the target partition? A) configure() B) close() C) partition() D) onSend()

D) max.in.flight.requests.per.connection= Answer: A Explanation: Setting enable.idempotence=true makes the producer assign sequence numbers and deduplicate on the broker side. Question 10. What does the transactional.id property enable in a Kafka producer? A) Automatic schema registration B) Exactly-once semantics across multiple partitions and topics C) Compression of records D) Automatic partition assignment Answer: B Explanation: A non-null transactional.id activates transactional writes, allowing atomic writes to multiple partitions with EOS. Question 11. Which setting controls how long a producer will wait for additional records before sending a batch? A) batch.size B) linger.ms C) request.timeout.ms D) delivery.timeout.ms Answer: B Explanation: linger.ms defines the maximum time to buffer records before sending the batch, even if the batch is not full. Question 12. When using the cooperative sticky rebalancing protocol, what is the primary benefit compared to the classic protocol? A) Faster leader election B) Reduced pause time for consumers during rebalance

C) Automatic offset commit after each poll D) Increased replication factor Answer: B Explanation: Cooperative rebalancing allows existing assignments to stay active while only the changed partitions are reassigned, minimizing “stop-the-world” pauses. Question 13. Which consumer configuration enables static membership to avoid unnecessary rebalances when a consumer restarts? A) group.id B) client.id C) group.instance.id D) enable.auto.commit Answer: C Explanation: group.instance.id gives a consumer a stable identifier, allowing the group coordinator to treat restarts as the same member. Question 14. What is the difference between commitSync() and commitAsync() in the Kafka consumer API? A) commitSync blocks until the broker acknowledges, commitAsync returns immediately B) commitSync works only with manual offset management, commitAsync only with auto-commit C) commitSync commits offsets for all partitions, commitAsync commits only the current partition D) commitSync uses the latest offset, commitAsync uses the earliest offset Answer: A

D) It enables interactive queries on remote state stores Answer: B Explanation: A GlobalKTable is fully materialized on each task, allowing fast, local joins without repartitioning. Question 18. Which Single Message Transform (SMT) would you use to rename a field in a source connector record? A) InsertField B) ReplaceField C) MaskField D) TimestampRouter Answer: B Explanation: ReplaceField can rename, drop, or add fields in the record schema. Question 19. When configuring a Confluent Schema Registry client, which endpoint is required? A) bootstrap.servers B) schema.registry.url C) key.serializer D) value.deserializer Answer: B Explanation: schema.registry.url tells the client where to locate the registry service for schema registration and retrieval. Question 20. Which SASL mechanism provides mutual authentication using Kerberos tickets? A) PLAIN B) SCRAM-SHA-

C) GSSAPI

D) OAUTHBEARER

Answer: C Explanation: GSSAPI is the SASL mechanism that implements Kerberos, offering mutual authentication. Question 21. Which ACL operation permits a principal to read from any topic in a cluster? A) Allow READ on ResourcePattern(topic, "") B) Allow WRITE on ResourcePattern(cluster, "") C) Allow DESCRIBE on ResourcePattern(topic, "") D) Allow ALL on ResourcePattern(group, "") Answer: A Explanation: An ACL granting READ on a topic pattern with wildcard * allows the principal to consume from any topic. Question 22. Which JMX metric indicates the number of partitions that have fewer in-sync replicas than the configured min.insync.replicas? A) kafka.controller:type=Controller,name=ActiveControllerCount B) kafka.server:type=ReplicaManager,name=UnderReplicatedPartitions C) kafka.network:type=SocketServer,name=NetworkProcessorAvgIdlePercent D) kafka.log:type=Log,name=LogEndOffset Answer: B Explanation: UnderReplicatedPartitions tracks partitions whose ISR size is below the required minimum. Question 23. How can you measure consumer lag using the Kafka command-line tools? A) kafka-topics.sh --describe

A) Source connector B) Mirror connector C) Replication policy D) Offset syncs connector Answer: B Explanation: The Mirror connector reads from the source cluster and writes to the target, handling topic and offset replication. Question 27. In tiered storage, what is the role of the “remote log storage” layer? A) To store the most recent segment files for fast reads B) To archive older segment files to cheaper storage (e.g., S3) while keeping indexes locally C) To replicate data across multiple data centers D) To provide an alternative to Kafka Streams state stores Answer: B Explanation: Tiered storage offloads older log segments to remote object storage, reducing local disk usage while preserving the ability to serve historic reads. Question 28. Which client quota configuration limits the amount of data a producer can send per second? A) consumer_byte_rate B) request_percentage C) producer_byte_rate D) connection_creation_rate Answer: C Explanation: producer_byte_rate sets a throttle on the outgoing bytes per second for a producer client.

Question 29. Which pattern best describes “Cluster Linking” in Kafka? A) MirrorMaker 2 replicating all topics bidirectionally B) Direct, low-latency read-only access to remote cluster’s topics without full replication C) Using a single broker to proxy requests to multiple clusters D) Deploying a shared ZooKeeper ensemble across clusters Answer: B Explanation: Cluster Linking creates a read-only view of selected topics from a remote cluster, enabling low-latency access without full data duplication. Question 30. Which property controls the maximum number of bytes a consumer will fetch in a single poll request? A) max.poll.records B) fetch.max.bytes C) max.partition.fetch.bytes D) receive.buffer.bytes Answer: B Explanation: fetch.max.bytes limits the total bytes returned by the broker for a poll request. Question 31. In Kafka Streams, what is the effect of setting materialized.as("store-name") on a stateful operation? A) It disables fault-tolerance for that operation B) It creates a persistent state store with the given name that can be queried interactively C) It forces the operation to run on a single thread D) It changes the operation from a KTable to a KStream Answer: B

D) Sticky assignor Answer: C Explanation: Starting with 2.4, the default is the Incremental Cooperative Rebalance protocol, which performs cooperative rebalancing. Question 35. In a Kafka Connect sink connector, what does the topics.regex configuration enable? A) Automatic schema inference for all topics B) Subscribing to topics that match a regular expression pattern C) Publishing transformed records to a destination system D) Defining custom partitioning logic for the sink Answer: B Explanation: topics.regex allows the connector to consume any topic whose name matches the provided regex. Question 36. Which of the following is a valid reason to enable unclean.leader.election.enable? A) To guarantee zero data loss at any cost B) To allow a partition to have a leader even when all ISR replicas are down, improving availability C) To speed up log compaction D) To enforce exactly-once semantics for producers Answer: B Explanation: Enabling unclean leader election permits a non-ISR replica to become leader, increasing availability but risking data loss. Question 37. What is the effect of setting log.retention.ms to -1 for a topic? A) The topic will be deleted immediately after creation

B) No retention policy is applied; data is retained indefinitely C) Retention is based on size rather than time D) The broker will ignore the setting and use the default value Answer: B Explanation: A value of -1 disables time-based retention, keeping records forever unless size-based limits apply. Question 38. Which metric indicates the average time (in ms) a broker takes to process a produce request? A) request.handler.avg.idle.percent B) request.rate C) request.latency.avg D) produce.total.time.ms Answer: C Explanation: request.latency.avg (or kafka.network:type=BrokerTopicMetrics,name=TotalTimeMs) measures average request latency. Question 39. In a multi-tenant Kafka deployment, which feature helps prevent a single client from saturating network bandwidth? A) Compression.type B) Client quotas C) Sticky partitioner D) Log compaction Answer: B Explanation: Client quotas can limit the byte-rate for producers and consumers, protecting the cluster from “noisy neighbor” problems.

Question 43. Which of the following is a valid reason to use a compact cleanup policy on a topic? A) To retain all messages for a fixed period of time B) To keep only the latest value for each key, useful for change-log style data C) To guarantee exactly-once delivery for consumers D) To enable high-throughput batch processing Answer: B Explanation: cleanup.policy=compact removes older records for a key, retaining only the most recent, ideal for state reconstruction. Question 44. In a producer transaction, which call must be made before sending any records? A) beginTransaction() B) initTransactions() C) sendOffsetsToTransaction() D) commitTransaction() Answer: A Explanation: beginTransaction() starts a new transactional batch; initTransactions() is called once at startup, while beginTransaction() is required before each set of sends. Question 45. Which SSL configuration property specifies the file containing the broker’s private key and certificate chain? A) ssl.truststore.location B) ssl.keystore.location C) ssl.key.password D) ssl.endpoint.identification.algorithm Answer: B

Explanation: ssl.keystore.location points to the keystore that holds the broker’s private key and certificate chain. Question 46. What does the inter.broker.protocol.version broker setting control? A) The version of the Java client library used B) The maximum version of the Kafka protocol that brokers will use to communicate with each other C) The version of the Zookeeper ensemble D) The version of the schema registry API Answer: B Explanation: This setting ensures compatibility during rolling upgrades by limiting the inter-broker protocol version. Question 47. Which consumer configuration determines how many records are returned in each call to poll()? A) max.poll.records B) fetch.min.bytes C) max.partition.fetch.bytes D) poll.interval.ms Answer: A Explanation: max.poll.records caps the number of records returned per poll() call. Question 48. Which of the following is a characteristic of a “sticky” partitioner? A) It always assigns records to the same partition regardless of key B) It batches records to a partition until the batch is full, then switches to another partition

B) In the internal config topic C) In ZooKeeper D) In the Schema Registry Answer: B Explanation: Distributed mode stores connector configurations in the internal __connect-configs topic, enabling fault-tolerant management. Question 52. Which property controls the amount of time a broker will wait before flushing data to disk? A) log.flush.interval.messages B) log.flush.interval.ms C) log.segment.bytes D) log.retention.hours Answer: B Explanation: log.flush.interval.ms defines the periodic interval at which the broker forces a flush of dirty pages to disk. Question 53. What is the effect of setting compression.type=producer on a broker? A) The broker compresses all inbound messages regardless of producer settings B) The broker ignores producer compression settings and always stores uncompressed data C) The broker uses the compression type specified by the producer for each batch D) The broker applies a default compression (gzip) to all messages Answer: C Explanation: compression.type=producer tells the broker to respect the compression codec chosen by the producer for each batch.

Question 54. Which of the following is true about the offsets.topic.num.partitions setting? A) It determines the number of partitions for user-created topics B) It controls the partition count for the internal consumer offsets topic C) It sets the number of partitions for the transaction state topic D) It has no effect in KRaft mode Answer: B Explanation: This configuration sets how many partitions the __consumer_offsets topic will have. **Question 55. In the context of Kafka Streams, what is a “repartition” step? ** A) A process that compacts log segments B) A stage where records are shuffled to a new topic based on a new key, enabling stateful operations that require key grouping C) A cleanup operation that deletes temporary state stores D) A method to increase the number of partitions for a topic on the fly Answer: B Explanation: Repartitioning writes records to an intermediate topic keyed by the new grouping key, ensuring correct partitioning for downstream stateful operators. Question 56. Which consumer configuration can be used to detect and handle “slow” consumers that are not committing offsets? A) max.poll.interval.ms B) session.timeout.ms C) heartbeat.interval.ms D) enable.auto.commit