Free practice · No sign-up required

Confluent Certified Developer for Apache Kafka free practice test

15 questions with answer explanations. Choose an answer below to begin.

Question 1 of 15

What is the primary purpose of a Kafka producer API?

Show hint

1.1 Describe the role of producers in event streaming.

0/15 answered · Bookmark questions to review later. Focus the practice area to use keys 1–9 and Enter.

Learn by doing

Put your answers into practice

Use official documentation and hands-on labs to work through topics you missed.

Explore all study resources →

All questions and explanations

Prefer to read at your own pace? Work through each question below, then open its answer to check your reasoning. You can link directly to a question or print this reference.

  1. What is the primary purpose of a Kafka producer API?

    1. To publish records to Kafka topics

    2. To consume records from Kafka topics

    3. To manage Kafka broker configurations

    4. To monitor cluster health

    Show answer and explanation

    Correct answer

    • To publish records to Kafka topics

    The producer API is designed to send data records into Kafka topics. Consumers read data, while brokers and monitoring tools handle configuration and health.

  2. Which component is responsible for determining the partition where a record is stored?

    1. Partitioner

    2. Serializer

    3. Coordinator

    4. Controller

    Show answer and explanation

    Correct answer

    • Partitioner

    The partitioner uses the record key or a custom strategy to decide the target partition. Serializers convert data formats, coordinators manage group membership, and controllers manage cluster state.

  3. What does message ordering guarantee in Apache Kafka?

    1. Ordering is guaranteed within a partition

    2. Ordering is guaranteed across all partitions

    3. Ordering is guaranteed per consumer instance

    4. Ordering is guaranteed only for compacted topics

    Show answer and explanation

    Correct answer

    • Ordering is guaranteed within a partition

    Kafka preserves the order of records only within a single partition. Ordering across partitions is not guaranteed due to parallelism.

  4. Which configuration property controls how long a Kafka broker retains records?

    1. retention.ms

    2. segment.ms

    3. log.retention.check.interval.ms

    4. max.message.bytes

    Show answer and explanation

    Correct answer

    • retention.ms

    The retention.ms setting defines the maximum age of a record before it is eligible for deletion. Other options affect segment rolling or message size limits.

  5. What is the role of a Kafka consumer group?

    1. To allow multiple consumers to share the reading of a topic

    2. To ensure that only one producer writes to a topic

    3. To replicate data across brokers

    4. To store metadata about topics

    Show answer and explanation

    Correct answer

    • To allow multiple consumers to share the reading of a topic

    Consumer groups enable multiple consumers to read from a topic while dividing partitions among group members for parallel processing. Producers are not restricted by groups.

  6. Which data format is commonly used with Kafka Connect for structured data exchange?

    1. JSON

    2. XML

    3. CSV

    4. Plain text

    Show answer and explanation

    Correct answer

    • JSON

    JSON is widely used in Kafka Connect for structured data due to its compatibility with schemas and widespread support in connectors. Other formats are possible but less common in typical integrations.

  7. What happens when a consumer commits an offset?

    1. Kafka records the last processed message position

    2. Kafka deletes the consumed messages

    3. Kafka stops the broker from accepting new data

    4. Kafka rebalances the consumer group

    Show answer and explanation

    Correct answer

    • Kafka records the last processed message position

    Committing an offset tells Kafka how far the consumer has processed records. Messages are not deleted immediately, and commits do not directly trigger rebalances.

  8. Which statement best describes Kafka brokers?

    1. They store data and serve client requests

    2. They only handle authentication and authorization

    3. They are responsible for producing messages

    4. They format data before storage

    Show answer and explanation

    Correct answer

    • They store data and serve client requests

    Brokers are the core servers that store data in topics and handle read/write requests. Producers and consumers are client roles, not broker functions.

  9. What is the purpose of log compaction in Kafka?

    1. To retain the latest value for each key indefinitely

    2. To delete all records after a fixed time period

    3. To compress data to reduce disk usage

    4. To encrypt data at rest

    Show answer and explanation

    Correct answer

    • To retain the latest value for each key indefinitely

    Log compaction ensures that the most recent value for each key is retained, which is useful for state recovery. Time-based deletion is handled by retention policies.

  10. Question 10

    Link to question

    Which Kafka feature enables real-time processing of data streams?

    1. Kafka Streams

    2. Kafka Connect

    3. Kafka MirrorMaker

    4. Kafka Schema Registry

    Show answer and explanation

    Correct answer

    • Kafka Streams

    Kafka Streams is a library for building applications that process data in motion with low latency. Connect is for integration, MirrorMaker for replication, and Schema Registry for schema management.

  11. Question 11

    Link to question

    What does idempotence prevent in a Kafka producer?

    1. Duplicate records during retries

    2. Data loss during broker failures

    3. Consumer rebalancing

    4. Partition reassignment

    Show answer and explanation

    Correct answer

    • Duplicate records during retries

    Idempotence ensures that retries caused by network issues do not result in duplicate records being written to the topic. It does not affect data durability or consumer behavior.

  12. Question 12

    Link to question

    Which scenario is a valid use case for Kafka topics?

    1. Storing application logs for analysis

    2. Serving static website content

    3. Replacing a relational database

    4. Executing complex SQL queries

    Show answer and explanation

    Correct answer

    • Storing application logs for analysis

    Kafka is well-suited for event and log collection due to its high throughput and append-only model. It is not designed as a web server or a direct database replacement.

  13. Question 13

    Link to question

    Which configuration helps reduce data loss during broker failures?

    1. min.insync.replicas

    2. acks=all

    3. replication.factor

    4. all of the above

    Show answer and explanation

    Correct answer

    • all of the above

    Setting acks=all ensures the producer waits for all in-sync replicas to acknowledge. min.insync.replicas and a suitable replication factor further protect data availability during failures.

  14. Question 14

    Link to question

    What is a topic in Apache Kafka?

    1. A category or feed name to which records are published

    2. A client library for consuming data

    3. A storage engine for relational data

    4. A monitoring dashboard for cluster metrics

    Show answer and explanation

    Correct answer

    • A category or feed name to which records are published

    A topic is a logical channel for publishing and subscribing to records. Consumers read from topics, and they are not client libraries, databases, or dashboards.

  15. Question 15

    Link to question

    Which mechanism ensures that a Kafka consumer reads each record at most once under failure conditions?

    1. Exactly-once semantics

    2. At-least-once delivery

    3. Producer idempotence

    4. Log compaction

    Show answer and explanation

    Correct answer

    • Exactly-once semantics

    Exactly-once semantics prevents duplicate processing by combining transactional writes with consumer offset commits within the same transaction.

