All Confluent exams

Free CCDAK practice test: 30 questions with answers

30 original questions for Confluent Certified Developer for Apache Kafka (CCDAK), 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

CCDAK exam guide: topics, cost and format

All 30 CCDAK questions with answers

The same questions as the test above, grouped by exam topic. Open any question to see the answer and explanation.

Kafka core APIs (8 questions)

  1. Question 1

    A team is building a service that consumes order events and must keep a continuously updated count of orders per customer. The computation has to run inside the service's own process, without a separate processing cluster. Which Kafka API fits this need best?

    1. AKafka Connect API with a sink connector
    2. BKafka Producer API with manual counters kept in application memory
    3. CKafka Admin API with topic configuration
    4. DKafka Streams API with a local state store
    Show answer and explanation
    Correct answer: D

    Kafka Streams is a client library that runs inside the application and supports stateful aggregations through local state stores backed by changelog topics. Connect moves data between Kafka and external systems, the Admin API manages cluster resources, and a bare producer only publishes records with no aggregation support.

  2. Question 2

    Which statement best describes the Kafka Admin API?

    1. AIt moves data between Kafka and external systems through connectors
    2. BIt applies joins, windowed aggregations, and stateful transformations to records in real time
    3. CIt creates, inspects, and alters topics, configs, and consumer groups
    4. DIt publishes records to topics with configurable durability settings
    Show answer and explanation
    Correct answer: C

    The Admin API handles management tasks such as creating topics, altering configurations, and inspecting consumer groups. The other descriptions belong to the Connect API, the Streams API, and the Producer API respectively.

  3. Question 3

    A deployment pipeline must guarantee that a topic exists with a chosen partition count and replication factor before any application starts. Which approach is the most reliable?

    1. ARely on the broker creating the topic automatically when the first record is written
    2. BCreate the topic explicitly with the Admin API or topic tooling during deployment
    3. CSet the replication factor in the producer client configuration only
    4. DRely on the first consumer group member to size the topic when it joins
    Show answer and explanation
    Correct answer: B

    Explicit creation lets the pipeline set partitions and replication factor deliberately, while auto-creation falls back to broker defaults. Consumers cannot choose a topic's partition count, and a producer's client configuration does not set the replication factor of a topic.

  4. Question 4

    Which statement about log compaction is correct?

    1. AIt retains at least the most recent value for each key in a partition
    2. BIt deletes records older than the configured retention time from every partition
    3. CIt merges topics that share the same key space into one topic
    4. DIt removes duplicate records from the producer before they are sent
    Show answer and explanation
    Correct answer: A

    With cleanup.policy set to compact, Kafka keeps at least the latest record for every key in a partition and removes older values for that key. Time-based deletion is a different cleanup policy, while merging topics and deduplicating before sending are not behaviours of log compaction.

  5. Question 5

    A Kafka Streams application joins a stream of page view events with a collection of user profiles. Each profile is updated over time, and only the latest profile is needed for enrichment. Which Kafka Streams abstraction should represent the profiles?

    1. AA KTable, since a newer record for a key replaces the current value
    2. BA KStream, since every record is treated as an independent event in the stream
    3. CA changelog topic, since it keeps every historic event in order
    4. DA producer buffer, since it batches updates before they are sent
    Show answer and explanation
    Correct answer: A

    A KTable models a changelog in which the latest value per key is the current state, which suits profile enrichment. A KStream treats each record as an independent event, while changelog topics and producer buffers are storage and batching mechanisms rather than stream abstractions.

  6. Question 6

    Which two statements about Kafka Connect are correct? (Choose two.)

    1. ASource connectors read data from external systems and write it into Kafka topics
    2. BSink connectors read records from Kafka topics and write them to external systems
    3. CConnect workers must run on the same machines as the Kafka brokers
    4. DConnect transforms records by running a Kafka Streams topology
    Show answer and explanation
    Correct answer: A, B

    Source connectors import data into Kafka and sink connectors export it out, which is the core purpose of Connect. Workers can run on machines separate from the brokers, and single message transforms, not Streams topologies, modify records inside Connect.

  7. Question 7

    A company wants every message value on a topic to follow a registered Avro schema, and wants new schema versions checked so that existing consumers keep working. Which component provides this?

    1. AKafka Streams state stores with changelog topics
    2. BAdmin client topic configuration with retention settings
    3. CConsumer auto.offset.reset setting for new groups
    4. DConfluent Schema Registry with compatibility checking
    Show answer and explanation
    Correct answer: D

    Schema Registry stores schema versions and enforces compatibility rules whenever a new schema is registered. The other options manage state, topic retention, and consumer starting position, and none of them validates record schemas.

  8. Question 8

    A team needs rows from a relational table to flow continuously into a Kafka topic, and they do not want to write custom producer code. Which Kafka component is the best fit?

    1. AA custom producer loop that reads each row and sends it to the topic
    2. BA Kafka Streams application that holds the table as a KTable
    3. CA consumer group that polls the database on a fixed schedule
    4. DA source connector from Kafka Connect configured for the database
    Show answer and explanation
    Correct answer: D

    Kafka Connect source connectors read from external systems such as relational databases and write the rows into topics without custom code. A custom producer loop needs code the team wants to avoid, a Streams application expects its input to already be in Kafka, and a consumer group reads from Kafka rather than polling a database.

