All Confluent exams
Free CCAAK practice test: 30 questions with answers
30 original questions for Confluent Certified Administrator for Apache Kafka (CCAAK), drawn from every topic area. Answer each one to see whether you got it right and why. No sign-up.
- Free questions
- 30
- Full bank
- 112 questions
- Real exam
- 90 min
All 30 CCAAK questions with answers
The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.
Configure Kafka clusters (8 questions)
Question 1
A team runs a three-broker cluster and creates an orders topic with replication factor 3. Producers use acks=all. The team wants writes to keep succeeding when one broker is down, but producers should receive errors instead of acknowledgements when only one replica remains in sync. Which topic-level setting should they configure?
- Amin.insync.replicas set to 2
- Bunclean.leader.election.enable set to true
- Ccleanup.policy set to compact
- Dretention.ms set to a longer period
Show answer and explanationHide answer
Correct answer: AWith acks=all, min.insync.replicas=2 means a write needs two in-sync replicas. With one broker down two remain and writes succeed; with two down, producers get NotEnoughReplicas errors. The other settings govern leader eligibility, compaction and age-based retention, not the acknowledgement rule.
Question 2
Which broker setting decides whether a replica that is not fully caught up with the partition leader may be elected leader, accepting the risk of losing acknowledged messages?
- Aauto.create.topics.enable
- Blog.cleaner.enable
- Cunclean.leader.election.enable
- Ddefault.replication.factor for new topics
Show answer and explanationHide answer
Correct answer: Cunclean.leader.election.enable allows an out-of-sync replica to become leader when no in-sync replica is available, which can discard messages the old leader had acknowledged. It is disabled by default to protect durability. The other settings control topic auto-creation, the log cleaner and default replica counts.
Question 3
An application team reports that its producer quietly created a topic named ordrs-events with one partition and replication factor 1 because of a typo in its configuration. The platform team wants unknown topic names rejected from now on. What should they change?
- ARaise log.retention.hours on the brokers
- BSet auto.create.topics.enable to false on the brokers
- CLower replica.lag.time.max.ms on every broker in the cluster
- DSet compression.type to gzip on the brokers
Show answer and explanationHide answer
Correct answer: BTurning off auto.create.topics.enable makes brokers reject writes to unknown topic names, so the typo produces an error instead of a stray topic. Retention, compression and replica lag thresholds do not control whether a topic gets created.
Question 4
What does a topic with cleanup.policy set to compact guarantee about the data that remains after the log cleaner has run?
- AOnly messages newer than the retention window remain
- BThe earliest value for every message key is kept
- CThe most recent value for every message key is kept
- DMessages above a fixed byte size are removed
Show answer and explanationHide answer
Correct answer: CLog compaction keeps the latest record for each key, which suits changelog-style topics where the newest state matters. Keeping the earliest value is the opposite behaviour. Removing data by age or size is the job of the delete policy, not compaction.
Question 5
A topic has both retention.ms and retention.bytes configured. A partition's log has not yet reached the age limit but has grown beyond the size limit. What happens?
- AOld closed segments become eligible for deletion
- BOnly the age limit is used because it is set first
- CNothing is deleted until both limits are exceeded
- DThe active segment is deleted first to free space
Show answer and explanationHide answer
Correct answer: ARetention limits apply independently, so once either the age or the size limit is exceeded, the oldest closed segments become eligible for deletion. Requiring both limits, letting the age setting win, or deleting the active segment are all wrong, because retention never removes the active segment.
Question 6
Clients on a separate network can resolve the broker host names but fail after the initial connection, because the brokers return internal addresses in metadata. Which change addresses the cause?
- AAdd an external listener and advertise its reachable address
- BIncrease num.network.threads on every broker
- CEnable auto.create.topics.enable for the cluster
- DSet broker.id to match each broker's external host name and port
Show answer and explanationHide answer
Correct answer: AClients bootstrap through one broker and then use the advertised addresses in metadata to reach each partition leader. An extra listener that advertises a name reachable from the external network fixes this. Broker IDs, network thread counts and topic auto-creation do not change which address clients are given.
Question 7
Which two of these settings can be applied to an individual topic rather than only at the broker level? (Choose two.)
- Aretention.ms
- Blisteners
- Ccleanup.policy
- Dlog.dirs
- Ebroker.id
Show answer and explanationHide answer
Correct answer: A, Cretention.ms and cleanup.policy are topic-level configurations that override broker defaults for that topic. listeners, log.dirs and broker.id are broker-level settings and cannot be set on an individual topic.
Question 8
A shared cluster has one batch job that publishes so quickly that it starves other producers. Which Kafka feature limits how many bytes per second that client may write?
- ALog compaction with a short delete retention on the topic
- BClient quotas such as producer_byte_rate for that client
- CA higher replication factor on the topic that the job writes
- DTurning off idempotence on the producer that the job uses
Show answer and explanationHide answer
Correct answer: BClient quotas, set per user or client ID, can cap a client's produce rate with producer_byte_rate, which protects other producers on the cluster. Compaction, a higher replication factor and disabling idempotence do not limit how fast a client may write.
Deploy Kafka clusters (8 questions)
Question 9
A platform team is building a KRaft cluster for a payments workload. They want the metadata quorum to keep working if any one controller node fails. How many controller nodes should they run?
- AThree controller nodes
- BTwo controller nodes across two data centers
- CFour controller nodes
- DOne controller node
Show answer and explanationHide answer
Correct answer: AA KRaft quorum needs a majority of voters, so three controllers can lose one node and still elect a leader. Two controllers cannot survive any failure and one has no redundancy. Four controllers also tolerate only one failure, so three is the usual minimum for this goal.
Question 10
In KRaft mode, what does a node configured with process.roles set to broker,controller represent?
- AA node that holds client traffic but no metadata
- BA node that runs only Kafka Connect workers and no Kafka broker
- CA node that stores only consumer group offsets
- DA combined node that runs both roles in one process
Show answer and explanationHide answer
Correct answer: Dprocess.roles set to broker,controller makes one process act as both a broker and a metadata controller, which is combined mode. It is convenient for development, but production clusters usually run isolated controllers. The other options describe roles that this setting does not express.
Question 11
A company deploys a cluster across three availability zones with six brokers and wants each partition's replicas to survive the loss of an entire zone. Which placement approach best meets this?
- APlace all brokers in one zone to cut cross-zone latency
- BSet replication factor to 1 and rely on periodic backups
- CRun every broker process on the same physical host
- DLabel brokers with zone rack names and spread replicas
Show answer and explanationHide answer
Correct answer: DLabelling brokers with zone-based broker.rack values lets Kafka spread each partition's replicas across zones, so a single zone outage leaves replicas elsewhere. Single-zone placement, one physical host and replication factor 1 all remove the redundancy the requirement depends on.
Question 12
An engineer adds a new KRaft node to an existing cluster. On first start, the node fails because its log directory has no cluster metadata. Which step was skipped?
- ARunning kafka-storage.sh format with the cluster ID
- BCreating the cluster metadata topic by hand
- CCopying server.properties from a client machine
- DSetting acks to all on every client application that writes
Show answer and explanationHide answer
Correct answer: AFormatting the storage with the cluster ID writes the metadata the node needs to join, and it must happen before the first start. Kafka creates the cluster metadata log during formatting rather than by hand, and client configuration files and acks settings play no part in preparing storage.
Question 13
A team upgrades a six-broker production cluster to a newer release. Which approach keeps the cluster available with the least risk?
- AStop all brokers at the same time, upgrade them together, then restart
- BDisable replication on every topic before upgrading any broker
- CUpgrade one broker at a time, waiting for replicas to catch up
- DMove all partitions onto one broker before upgrading the others
Show answer and explanationHide answer
Correct answer: CA rolling upgrade restarts one broker at a time and waits for replicas to catch up, so partitions stay available throughout. Stopping everything causes an outage, disabling replication weakens durability, and moving all leaders to one broker creates a bottleneck.
Question 14
Which statement about metadata management in current Apache Kafka releases is correct?
- AZooKeeper is still required for every new cluster
- BKRaft is the metadata mode, and ZooKeeper support was removed
- CProducers elect the active controller each time a broker starts up
- DMetadata is stored on each consumer's local disk
Show answer and explanationHide answer
Correct answer: BKRaft stores cluster metadata in a Raft-based log on controller nodes, and ZooKeeper support was removed in Kafka 4.0. New clusters do not need ZooKeeper, consumers do not hold cluster metadata, and producers do not elect controllers.
Question 15
Which two statements about deploying a new KRaft-based cluster are correct? (Choose two.)
- AEach node needs a unique node.id in its configuration
- Bcontroller.quorum.voters must list every broker in the cluster
- CStorage on every node must be formatted with the same cluster ID before first start
- DA ZooKeeper connection string is required in server.properties
- ECombined mode is the recommended layout for production clusters
Show answer and explanationHide answer
Correct answer: A, CEach node needs its own node.id, and every node's storage must be formatted with the cluster ID before first start. controller.quorum.voters lists only controller nodes, ZooKeeper is not needed for KRaft, and production clusters commonly run isolated controllers rather than combined mode.
Question 16
A team runs Kafka on Kubernetes and wants brokers to keep their log data after pods are rescheduled. Which approach fits?
- AUse stateful workloads with persistent volumes for logs
- BStore log data in each pod's ephemeral container filesystem
- CGive every broker a new random hostname on each restart
- DKeep records only in memory and disable log directories
Show answer and explanationHide answer
Correct answer: APersistent volumes attached to stateful workloads, often managed by an operator such as Strimzi, keep log directories across pod reschedules. Ephemeral storage is lost when a pod is replaced, changing hostnames does not preserve data, and in-memory-only records are lost on restart.
Monitor Kafka clusters (7 questions)
Question 17
The UnderReplicatedPartitions metric on a broker stays at a steady non-zero value after a network blip. Every partition still has a leader. What is the most likely meaning?
- AThe controller has lost its leadership role
- BProducers have disabled idempotence
- CConsumer groups have been deleted and their offsets reset
- DSome follower replicas have fallen out of the ISR
Show answer and explanationHide answer
Correct answer: DUnderReplicatedPartitions counts partitions where some replicas are missing from the in-sync set, so a follower is lagging or unreachable even though the partition still has a leader. Controller leadership, idempotence settings and consumer group deletion do not affect this replication metric.
Question 18
In a KRaft cluster, what should the ActiveControllerCount metric show across the controller layer during normal operation?
- AOne active controller per topic
- BOne active controller per partition
- CExactly one active controller
- DZero active controllers while brokers are running
Show answer and explanationHide answer
Correct answer: CExactly one controller should be active across the cluster at any time. The other options describe controllers that do not exist per topic or per partition, or a state with no active controller, which would block metadata changes.
Question 19
An alert fires for OfflinePartitionsCount above zero. Producers to one topic receive timeouts and consumers see no new records. What does this indicate?
- AConsumers are reading too slowly from healthy partitions
- BCompression ratios have dropped on the producers
- CTopics have grown past their configured retention size limit
- DSome partitions have no active leader and are unavailable
Show answer and explanationHide answer
Correct answer: DOfflinePartitionsCount counts partitions with no active leader, so reads and writes to them fail until a leader is elected. Slow consumers, compression ratios and retention size can cause lag or deletion but do not make partitions unavailable.
Question 20
The lag for an orders consumer group has grown steadily for an hour while producers write at a stable rate. The consumers log no errors. What is the best first step?
- AChange producer acks from all to 0 to speed up writes
- BDelete the consumer group so it restarts from the latest offsets
- CRun kafka-consumer-groups.sh --describe to find the lagging partitions
- DDisable log compaction on the orders topic to free disk space
Show answer and explanationHide answer
Correct answer: CDescribing the group shows the current offset, log end offset and LAG for each partition, which reveals the lagging partition or member. Deleting the group, lowering acks or disabling compaction does not address a consumer that is processing too slowly.
Question 21
Consumers in a group keep being removed and partitions are reassigned several times an hour. Logs show members leaving right after long batches of processing. Which configuration pair is most relevant to investigate?
- Amin.insync.replicas on the topic
- Bmax.poll.interval.ms and max.poll.records
- Clog.segment.bytes on the brokers that host the topic
- Dcompression.type on the producer
Show answer and explanationHide answer
Correct answer: BIf a consumer does not call poll within max.poll.interval.ms, the group treats it as failed and rebalances, and large batches per poll make that more likely. min.insync.replicas, segment size and producer compression do not govern consumer group membership.
Question 22
Broker metrics show the ISR shrink rate for a topic spikes every time one particular broker has heavy disk I/O. Which conclusion is best supported?
- AThe controller has been replaced with a different broker
- BProducers have switched to a different partitioner class on every client
- CThe follower on that broker keeps falling behind the leader
- DThe topic's partition count has been reduced
Show answer and explanationHide answer
Correct answer: CA follower that cannot keep up within the replica lag time limit is removed from the ISR, and repeated shrink and expand events under heavy disk I/O point to that broker's follower. Controller changes, partitioner choice and partition counts do not produce this pattern.
Question 23
Which two indicators most directly show that some partitions have lost availability or replication redundancy? (Choose two.)
- AUnderReplicatedPartitions above zero
- BProducer record send rate increasing
- COfflinePartitionsCount above zero
- DConsumer group member count increasing
- ENumber of topics created in the last day
Show answer and explanationHide answer
Correct answer: A, CUnderReplicatedPartitions shows replicas missing from the ISR, and OfflinePartitionsCount shows partitions with no leader at all. Send rate, group membership and topic creation counts describe workload or inventory and do not indicate lost replication or availability on their own.
Support Kafka clusters (7 questions)
Question 24
Producers with acks=all receive NotEnoughReplicas errors for a topic with replication factor 3 and min.insync.replicas set to 2. Two of the three brokers hosting some of its partitions stopped responding. What is happening?
- AThe topic has exceeded its retention.bytes limit
- BThe producer batch.size is too large for the brokers
- CThe consumers have stopped committing offsets for the whole group
- DThe ISR for those partitions has fallen below two members
Show answer and explanationHide answer
Correct answer: DWith acks=all the leader rejects writes when the in-sync set has fewer members than min.insync.replicas. Losing two of three replicas leaves one in-sync member for the affected partitions, so NotEnoughReplicas is returned. Retention limits, consumer commits and batch sizes do not produce this error.
Question 25
An operator wants to reset a consumer group's offsets to the earliest position with kafka-consumer-groups.sh. The command fails and reports that the group still has active members. What should the operator do?
- AAdd a new partition to the topic and retry the reset
- BRestart every broker in the cluster to clear the group's membership
- CSet acks to all on the consumers and retry the reset
- DStop all consumers in the group and then run the reset
Show answer and explanationHide answer
Correct answer: DOffset resets require the group to be inactive, so every consumer in it must stop before kafka-consumer-groups.sh can change committed offsets. Adding partitions, changing producer acks and restarting brokers do not clear group membership.
Question 26
An operator needs to move the replicas of one partition off a failing broker onto healthy brokers. Which sequence is the standard approach?
- ADelete the topic, recreate it, and let producers refill it
- BWrite a reassignment JSON, run --execute, then run --verify
- CEdit the segment files on disk with a text editor by hand
- DChange the broker.id values on the healthy brokers to match
Show answer and explanationHide answer
Correct answer: Bkafka-reassign-partitions.sh takes a JSON plan, --execute starts the move, and --verify checks whether it has completed. Deleting data, editing segment files or changing broker IDs would lose data or corrupt the cluster.
Question 27
Why can increasing the partition count of a keyed topic cause ordering problems for consumers that depend on per-key sequence?
- AExisting records are rewritten into fewer partitions automatically
- BNew records for a key may map to a different partition than before
- CConsumers can no longer read records written before the change
- DBrokers stop replicating records to followers during the change
Show answer and explanationHide answer
Correct answer: BKeyed records are assigned by hashing the key modulo the partition count, so after the count changes, new records for a key can land on a different partition than earlier ones, which breaks per-key order across the change. Existing data is not rewritten and replication is unaffected.
Question 28
A consumer group was offline longer than the topic's retention. On restart, its committed offset no longer exists in the log. Which setting decides where the consumer resumes?
- ASet auto.offset.reset on the consumer
- BRaise min.insync.replicas on the topic
- CShorten log.flush.interval.messages on the brokers
- DSet replica.fetch.max.bytes higher on the brokers
Show answer and explanationHide answer
Correct answer: AWhen the committed offset is out of range, the consumer applies auto.offset.reset, which picks the earliest available record, the latest one, or fails. Replica fetch sizes, ISR thresholds and flush intervals do not change where a consumer resumes.
Question 29
After a failed broker returns and rejoins, partitions it used to lead still have leaders on other brokers. Which action moves leadership back to the preferred replicas?
- AA change to unclean.leader.election.enable on the topic
- BA preferred leader election run for the affected partitions
- CA topic deletion followed by a recreation of the topic
- DA reduction in the replication factor of the topic to one replica
Show answer and explanationHide answer
Correct answer: BA preferred leader election moves leadership back to the preferred replica, which is the first replica in each partition's assignment list, provided it is in sync. Changing unclean election, deleting and recreating topics, or lowering the replication factor does not restore preferred leaders and can add risk.
Question 30
Which two actions help keep data safe when a broker is being taken out of service? (Choose two.)
- AReassign its partitions to other brokers before shutting it down
- BLet a controlled shutdown move leadership off the broker first
- CSet unclean.leader.election.enable to true first
- DDelete its log directories to free disk space
- ELower min.insync.replicas to 1 for every topic
Show answer and explanationHide answer
Correct answer: A, BReassigning partitions away and letting a controlled shutdown move leadership both move the work off the broker before it stops, without relying on unclean elections. Enabling unclean election, deleting log directories and lowering min.insync.replicas all increase the risk of losing acknowledged data.