Read all flashcards

Recall the answer before opening each card.

What is the primary purpose of the Kafka producer API?

To publish records to Kafka topics. Producers send data to topics, while consumers read from them.

Which component determines the partition for a record?

The partitioner. It uses the record key or a custom strategy to assign a partition.

Where is message ordering guaranteed in Kafka?

Within a single partition. Ordering across partitions is not guaranteed.

Which configuration controls how long records are retained?

retention.ms. It defines the maximum age of a record before deletion.

What is the role of a consumer group?

To allow multiple consumers to share reading a topic by dividing partitions among members.

Which data format is commonly used with Kafka Connect for structured data?

JSON. It is widely used due to schema compatibility and connector support.

What does committing an offset do?

Kafka records the last processed message position. It helps resume consumption after failure.

What is the role of a Kafka broker?

Brokers store data and serve client requests. They are the core servers managing topics.

What is the purpose of log compaction?

To retain the latest value for each key indefinitely, useful for state recovery.

Which Kafka feature enables real-time stream processing?

Kafka Streams. It is a library for building applications that process data in motion.

What does idempotence prevent in a producer?

Duplicate records during retries. It ensures exactly-once write semantics per partition.

Is Kafka suitable for storing application logs?

Yes, due to high throughput and append-only model. It is designed for event streaming.

Which configurations reduce data loss during broker failures?

acks=all, min.insync.replicas, and a suitable replication factor (e.g., 3).

What is a topic in Kafka?

A category or feed name to which records are published. Consumers subscribe to topics.

Which mechanism ensures a consumer reads each record at most once under failures?

Exactly-once semantics, combining transactional writes with consumer offset commits.