Producers and consumers (8 questions)

  1. Question 9

    A payments service must not lose writes that have been acknowledged, even if a broker fails. Which combination of producer and topic settings best supports this goal?

    1. Aacks=0 with a replication factor of one
    2. Backs=1 with compression turned on for faster batched writes
    3. Cacks=all with min.insync.replicas greater than one
    4. Dacks=all with retries turned off to avoid duplicate writes
    Show answer and explanation
    Correct answer: C

    acks=all waits for the in-sync replicas to hold the record, and min.insync.replicas above one ensures more than one copy exists before the write is acknowledged. acks=0 waits for no broker, acks=1 waits only for the leader, and disabling retries does not add durability.

  2. Question 10

    Which consumer setting determines where a consumer group starts reading when no committed offset exists for a partition?

    1. Aauto.offset.reset
    2. Benable.auto.commit
    3. Cfetch.min.bytes
    4. Dmax.poll.records
    Show answer and explanation
    Correct answer: A

    auto.offset.reset decides whether a consumer starts from the earliest available offset, the latest offset, or raises an error when no committed position exists. The other settings control offset commits, fetch batching, and how many records each poll returns.

  3. Question 11

    A consumer writes results to a database for each record it reads. The team prefers to risk reprocessing a few records after a crash rather than skip any record. Which commit pattern matches this choice?

    1. AAt-most-once delivery with offsets committed before processing
    2. BAt-least-once delivery with offsets committed after processing
    3. CAt-most-once delivery with commits sent without waiting for results
    4. DExactly-once delivery achieved by enabling auto-commit alone
    Show answer and explanation
    Correct answer: B

    Committing after the database write means a crash before the commit causes the record to be read again, so duplicates are possible but nothing is skipped. Committing before processing or sending commits without waiting can skip records, and auto-commit alone does not give exactly-once results against an external database.

  4. Question 12

    A producer sends each record as soon as it is created, which results in many small requests and low throughput. Which producer setting lets it hold records briefly so they can be sent together?

    1. Aheartbeat.interval.ms
    2. Blinger.ms
    3. Csession.timeout.ms
    4. Dfetch.max.bytes
    Show answer and explanation
    Correct answer: B

    linger.ms makes the producer wait a short time for more records so they can be grouped into one batch request. The other settings belong to consumers, governing group heartbeats, membership timeouts, and fetch sizes.

  5. Question 13

    A consumer group keeps losing members during long processing runs. Logs show that consumers are removed from the group because they take too long between calls to poll. Which setting should the team review first?

    1. Aacks on the producer side for write durability
    2. Bbatch.size on the producer side for request grouping
    3. Cmax.poll.interval.ms on the consumer
    4. Dcompression.type on the producer side for smaller payloads
    Show answer and explanation
    Correct answer: C

    max.poll.interval.ms is the maximum time allowed between poll calls before the consumer is considered failed and leaves the group. The producer settings listed affect durability, batching, and compression, so they do not change group membership.

  6. Question 14

    Which two statements about idempotent producers are correct? (Choose two.)

    1. AThey prevent duplicate records caused by producer retries within a single producer session for each partition
    2. BThey make a set of writes across several topics commit atomically in one transaction
    3. CThey require consumers to use read_committed isolation before they can receive any records
    4. DThey keep records in order within a partition during retries when the in-flight request limit is respected
    Show answer and explanation
    Correct answer: A, D

    Idempotence lets the broker discard duplicate batches that a producer resends after a retry, and within the supported in-flight limit it preserves order within a partition. Atomic multi-topic writes require transactions, and read_committed is a consumer setting that idempotent producers do not depend on.

  7. Question 15

    A team reads a topic written by transactional producers and must never see records from transactions that were aborted. Which consumer setting achieves this?

    1. Aisolation.level set to read_committed
    2. Benable.idempotence set to true to prevent duplicates
    3. Cacks set to all for stronger write durability
    4. Dauto.offset.reset set to earliest for new groups
    Show answer and explanation
    Correct answer: A

    With read_committed, the consumer returns only committed transactional records and skips records from aborted transactions. The other settings configure producer delivery guarantees or starting offsets, and none of them filters aborted transactional data.

  8. Question 16

    A consumer group uses the default range assignment, so every rebalance pauses all consumers while partitions are shuffled. The team wants only the partitions that actually move to pause. Which change achieves this?

    1. ASet acks to all on the producer so rebalances are coordinated across the group
    2. BLower fetch.max.bytes on the consumer to shorten each rebalance pause
    3. CIncrease batch.size on the producer to delay the next group rebalance
    4. DSet partition.assignment.strategy to the cooperative sticky assignor
    Show answer and explanation
    Correct answer: D

    The cooperative sticky assignor performs incremental rebalancing, so consumers keep the partitions that do not move and only reassigned partitions pause. Producer acknowledgement and batch settings, and consumer fetch sizes, do not change how a group reassigns partitions.

