Docsity

[CPRG] Confluent Program Certification Exam Preparation, Exams of Technology

Toggle sidebar
bg1
[CPRG] Confluent Program Certification
Exam Preparation
**Question 1.** In Kafka, which component is primarily responsible for maintaining the cluster
metadata and performing leader election?
A) Producer
B) Consumer
C) ZooKeeper/KRaft
D) Broker
Answer: C
Explanation: ZooKeeper (or KRaft in newer versions) stores metadata, tracks broker
membership, and conducts leader elections for partitions.
**Question 2.** What guarantees does Kafka provide about the order of messages within a
single partition?
A) No ordering guarantee
B) FIFO ordering
C) LIFO ordering
D) Random ordering
Answer: B
Explanation: Kafka preserves the order of records as they are appended to a partition, delivering
them in first‑in‑first‑out (FIFO) order to consumers.
**Question 3.** Which configuration controls the number of acknowledgments a producer
requires from the broker before considering a write successful?
A) linger.ms
B) acks
C) retries
D) compression.type
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
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61

Partial preview of the text

Download [CPRG] Confluent Program Certification Exam Preparation and more Exams Technology in PDF only on Docsity!

Exam Preparation

Question 1. In Kafka, which component is primarily responsible for maintaining the cluster metadata and performing leader election? A) Producer B) Consumer C) ZooKeeper/KRaft D) Broker Answer: C Explanation: ZooKeeper (or KRaft in newer versions) stores metadata, tracks broker membership, and conducts leader elections for partitions. Question 2. What guarantees does Kafka provide about the order of messages within a single partition? A) No ordering guarantee B) FIFO ordering C) LIFO ordering D) Random ordering Answer: B Explanation: Kafka preserves the order of records as they are appended to a partition, delivering them in first‑in‑first‑out (FIFO) order to consumers. Question 3. Which configuration controls the number of acknowledgments a producer requires from the broker before considering a write successful? A) linger.ms B) acks C) retries D) compression.type

Exam Preparation

Answer: B Explanation: The acks setting determines whether the producer waits for zero, one, or all in‑sync replicas to acknowledge a write. Question 4. If a producer sets acks=all and enable.idempotence=true, what delivery semantics does it achieve? A) At‑most‑once B) At‑least‑once C) Exactly‑once (within a single partition) D) Fire‑and‑forget Answer: C Explanation: With acks=all and idempotence enabled, the producer guarantees exactly‑once delivery semantics for each partition, preventing duplicate writes. Question 5. Which of the following best describes a Kafka consumer group? A) A set of producers that share the same topic B) A collection of consumers that jointly consume partitions of a topic C) A group of brokers that replicate data D) A set of schemas stored in the registry Answer: B Explanation: Consumers in the same group divide the topic’s partitions among themselves, ensuring each message is processed by only one member of the group. Question 6. In the Kafka consumer API, what does the max.poll.interval.ms setting control? A) Maximum time between heartbeats to the broker

Exam Preparation

Question 9. Which Kafka Streams operation creates a new stream by applying a function to each record of the original stream? A) filter() B) map() C) join() D) aggregate() Answer: B Explanation: map() transforms each record’s key/value pair using a user‑defined function, emitting a new KStream. Question 10. In Kafka Streams, what is the purpose of a “state store”? A) To hold configuration properties B) To persist intermediate aggregation results for stateful operations C) To store topic metadata D) To cache producer acknowledgments Answer: B Explanation: State stores provide fault‑tolerant storage for stateful transformations such as joins, aggregations, and windowed operations. Question 11. Which window type in Kafka Streams creates non‑overlapping, fixed‑size windows? A) Hopping window B) Sliding window C) Tumbling window D) Session window Answer: C

Exam Preparation

Explanation: Tumbling windows are fixed‑size, non‑overlapping windows that start immediately after the previous one ends. Question 12. What does the ksqlDB command CREATE STREAM do? A) Creates a new Kafka topic with default settings B) Materializes a view that continuously reads from an existing topic C) Starts a background connector process D) Generates a schema in the Schema Registry Answer: B Explanation: CREATE STREAM defines a logical stream over an existing Kafka topic, enabling continuous query processing. Question 13. Which broker configuration controls the maximum size of a single log segment file? A) log.segment.bytes B) log.retention.hours C) log.cleanup.policy D) log.flush.interval.messages Answer: A Explanation: log.segment.bytes determines when Kafka rolls over to a new segment file; it defines the maximum segment size. Question 14. In a Kafka cluster, what condition causes a partition to be considered “under‑replicated”? A) The leader has higher LEO than followers B) ISR size is less than the configured replication factor

Exam Preparation