What does acks=all guarantee?

The producer waits for all in-sync replicas to acknowledge, minimizing data loss.

How does a partitioner decide the target partition?

It uses the record key (hash) or a custom logic. If no key, round-robin is used.

What happens if a consumer group has more consumers than partitions?

Some consumers become idle since partitions are assigned exclusively to active consumers.

What is the default cleanup policy for a Kafka topic?

Delete, based on retention.ms or retention.bytes. Compaction must be explicitly set.

What is the benefit of setting enable.idempotence=true?

It prevents duplicate records due to retries, ensuring exactly-once semantics per partition.

Active recall deck

Practice Confluent Certified Developer for Apache Kafka with real flashcards

Read the prompt, commit to an answer, then flip the card. Move through the deck at your own pace and repeat any topic that does not come back quickly.

20 free cards

Card 1 of 20

1 reviewed this session

Connect the concepts

Your Confluent Certified Developer for Apache Kafka study mind map

Open a branch to connect a topic with its practice questions and explanations. Use the map to choose your next review topic.

Confluent Certified Developer for Apache Kafka15 questions in this practice set
1.1 Describe the role of producers in event streaming.(1)
1.3 Explain how data is distributed across partitions.(1)
1.4 Discuss ordering and delivery semantics.(1)
2.2 Configure retention policies for data lifecycle management.(1)
3.1 Explain consumer group concepts and behavior.(1)
4.2 Select appropriate serialization formats for integration.(1)
3.3 Describe offset management and fault tolerance.(1)
2.1 Identify broker responsibilities in the cluster.(1)
2.4 Explain compaction and its use cases.(1)
5.1 Identify tools for stream processing within the Kafka ecosystem.(1)
1.5 Describe producer idempotence and its benefits.(1)
1.2 Identify appropriate use cases for event streaming.(1)
More practice connections(3)
Exam-focused analysis

What this Confluent Certified Developer for Apache Kafka practice set measures

This is an analysis of the practice bank, not a claim about the vendor's live exam blueprint. Use it to identify the knowledge, judgment, and recall patterns exercised here, then verify your coverage against the current official exam guide.

Core Producer and Consumer Concepts

This section covers fundamental roles and APIs in Kafka. The producer API publishes records to topics, while the consumer API reads records, often within consumer groups for parallel processing. Consumer groups allow multiple consumers to share topic reading by assigning partitions to members. Offset commits record the last processed position, enabling fault tolerance. Understanding these roles is essential for building event-driven applications. The practice bank includes questions on producer purpose, consumer groups, and offset commit behavior.

  • Producer API publishes records to Kafka topics.
  • Consumer groups enable parallel reading of a topic by dividing partitions among consumers.
  • Offset commits record the last processed message, allowing resumption after failure.
  • Brokers store data and serve client requests, separate from producer/consumer roles.

Data Partitioning and Ordering Guarantees

Kafka partitions data across brokers for scalability. The partitioner uses the record key or a custom strategy to determine the target partition. Ordering is guaranteed only within a single partition; across partitions, order is not preserved. This is a critical design consideration for applications that require strict sequencing. The practice bank includes a question on ordering guarantees and another on the partitioner's role, reinforcing that keys influence partitioning and that within-partition order is maintained.

  • Partitioner decides the partition for a record based on key or custom logic.
  • Message ordering is guaranteed within a partition, not across partitions.
  • Keys are often used to ensure related records land in the same partition.
  • Understanding partitioning is important for achieving desired ordering semantics.

Fault Tolerance and Durability Configurations

Kafka provides configurations to minimize data loss during failures. The producer's acks=all ensures all in-sync replicas acknowledge writes. The broker setting min.insync.replicas defines the minimum replicas that must be available. A suitable replication factor (e.g., 3) further protects data. The practice bank includes a question on reducing data loss during broker failures, where 'all of the above' is correct, covering acks, min.insync.replicas, and replication factor. Retention policies (retention.ms) control data lifecycle, while log compaction retains the latest value per key.

  • acks=all ensures producer waits for all in-sync replicas to acknowledge.
  • min.insync.replicas sets the minimum number of replicas that must be available.
  • Replication factor (e.g., 3) provides redundancy against broker failures.
  • retention.ms defines maximum record age before deletion; log compaction keeps latest per key.