Deploying real-time streaming applications (7 questions)

  1. Question 17

    A Kafka Streams application reads a single input topic with a fixed number of partitions. The team starts more application instances to speed up processing. What limits how many tasks can process that input topic in parallel?

    1. AThe number of input topic partitions
    2. BThe number of brokers in the cluster
    3. CThe number of Schema Registry instances
    4. DThe batch.size value on the producer
    Show answer and explanation
    Correct answer: A

    Each stream task processes one partition of the input topic, so the partition count caps useful parallelism. Broker count, Schema Registry instances, and producer batch size do not set the number of tasks for an input topic.

  2. Question 18

    A team runs Kafka Connect on three machines and wants connector tasks to be reassigned automatically to the remaining workers if one machine fails. Which deployment mode should they use?

    1. AStandalone mode with one worker process
    2. BDistributed mode with each connector pinned to one host
    3. CDistributed mode with workers sharing a group.id
    4. DStandalone mode with a REST interface on each host
    Show answer and explanation
    Correct answer: C

    Distributed mode lets workers that share a group.id form one cluster that balances connectors and tasks and reassigns them when a worker leaves. Standalone mode runs a single process with no failover, and pinning connectors to hosts prevents automatic reassignment.

  3. Question 19

    In a sink connector configuration, what is the purpose of a dead letter queue?

    1. ATo keep a record of the connector's committed offsets across restarts
    2. BTo route failed records into a separate topic so the connector keeps running
    3. CTo replicate the source topic into a second Kafka cluster for disaster recovery
    4. DTo cache schemas fetched from Schema Registry to reduce lookup requests
    Show answer and explanation
    Correct answer: B

    When error tolerance is enabled, records that fail conversion or transformation can be sent to a dead letter queue topic instead of stopping the task. Offset storage, cross-cluster replication, and schema caching are handled by other mechanisms and are not the purpose of this topic.

  4. Question 20

    Which two actions help a stateful Kafka Streams application recover quickly after an instance is rescheduled? (Choose two.)

    1. AConfigure standby replicas so warm copies of state exist on other instances
    2. BRely on changelog topics so state stores can be rebuilt from Kafka
    3. CDisable changelog topics to reduce broker storage use
    4. DGenerate a new application.id on every restart to avoid stale state
    Show answer and explanation
    Correct answer: A, B

    Standby replicas keep up-to-date copies of state on other instances, and changelog topics let a store be restored from Kafka instead of starting empty. Disabling changelogs makes state unrecoverable, and a new application.id discards the link to existing state and forces reprocessing.

  5. Question 21

    A team has changed the topology of a Kafka Streams application and wants to reprocess its input topics from the beginning in a test environment. Which command-line tool is built for resetting such an application?

    1. Akafka-configs for dynamic configuration values
    2. Bkafka-topics for managing topic definitions
    3. Ckafka-reassign-partitions for moving replicas
    4. Dkafka-streams-application-reset
    Show answer and explanation
    Correct answer: D

    The application reset tool resets input topic offsets and cleans up the application's internal topics so it can reprocess its data. The other tools manage topic definitions, replica placement, and configuration values, and none of them handles Streams offsets and internal topics together.

  6. Question 22

    Why does a Kafka Connect source connector store its offsets?

    1. ASo it can resume from its last recorded position after a restart
    2. BSo it can convert record keys into Avro automatically
    3. CSo it can store schema versions for each topic it writes
    4. DSo it can limit the number of tasks that each worker runs at one time
    Show answer and explanation
    Correct answer: A

    Source connectors save how far they have read in the external system, so after a restart or rebalance they can continue without re-importing everything. Task limits, key conversion, and schema versions are controlled by other settings and components.

  7. Question 23

    A team uses Schema Registry with the BACKWARD compatibility setting. They want to add a field to an Avro record that older data does not contain. Which change is accepted?

    1. AAdding a new field that has no default value
    2. BChanging a field to a type unrelated to its original type
    3. CRenaming an existing field without adding an alias
    4. DAdding a new field that has a default value
    Show answer and explanation
    Correct answer: D

    Under BACKWARD compatibility, a reader using the new schema must still read data written with the old schema, which works when the added field has a default. A missing value with no default cannot be filled in, and renamed or retyped fields no longer match the old data.