Question 17. Which authentication mechanism in Kafka uses a username and password stored in a JAAS configuration file? A) GSSAPI (Kerberos) B) SCRAM-SHA- 256 C) PLAIN D) OAuthBearer Answer: C Explanation: The PLAIN mechanism transmits a clear‑text username and password, typically configured via JAAS. Question 18. In Kafka Connect, what is the purpose of a Single Message Transform (SMT)? A) To change the connector’s configuration at runtime B) To apply a lightweight transformation to each record as it passes through the pipeline C) To replicate data between clusters D) To enforce schema compatibility checks Answer: B Explanation: SMTs are applied to individual records for simple modifications (e.g., renaming fields, dropping columns) before they reach the sink or source. Question 19. Which JMX metric is most useful for detecting consumer lag? A) kafka.server.BrokerTopicMetrics.BytesInPerSec B) kafka.consumer.ConsumerFetcherManager.records-lag-max C) kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs D) kafka.log.Log.FlushStats.num-flushes Answer: B

Exam Preparation

Explanation: records-lag-max indicates the maximum lag (in records) of a consumer group behind the log end offset. Question 20. When using MirrorMaker 2, what does the “offset syncs” feature accomplish? A) Replicates topic configurations only B) Copies consumer group offsets from source to target cluster, enabling seamless failover C) Synchronizes broker IDs across clusters D) Guarantees exactly‑once delivery across clusters Answer: B Explanation: Offset syncs allow consumer groups to resume consumption in the target cluster from the same position they had in the source cluster. Question 21. Which of the following best describes the role of the High Watermark (HW) in a Kafka partition? A) The offset of the most recent record written to the leader B) The smallest offset that is guaranteed to be replicated to all in‑sync replicas C) The offset of the last record that has been compacted D) The offset of the first record in the log segment Answer: B Explanation: The high watermark marks the highest offset that all ISR members have replicated; only records up to HW are considered committed. Question 22. In the Producer API, what does the linger.ms parameter control? A) Maximum time a producer will wait for acknowledgments B) Time to wait before sending a batch, allowing more records to accumulate C) Interval between retries after a failed send

Exam Preparation

A) It must be larger than heartbeat.interval.ms B) It determines how long a consumer can be idle before the broker removes it from the group C) It sets the maximum time a consumer can take to process a record D) It configures the maximum time the broker waits for a leader election Answer: B Explanation: If the broker does not receive a heartbeat within session.timeout.ms, it considers the consumer dead and triggers a rebalance. Question 26. In ksqlDB, what does the EMIT CHANGES clause do when used with a SELECT statement? A) Persists the result set to a new Kafka topic B) Continually streams query results as new data arrives C) Forces the query to run in batch mode only D) Triggers a one‑time snapshot of the current state Answer: B Explanation: EMIT CHANGES tells ksqlDB to produce a continuous result stream, updating the client as new records match the query. Question 27. Which ACL operation would you use to allow a principal to produce messages to any topic? A) Allow READ on * B) Allow WRITE on * C) Allow CREATE on * D) Allow DELETE on * Answer: B

Exam Preparation

Explanation: The WRITE permission grants the ability to produce messages to the specified resource; using * applies it to all topics. Question 28. What is the primary advantage of using the compact cleanup policy on a Kafka topic? A) Guarantees that all messages are retained for a fixed time period B) Removes duplicate keys, keeping only the latest value for each key C) Ensures that messages are deleted as soon as they are consumed D) Increases the number of partitions automatically Answer: B Explanation: Log compaction retains the most recent record for each unique key, allowing recovery of the latest state without retaining the entire log history. Question 29. In a Kafka Streams topology, which method would you use to combine records from two streams based on a common key within a time window? A) leftJoin() B) merge() C) branch() D) foreach() Answer: A Explanation: leftJoin() (or join()) merges two KStreams using a key and optional windowing to align records temporally. Question 30. Which of the following best describes the behavior of a Kafka consumer when enable.auto.commit is set to false? A) Offsets are committed automatically after each poll B. Offsets are never committed, even if the application calls commitSync()

Exam Preparation

Question 33. In the context of Kafka Connect, what is the difference between a “source” connector and a “sink” connector? A) Source connectors read data from Kafka and write to external systems; sink connectors do the opposite B) Source connectors write data into Kafka; sink connectors read data from Kafka and deliver it elsewhere C) Source connectors transform messages; sink connectors compress them D) There is no functional difference; the terms are interchangeable Answer: B Explanation: Source connectors ingest data from external systems into Kafka topics, while sink connectors export Kafka data to external destinations. Question 34. Which metric would you monitor to detect a broker that is experiencing high garbage collection pause times? A) kafka.network.RequestMetrics.TotalTimeMs B) java.lang:type=GarbageCollector,Name=G1 Young Generation/CollectionTime C) kafka.log.LogFlushStats.num-flushes D) kafka.controller.ControllerStats.LeaderElectionRateAndTimeMs Answer: B Explanation: The JVM garbage collector MBean provides collection time and count, useful for spotting long GC pauses that affect broker performance. Question 35. When configuring a Kafka producer for high throughput, which combination of settings is most appropriate? A) acks=all, linger.ms=0, batch.size= B) acks=0, linger.ms=5, batch.size=32768, compression.type=snappy C) acks=1, linger.ms=1000, batch.size=1024, compression.type=uncompressed