Stream Processing and Exactly-Once Semantics

Kafka Streams enables real-time stream processing with low latency, distinct from connectors or replication tools. Idempotence prevents duplicate records during producer retries by assigning a unique producer ID and sequence numbers. Exactly-once semantics combine idempotent producers with transactional writes to ensure each record is processed exactly once, even under failures. The practice bank includes questions on idempotence, exactly-once semantics, and identifying Kafka Streams as the stream processing tool. These concepts are crucial for building reliable streaming applications.

  • Kafka Streams is the library for real-time stream processing within the Kafka ecosystem.
  • Idempotence prevents duplicate records caused by retries.
  • Exactly-once semantics ensure each record is processed exactly once by integrating transactions.
  • Use cases include event-driven architectures and stateful transformations.

Study workflow

Turn one Confluent Certified Developer for Apache Kafka attempt into a study plan

  1. 1

    Configuring Producer Idempotence

    To enable idempotence, set 'enable.idempotence=true' in the producer configuration. This ensures no duplicate records are written during retries, even if the broker fails. Combine with 'acks=all' for stronger guarantees. Idempotence is a prerequisite for exactly-once semantics.

  2. 2

    Setting Retention Policies

    Configure 'retention.ms' on a topic to control how long records are retained (e.g., 604800000 for 7 days). Use 'retention.bytes' for size-based retention. For log compaction, set 'cleanup.policy=compact' instead of 'delete'. Compaction retains the latest value per key indefinitely.

  3. 3

    Managing Consumer Offsets

    Use the 'enable.auto.commit' property (default true) to periodically commit offsets automatically. For manual control, set it to false and call 'commitSync()' or 'commitAsync()' after processing. Commit offsets after successful processing to avoid reprocessing on failure.

  4. 4

    Implementing Log Compaction

    To enable log compaction, set 'cleanup.policy=compact' on the topic configuration. For a topic that requires both compaction and deletion, use 'compact,delete'. Compaction is useful for state stores or restoring state after failure, ensuring only the latest value per key is retained.

  5. 5

    Enabling Exactly-Once Semantics

    For exactly-once producer, set 'enable.idempotence=true' and 'transactional.id' to a unique string. Use 'initTransactions()', 'beginTransaction()', 'sendOffsetsToTransaction()', and 'commitTransaction()' in the producer. For consumers, set 'isolation.level=read_committed' to read only committed records.

FAQ

Questions about this exam practice page

Clear boundaries on what the bank covers, how to use it, and where official vendor information still matters.

What is the role of the partitioner in Kafka?+

The partitioner determines which partition a record is sent to. By default, it uses the record key hash if provided, or a round-robin strategy if no key. Custom partitioners can be implemented for advanced routing. The partitioner directly affects ordering and load distribution.

How does log compaction differ from time-based retention?+

Time-based retention (retention.ms) deletes records older than a threshold. Log compaction (cleanup.policy=compact) retains the most recent value for each key, deleting older versions. Compaction is ideal for state restoration, while time-based retention manages storage for event logs.

What configurations are needed for exactly-once semantics in a producer?+

Set 'enable.idempotence=true' and provide a unique 'transactional.id'. The producer must use transactional APIs: initTransactions(), beginTransaction(), sendOffsetsToTransaction(), and commitTransaction(). This ensures no duplicates and atomic commits across multiple partitions.

Why is ordering guaranteed only within a partition?+

Kafka achieves parallelism by distributing partitions across brokers. Each partition is an ordered, immutable sequence of records. Across partitions, records from different producers or keys are interleaved; ordering is not preserved. Applications needing strict global order must use a single partition, reducing throughput.

What does the 'acks' configuration control in a Kafka producer?+

The 'acks' property specifies how many partition replicas must acknowledge a write before the producer considers it successful. 'acks=0' (no acknowledgment), 'acks=1' (leader only), 'acks=all' (all in-sync replicas). Higher acks reduce the chance of data loss but increase latency.

Keep studying

Build the next review session

Browse another free bank or use the study strategy guide to turn your misses into spaced review.