Maintaining streaming applications (7 questions)

  1. Question 24

    Consumer lag for a group keeps growing, and the team wants to see each partition's committed offset, log end offset, and lag. Which tool provides this view?

    1. AThe kafka-topics tool with its create option to add new topics
    2. BThe kafka-configs tool with its alter option for changing settings
    3. CThe kafka-consumer-groups tool with its describe option
    4. DThe kafka-acls tool with its list option for access rules
    Show answer and explanation
    Correct answer: C

    The consumer groups tool's describe option reports the committed offset, log end offset, and lag per partition for a group. The other tools create topics, change configuration values, and manage access rules, so none of them reports consumer progress.

  2. Question 25

    An alert fires because several followers of one partition have fallen behind the leader and are no longer in the in-sync replica set. How is this partition classified?

    1. AOffline partition with no leader currently available
    2. BUnder-replicated partition with lagging followers
    3. CCompacted partition that is cleaned by the log cleaner
    4. DIdle partition that receives very little traffic
    Show answer and explanation
    Correct answer: B

    An under-replicated partition has fewer in-sync replicas than assigned replicas, meaning some copies are behind. An offline partition has no leader at all, while compaction describes a cleanup policy and idle describes low traffic, so neither matches the alert.

  3. Question 26

    An operator must raise the replication factor of an existing topic from two to three without deleting data. Which standard approach achieves this?

    1. ARaise the producer retry count so records are copied to more brokers over time
    2. BDelete the existing topic and recreate it with replication factor three
    3. CRun a partition reassignment that adds a third replica to each partition
    4. DIncrease the partition count so that new partitions gain extra replicas
    Show answer and explanation
    Correct answer: C

    Partition reassignment changes the replica list of each partition while the topic stays online. Deleting the topic loses its data, retries only affect delivery attempts, and adding partitions does not give existing partitions more replicas.

  4. Question 27

    Keyed records in a topic have been stored in order by key for months. After the team increases the partition count, they notice that one key's records appear in two partitions. What explains this?

    1. APartitions can only be added while the topic has no stored records
    2. BConsumers must always restart with a brand new group.id after a change
    3. CNew partitions are always created with a replication factor of one
    4. DExisting keys may map to a new partition, splitting one key's records
    Show answer and explanation
    Correct answer: D

    Keyed records are assigned by hashing the key modulo the partition count, so a new count can send a key to a different partition and split its history. The other statements are wrong: partitions can be added to a topic with data, consumers do not need a new group, and new partitions use the topic's replication factor.

  5. Question 28

    A team wants to reset a consumer group's offsets so it reprocesses data from an earlier point. The reset keeps failing while consumers are still running. What must be true before the offsets can be reset?

    1. AThe topic must be compacted before resetting
    2. BThe brokers must be restarted in rolling order
    3. CThe producers feeding the topic must be paused
    4. DThe group must have no active members
    Show answer and explanation
    Correct answer: D

    Offsets can only be reset for a consumer group with no active members, so consumers must be stopped first. Compaction, broker restarts, and pausing producers have no bearing on whether a group's committed offsets can be changed.

  6. Question 29

    A cluster keeps unclean leader election disabled, which is the default. A partition's leader fails and no in-sync replica is available. What is the trade-off the team accepts?

    1. AAn out-of-sync replica becomes leader, so availability is kept but committed data may be lost
    2. BThe partition stays unavailable until an in-sync replica returns, which protects committed data
    3. CLeaders are picked at random from every replica, so consumers may see records out of order across the partition
    4. DProducers switch to acks=0 automatically, so writes continue without durability
    Show answer and explanation
    Correct answer: B

    With unclean leader election disabled, a lagging replica is never promoted, so the partition waits for an in-sync replica and committed records are not lost. Allowing an out-of-sync replica to lead keeps the partition available but risks data loss, and the other options describe behaviour Kafka does not perform.

  7. Question 30

    Which two actions reduce the storage a topic consumes on brokers? (Choose two.)

    1. ALowering the retention time or retention size so old segments are deleted
    2. BSetting cleanup.policy to compact for topics where only the latest value per key matters
    3. CIncreasing the partition count so each segment becomes smaller
    4. DRaising max.poll.records on consumers so they delete records faster
    Show answer and explanation
    Correct answer: A, B

    Shorter retention removes old log segments under the delete policy, and compaction keeps only the latest value per key. Adding partitions spreads data across more logs without shrinking it, and consumer poll settings have no effect on what brokers store.