Exam Preparation

D) acks=all, linger.ms=500, batch.size=4096, compression.type=gzip Answer: B Explanation: Disabling acknowledgments (acks=0), adding a modest linger, increasing batch size, and enabling compression (e.g., Snappy) maximize throughput at the cost of reliability. Question 36. Which of the following statements about Kafka’s “exactly‑once semantics” (EOS) for streams is correct? A) EOS is achieved solely by setting enable.idempotence=true on the producer B) EOS requires both idempotent producers and transactional writes across input and output topics C) EOS can be guaranteed without using the transaction API if the consumer commits offsets manually D) EOS is only available for consumer groups with a single member Answer: B Explanation: End‑to‑end exactly‑once semantics in Kafka Streams rely on idempotent producers and transactional writes that span all involved topics. Question 37. In a multi‑cluster environment, what is the primary purpose of “Cluster Linking” in Confluent Platform? A) To replicate topic configurations only B) To provide a low‑latency, byte‑for‑byte replication of selected topics between clusters C) To synchronize consumer group offsets across clusters automatically D) To enable cross‑cluster security policy enforcement Answer: B Explanation: Cluster Linking creates a direct, efficient replication link that streams data at the byte level from a source to a target cluster.

Exam Preparation

Explanation: Larger segment sizes reduce the total number of segment files, which can improve compaction and reduce file‑system overhead. Question 41. In Kafka Streams, what does the suppress() operator do? A) Drops records that do not meet a filter predicate B) Delays emitting intermediate aggregation results until a window closes C) Removes duplicate keys from a stream D) Converts a KTable back into a KStream Answer: B Explanation: suppress() holds back intermediate results of a windowed aggregation, emitting only the final result when the window is complete. Question 42. Which of the following is NOT a valid SASL mechanism for Kafka authentication? A) PLAIN B) SCRAM-SHA- 256 C) GSSAPI D) TLS Answer: D Explanation: TLS is a transport encryption protocol, not a SASL authentication mechanism. The others are supported SASL mechanisms. Question 43. When configuring a Kafka consumer with auto.offset.reset=earliest, what will happen if the consumer group has no committed offsets? A) The consumer will start reading from the latest offset (end of log) B) The consumer will start from the earliest offset (beginning of log)

Exam Preparation

C) The consumer will throw an exception and stop D) The consumer will wait until offsets are manually assigned Answer: B Explanation: auto.offset.reset=earliest tells the consumer to start at the beginning of each partition when no prior offset is found. Question 44. Which of the following best describes the purpose of the replication.throttled.replicas broker setting? A) To limit the bandwidth used by followers that are lagging behind the leader B) To prevent a broker from becoming a leader for too many partitions C) To throttle the rate at which producers can send messages D) To restrict the number of concurrent consumer fetches Answer: A Explanation: This setting caps the replication traffic for replicas that are falling behind, preventing them from overwhelming the network. Question 45. In ksqlDB, which statement creates a materialized view that can be queried like a table? A) CREATE STREAM my_view AS SELECT … B) CREATE TABLE my_view AS SELECT … C) CREATE VIEW my_view AS SELECT … D) CREATE MATERIALIZED VIEW my_view AS SELECT … Answer: B Explanation: CREATE TABLE … AS SELECT defines a persistent, stateful view (a KTable) that can be queried directly.

Exam Preparation

Explanation: Log compaction retains the latest record for each unique key, ensuring at most one version per key remains. Question 49. In the Producer API, what is the purpose of the max.in.flight.requests.per.connection setting? A) Limits the number of concurrent network connections a producer can open B) Controls how many unacknowledged produce requests can be sent to a broker at once C) Sets the maximum batch size in bytes D) Determines the maximum number of retries before aborting Answer: B Explanation: This setting caps the number of pending produce requests, affecting ordering guarantees when retries occur. Question 50. Which of the following is NOT a valid state store type in Kafka Streams? A) RocksDB B) In‑memory (RAM) C) File‑system based (Log) D) Redis Answer: D Explanation: Kafka Streams provides in‑memory and RocksDB state stores; external stores like Redis are not built‑in. Question 51. When a broker experiences a “Not Leader for Partition” error, what is the most likely cause? A) The client attempted to write to a follower replica B) The broker’s log directory is full

Exam Preparation

C) The consumer group has no assigned partitions D) The topic has been deleted Answer: A Explanation: This error occurs when a producer or consumer sends a request to a broker that is not the current leader for the targeted partition. Question 52. Which configuration controls the maximum amount of data a consumer will fetch in a single request? A) max.partition.fetch.bytes B) fetch.min.bytes C) fetch.max.bytes D) receive.buffer.bytes Answer: C Explanation: fetch.max.bytes limits the total bytes returned in a single fetch response from the broker. Question 53. In a Kafka Streams topology, which operator would you use to split a stream into multiple sub‑streams based on a predicate? A) map() B) filter() C) branch() D) flatMap() Answer: C Explanation: branch() evaluates predicates and routes each record to one or more downstream streams accordingly.