Apache Kafka is a distributed platform used to publish, store, and process streams of event data.
Incorrect! Try again.
2What is a topic in Apache Kafka?
Fundamentals of Apache Kafka
Easy
A.A physical network connection
B.A named category for messages
C.A database engine that automatically converts every message into a relational table
D.A Spark worker process
Correct Answer: A named category for messages
Explanation:
A Kafka topic is a named category or feed in which messages are stored.
Incorrect! Try again.
3Which description best matches an event in Kafka?
Fundamentals of Apache Kafka
Easy
A.A folder containing broker logs
B.A command that installs Kafka
C.A record of something that occurred
D.A configuration file for Spark
Correct Answer: A record of something that occurred
Explanation:
A Kafka event is a record representing an action, state change, or occurrence.
Incorrect! Try again.
4What is a Kafka broker?
Apache Kafka cluster architecture
Easy
A.A client that only creates Spark jobs
B.A file that lists Kafka topics
C.A server that stores and serves messages
D.A dashboard for writing SQL queries
Correct Answer: A server that stores and serves messages
Explanation:
A broker is a Kafka server that receives, stores, and delivers messages.
Incorrect! Try again.
5Why is a Kafka topic divided into partitions?
Apache Kafka cluster architecture
Easy
A.To convert events into images
B.To support parallelism and scalability
C.To remove all message keys
D.To ensure that every broker runs a separate operating system with unrelated configuration settings
Correct Answer: To support parallelism and scalability
Explanation:
Partitions allow Kafka to distribute data and process messages in parallel.
Incorrect! Try again.
6What is the main purpose of replication in a Kafka cluster?
Apache Kafka cluster architecture
Easy
A.To rename Kafka topics
B.To create producer applications
C.To compress Spark programs
D.To improve fault tolerance
Correct Answer: To improve fault tolerance
Explanation:
Replication keeps copies of partition data on multiple brokers, helping Kafka continue operating after failures.
Incorrect! Try again.
7Which software platform is commonly required to run Apache Kafka?
Apache Kafka installation
Easy
A.PHP
B.Ruby
C.MATLAB
D.Java
Correct Answer: Java
Explanation:
Apache Kafka runs on the Java Virtual Machine, so a compatible Java installation is commonly required.
Incorrect! Try again.
8What should usually be configured before starting a Kafka broker?
Apache Kafka installation
Easy
A.Consumer application output charts and dashboard themes
B.Spark DataFrame columns
C.HTML page styles
D.Broker properties
Correct Answer: Broker properties
Explanation:
Broker properties define settings such as listeners, storage directories, and broker identity.
Incorrect! Try again.
9Which Spark feature is commonly used to process streaming data from Kafka?
Integration of Apache Kafka with Spark
Easy
A.Structured Streaming
B.Spark package documentation generator with static website output
C.Spark shell history
D.Spark GraphX only
Correct Answer: Structured Streaming
Explanation:
Spark Structured Streaming can read Kafka topics as streaming data sources.
Incorrect! Try again.
10In a Spark and Kafka integration, what role does Kafka usually play?
Integration of Apache Kafka with Spark
Easy
A.Graphics rendering engine
B.Streaming data source
C.Relational schema designer
D.Java code compiler
Correct Answer: Streaming data source
Explanation:
Kafka commonly supplies streams of messages that Spark reads and processes.
Incorrect! Try again.
11Which information does Spark need to connect to a Kafka cluster?
Integration of Apache Kafka with Spark
Easy
A.Monitor screen resolution
B.A complete list of every message that will ever be produced
C.Bootstrap server addresses
D.Java source file names
Correct Answer: Bootstrap server addresses
Explanation:
Bootstrap server addresses identify the Kafka brokers that Spark can initially contact.
Incorrect! Try again.
12What does a Kafka producer do?
Producer and consumer messaging model
Easy
A.Sends messages to topics
B.Schedules Spark worker nodes
C.Reads messages from topics
D.Deletes all broker files
Correct Answer: Sends messages to topics
Explanation:
A producer publishes messages to one or more Kafka topics.
Incorrect! Try again.
13What does a Kafka consumer do?
Producer and consumer messaging model
Easy
A.Creates physical servers
B.Reads messages from topics
C.Compiles Kafka source code
D.Replicates every topic to a separate cloud provider using a manually created database schema
Correct Answer: Reads messages from topics
Explanation:
A consumer subscribes to Kafka topics and reads their messages.
Incorrect! Try again.
14What is the purpose of a Kafka consumer group?
Producer and consumer messaging model
Easy
A.To rename partitions automatically
B.To install Java on producer machines
C.To combine brokers into one computer
D.To share message processing among consumers
Correct Answer: To share message processing among consumers
Explanation:
Consumers in a group divide topic partitions among themselves to process data in parallel.
Incorrect! Try again.
15Which sequence represents a basic Kafka data pipeline?
Kafka pipeline
Easy
A.Consumer to Java to producer
B.Spark to monitor to keyboard
C.Broker to compiler to partition
D.Producer to Kafka to consumer
Correct Answer: Producer to Kafka to consumer
Explanation:
A basic pipeline sends data from a producer into Kafka, where a consumer can read it.
Incorrect! Try again.
16What is the role of Kafka in a data pipeline?
Kafka pipeline
Easy
A.Transporting and buffering event data
B.Compiling operating systems
C.Replacing all producers and consumers with a single relational database that never stores event streams
D.Drawing application icons
Correct Answer: Transporting and buffering event data
Explanation:
Kafka transports event data between systems and buffers it until consumers process it.
Incorrect! Try again.
17What does an offset identify in a Kafka partition?
Kafka pipeline
Easy
A.A broker password
B.A message position
C.A topic color
D.A Spark installation directory
Correct Answer: A message position
Explanation:
An offset is a numeric position that identifies a message within a partition.
Incorrect! Try again.
18Which ingestion pattern processes events soon after they are generated?
Ingestion patterns
Easy
A.Manual archiving
B.Batch ingestion
C.Periodic ingestion that collects records for several months before any processing begins
D.Real-time ingestion
Correct Answer: Real-time ingestion
Explanation:
Real-time ingestion processes incoming events with very low delay.
Incorrect! Try again.
19Which ingestion pattern collects data over a period before processing it together?
Ingestion patterns
Easy
A.Event replication
B.Batch ingestion
C.Real-time ingestion
D.Continuous topic subscription
Correct Answer: Batch ingestion
Explanation:
Batch ingestion gathers data into groups and processes each group at scheduled intervals.
Incorrect! Try again.
20Which ingestion pattern is suitable for continuously arriving sensor readings?
Ingestion patterns
Easy
A.Monthly batch export
B.Offline processing that waits until the sensor system has permanently stopped generating all readings
C.Streaming ingestion
D.Manual file copying
Correct Answer: Streaming ingestion
Explanation:
Streaming ingestion is suitable for continuous data sources such as sensors, logs, and user activity events.
Incorrect! Try again.
21An application requires all events for the same customer to be processed in the order in which they were produced. Which Kafka design best supports this requirement?
Fundamentals of Apache Kafka
Medium
A.Disable replication for the target topic
B.Create a separate consumer group per event
C.Use the customer ID as the message key
D.Send each event to a random partition
Correct Answer: Use the customer ID as the message key
Explanation:
Kafka hashes the message key to select a partition. Events with the same customer ID therefore reach the same partition, where ordering is preserved.
Incorrect! Try again.
22A Kafka topic has a retention period of seven days. A consumer remains offline for nine days and then resumes from its last committed offset. What is the most likely outcome?
Fundamentals of Apache Kafka
Medium
A.Kafka reconstructs deleted records from replicas
B.Kafka extends retention for the inactive consumer
C.The consumer automatically reads from another topic
D.The consumer may find its required offsets unavailable
Correct Answer: The consumer may find its required offsets unavailable
Explanation:
Kafka retention is independent of whether a consumer has read the records. Offsets referring to deleted log segments may no longer be available.
Incorrect! Try again.
23A topic contains six partitions, and each partition receives approximately 500 messages per second. Assuming an even distribution, what is the approximate total ingestion rate?
Fundamentals of Apache Kafka
Medium
A.3,000 messages per second
B.6,000 messages per second
C.1,500 messages per second
D.500 messages per second
Correct Answer: 3,000 messages per second
Explanation:
The approximate total rate is messages per second.
Incorrect! Try again.
24A partition has replication factor 3. Its leader broker fails, but two replicas remain in the in-sync replica set. What should the cluster normally do?
Apache Kafka cluster architecture
Medium
A.Wait for the failed broker indefinitely
B.Promote an in-sync replica as leader
C.Merge the partition with another partition
D.Delete the partition and recreate it
Correct Answer: Promote an in-sync replica as leader
Explanation:
Kafka can elect an available in-sync replica as the new leader, allowing reads and writes to continue while preserving replicated data.
Incorrect! Try again.
25A Kafka topic has 12 partitions and is consumed by one consumer group containing 15 active consumers. How many consumers can process records simultaneously at most?
Apache Kafka cluster architecture
Medium
A.3 consumers
B.12 consumers
C.27 consumers
D.15 consumers
Correct Answer: 12 consumers
Explanation:
Within a consumer group, each partition is assigned to at most one consumer. Therefore, only 12 consumers can be active for 12 partitions.
Incorrect! Try again.
26Why are partition replicas usually distributed across different Kafka brokers?
Apache Kafka cluster architecture
Medium
A.To preserve data after a broker failure
B.To eliminate the need for topic retention
C.To assign multiple leaders per partition
D.To guarantee ordering across all partitions
Correct Answer: To preserve data after a broker failure
Explanation:
Distributing replicas across brokers prevents one broker failure from removing every copy of a partition.
Incorrect! Try again.
27When configuring a multi-broker Kafka cluster, which combination is required for the brokers to operate as members of the same cluster?
Apache Kafka installation
Medium
A.Unique node IDs and the same cluster identity
B.Identical listener ports on the same host
C.Identical node IDs and different cluster IDs
D.Unique topic names on every broker
Correct Answer: Unique node IDs and the same cluster identity
Explanation:
Each broker must have a unique node or broker identifier, while all brokers must be initialized and configured as members of the same Kafka cluster.
Incorrect! Try again.
28Kafka starts successfully, but remote clients receive broker addresses such as localhost:9092 and cannot connect. Which configuration should be checked first?
Apache Kafka installation
Medium
A.The advertised listener address
B.The topic retention duration
C.The partition replication factor
D.The consumer group identifier
Correct Answer: The advertised listener address
Explanation:
Kafka returns its advertised listener address to clients. That address must be reachable from the client network rather than resolving only inside the broker host.
Incorrect! Try again.
29After installing Kafka, an administrator wants to verify end-to-end messaging before connecting Spark. Which test is most appropriate?
Apache Kafka installation
Medium
A.Create a topic, stop all brokers, and list offsets
B.Create a topic, produce records, and consume them
C.Increase replication, remove storage, and rebalance
D.Delete a topic, restart clients, and inspect logs
Correct Answer: Create a topic, produce records, and consume them
Explanation:
Creating a topic and successfully sending and receiving records verifies basic broker availability, topic operation, and client connectivity.
Incorrect! Try again.
30A Spark Structured Streaming application must resume from the correct Kafka offsets after a driver restart. Which feature should be configured?
Integration of Apache Kafka with Spark
Medium
A.A new consumer group for every trigger
B.A checkpoint location on durable storage
C.A larger Kafka producer batch size
D.A smaller replication factor for the topic
Correct Answer: A checkpoint location on durable storage
Explanation:
Spark stores streaming progress and source offsets in its checkpoint location, allowing the query to recover after a restart.
Incorrect! Try again.
31A Kafka topic has eight partitions, but a Spark streaming job is configured with 20 executor cores. What primarily limits the initial parallelism of Kafka reads?
Integration of Apache Kafka with Spark
Medium
A.The number of output columns
B.The number of consumer offsets
C.The number of Kafka partitions
D.The number of Spark actions
Correct Answer: The number of Kafka partitions
Explanation:
Kafka source work is divided by topic partitions. With eight partitions, extra cores may not increase source-read parallelism unless data is repartitioned later.
Incorrect! Try again.
32In Spark Structured Streaming, Kafka records expose key and value as binary columns. What should the application normally do before applying string or JSON operations?
Integration of Apache Kafka with Spark
Medium
A.Commit the binary columns as Kafka offsets
B.Cast the required binary columns to strings
C.Replicate the columns across all executors
D.Convert every partition into a consumer group
Correct Answer: Cast the required binary columns to strings
Explanation:
Kafka keys and values are read as binary data. They must normally be cast or decoded before string parsing or JSON schema extraction.
Incorrect! Try again.
33A Spark streaming query reads Kafka events containing event timestamps and performs a windowed aggregation. Which feature helps limit state for events arriving late?
Integration of Apache Kafka with Spark
Medium
A.Reducing the Kafka replication factor
B.Disabling Spark query checkpointing
C.Increasing the Kafka retention period
D.Watermarking on the event-time column
Correct Answer: Watermarking on the event-time column
Explanation:
A watermark defines how late event-time data may arrive and allows Spark to remove old aggregation state after the lateness threshold.
Incorrect! Try again.
34A producer sets acks=all for a replicated Kafka topic. What is the main effect?
Producer and consumer messaging model
Medium
A.Every consumer acknowledges the record before success
B.The leader waits for acknowledgments from in-sync replicas
C.The broker disables batching for the produced record
D.The producer writes directly to every topic partition
Correct Answer: The leader waits for acknowledgments from in-sync replicas
Explanation:
With acks=all, the leader waits for the required in-sync replicas to acknowledge the write, improving durability compared with weaker acknowledgment settings.
Incorrect! Try again.
35A consumer processes a record and commits its offset before writing the result to a database. The database write then fails. What delivery problem can occur?
Producer and consumer messaging model
Medium
A.The producer retries the database operation
B.The record may be skipped after restart
C.The topic retention period becomes invalid
D.The record must move to another partition
Correct Answer: The record may be skipped after restart
Explanation:
Because the offset was committed first, the consumer may restart after that record and never retry the failed database write, causing message loss at the application level.
Incorrect! Try again.
36Two independent applications must each receive every event from the same Kafka topic. How should their consumers be configured?
Producer and consumer messaging model
Medium
A.Use one shared consumer group ID
B.Use one shared producer transaction ID
C.Use two different consumer group IDs
D.Use the same partition assignment manually
Correct Answer: Use two different consumer group IDs
Explanation:
Each consumer group receives its own logical copy of the topic stream. Consumers sharing one group divide partitions instead of independently receiving all events.
Incorrect! Try again.
37In a pipeline producers → Kafka → Spark → database, the database becomes temporarily slow. What Kafka capability most directly helps absorb the slowdown?
Kafka pipeline
Medium
A.Persistent buffering of records in topic partitions
B.Global ordering of records across every partition
C.Automatic conversion of records into database rows
D.Automatic scaling of the destination database
Correct Answer: Persistent buffering of records in topic partitions
Explanation:
Kafka retains records independently of downstream processing speed, allowing Spark to fall behind temporarily and catch up later.
Incorrect! Try again.
38Several producers send JSON events to a shared Kafka topic, but they use incompatible field types for the same attribute. Which pipeline practice best prevents processing failures?
Kafka pipeline
Medium
A.Commit offsets before producing each JSON event
B.Apply a governed schema with compatibility checks
C.Disable replication for malformed event partitions
D.Assign every producer to a separate consumer group
Correct Answer: Apply a governed schema with compatibility checks
Explanation:
Schema governance and compatibility validation help producers evolve event formats without unexpectedly breaking Spark or other downstream consumers.
Incorrect! Try again.
39A company must ingest continuous sensor readings with low latency while also importing one large historical file each night. Which design is most appropriate?
Ingestion patterns
Medium
A.Use streaming ingestion for sensors and batch ingestion for files
B.Use only request-response ingestion for both data sources
C.Use only manual ingestion for both data sources
D.Use batch ingestion for sensors and streaming ingestion for files
Correct Answer: Use streaming ingestion for sensors and batch ingestion for files
Explanation:
Continuous sensor events fit streaming ingestion, while a scheduled historical file is naturally handled as a batch workload.
Incorrect! Try again.
40A corrected Spark transformation must be applied to the last three days of Kafka events without asking producers to resend them. Which ingestion pattern enables this?
Ingestion patterns
Medium
A.Reduce topic retention before restarting Spark
B.Replay retained events from earlier offsets
C.Rebalance consumers into a single partition
D.Change producer keys after records are stored
Correct Answer: Replay retained events from earlier offsets
Explanation:
Kafka retention allows a consumer or Spark job to restart from earlier offsets and reprocess historical events, provided those records have not expired.
Incorrect! Try again.
41A producer publishes records with keys A, B, and C to a topic with six partitions using Kafka's default key-based partitioning. What property is guaranteed if the number of partitions remains unchanged?
Fundamentals of Apache Kafka
Hard
A.Records with null keys preserve ordering across all partitions
B.Records with different keys are assigned to different partitions
C.Records from each producer are evenly distributed across partitions
D.Records with the same key are assigned to the same partition
Correct Answer: Records with the same key are assigned to the same partition
Explanation:
Kafka hashes a non-null key to select a partition. Therefore, the same key consistently maps to the same partition while the partition count remains unchanged; ordering is guaranteed only within that partition.
Incorrect! Try again.
42A Kafka topic has retention.ms=86400000 and retention.bytes=10737418240. The topic contains 20 GB of log data, and all segments are older than the retention time. Which statement best describes retention behavior?
Fundamentals of Apache Kafka
Hard
A.Kafka retains the newest 10 GB regardless of segment age
B.Kafka deletes only records that have been consumed
C.Kafka deletes eligible segments when either limit requires deletion
D.Kafka retains data until both limits are exceeded
Correct Answer: Kafka deletes eligible segments when either limit requires deletion
Explanation:
Time-based and size-based retention are independent deletion conditions. Eligible log segments may be removed when the time limit or the size limit is exceeded, subject to segment granularity.
Incorrect! Try again.
43A producer uses acks=all and enables idempotence. A record is acknowledged after being written to all in-sync replicas, but the leader fails before the producer receives the response. What is the safest producer behavior?
Fundamentals of Apache Kafka
Hard
A.Retry the record because idempotence suppresses duplicate appends
B.Switch to acks=1 to avoid blocking on replica recovery
C.Discard the record because the broker may have committed it
D.Publish the record to every replica directly
Correct Answer: Retry the record because idempotence suppresses duplicate appends
Explanation:
The missing response creates uncertainty about the result. Retrying is appropriate, and the producer ID plus sequence number allows the broker to detect and suppress a duplicate append.
Incorrect! Try again.
44A topic has replication factor 3 and min.insync.replicas=2. The producer uses acks=all. One replica becomes unavailable, but the leader and one follower remain in the ISR. What is the expected result for new writes?
Apache Kafka cluster architecture
Hard
A.Writes fail because all replicas must acknowledge them
B.Writes are accepted but become immediately uncommitted
C.Writes continue only after the failed replica catches up
D.Writes continue because the ISR still meets the minimum
Correct Answer: Writes continue because the ISR still meets the minimum
Explanation:
With acks=all, the leader requires acknowledgments from the current ISR. Since the ISR contains two replicas and the minimum is two, new writes can succeed.
Incorrect! Try again.
45A topic's partitions are distributed across three brokers, but each partition's leader and its first replica are placed in the same rack. What is the main unresolved availability risk?
Apache Kafka cluster architecture
Hard
A.Partition ordering is lost whenever replicas share a rack
B.A broker failure cannot trigger a new leader election
C.Consumers cannot commit offsets while racks are active
D.A rack failure can remove leaders for multiple partitions
Correct Answer: A rack failure can remove leaders for multiple partitions
Explanation:
Replica distribution across brokers does not automatically provide rack-level fault isolation. If leaders and their replicas share a rack, one rack failure can affect leadership and availability for many partitions.
Incorrect! Try again.
46A consumer group has eight consumers assigned to a topic with five partitions. Assuming no idle or standby assignment behavior, what is the most accurate result?
Apache Kafka cluster architecture
Hard
A.Each consumer receives a replicated copy of every partition
B.The group creates three additional partitions automatically
C.Eight consumers share the five partitions concurrently
D.Five consumers receive one partition and three remain idle
Correct Answer: Five consumers receive one partition and three remain idle
Explanation:
Within a consumer group, each partition is assigned to at most one consumer. Therefore, no more than five consumers can actively consume this five-partition topic at once.
Incorrect! Try again.
47A Kafka installation is configured with a listener advertised as PLAINTEXT://localhost:9092, and remote Spark executors attempt to connect using the broker metadata. The TCP port is reachable, but clients still fail after metadata retrieval. What is the most likely cause?
Apache Kafka installation
Hard
A.The topic has fewer partitions than the executor count
B.The producer has not enabled idempotent delivery
C.The consumer group has not committed an initial offset
D.The broker advertises an address unreachable from executors
Correct Answer: The broker advertises an address unreachable from executors
Explanation:
Kafka clients use advertised listener addresses returned in metadata for subsequent broker connections. Advertising localhost causes remote clients to resolve the broker as themselves rather than the Kafka host.
Incorrect! Try again.
48An administrator starts a Kafka broker in KRaft mode but supplies only a broker process role and no controller quorum configuration. Which outcome is expected in a standard combined-node deployment?
Apache Kafka installation
Hard
A.The broker runs as a controller using the first data partition
B.The broker cannot form or join the required controller quorum
C.The broker silently falls back to ZooKeeper mode
D.The broker starts normally and discovers controllers automatically
Correct Answer: The broker cannot form or join the required controller quorum
Explanation:
KRaft requires explicit controller quorum configuration and appropriate process roles. Without controller information, the node cannot participate in metadata management or form the quorum.
Incorrect! Try again.
49A broker is configured with a log directory on a nearly full disk. Kafka begins rejecting new records even though topic-level retention appears correct. Which operational explanation is most plausible?
Apache Kafka installation
Hard
A.Kafka requires every topic to have exactly one log directory
B.Kafka rejects records whenever any consumer has lag
C.Kafka protects the broker using disk-based log directory failure thresholds
D.Kafka disables retention while producers use acks=all
Correct Answer: Kafka protects the broker using disk-based log directory failure thresholds
Explanation:
Kafka monitors log-directory availability and can treat a directory as failed or stop accepting writes when storage is exhausted. Retention settings do not guarantee immediate space reclamation.
Incorrect! Try again.
50A Structured Streaming query reads Kafka records, performs a deterministic transformation, and writes to an idempotent external sink. The query fails after the sink write but before the Spark checkpoint is updated. What behavior should the sink support?
Integration of Apache Kafka with Spark
Hard
A.It should rely only on Kafka's producer transaction timeout
B.It should reject every record whose offset was previously seen
C.It should delete all output produced by the failed micro-batch
D.It should tolerate replayed records using deterministic keys
Correct Answer: It should tolerate replayed records using deterministic keys
Explanation:
The source may replay records because the checkpoint did not advance. An idempotent sink can use stable event identifiers or offsets as keys to make repeated writes produce the same final state.
Incorrect! Try again.
51A Spark Structured Streaming job reads from Kafka with startingOffsets=latest, but the query is restarted after its checkpoint directory is deleted. New records arrive during startup. Which result is expected?
Integration of Apache Kafka with Spark
Hard
A.The query restores offsets from the Kafka consumer group
B.The query starts at offset zero for every assigned partition
C.The query resumes from the earliest offset retained by Kafka
D.The query begins near the latest offsets observed at initialization
Correct Answer: The query begins near the latest offsets observed at initialization
Explanation:
For a new query without a checkpoint, startingOffsets=latest begins from the latest available offsets when the source initializes. A checkpoint, when present, takes precedence over this option.
Incorrect! Try again.
52A Kafka topic has 100 partitions, but a Spark streaming query is limited by maxOffsetsPerTrigger to 10,000 records. If partition rates are highly skewed, what limitation can this setting introduce?
Integration of Apache Kafka with Spark
Hard
A.A global cap can delay high-volume partitions disproportionately
B.Kafka automatically balances records before Spark reads them
C.Each partition is guaranteed exactly 100 records per trigger
D.The cap changes the topic's partition count during execution
Correct Answer: A global cap can delay high-volume partitions disproportionately
Explanation:
The cap limits the total records processed per trigger. Allocation across partitions may be rate-weighted rather than equal, so skew and allocation decisions can cause some high-volume partitions to accumulate lag.
Incorrect! Try again.
53A Spark job reads Kafka data, applies a stateful aggregation, and is configured with a short trigger interval. Processing time regularly exceeds the trigger interval. What is the most likely consequence?
Integration of Apache Kafka with Spark
Hard
A.The query automatically changes the aggregation to stateless mode
B.Kafka deletes unprocessed records after each trigger
C.Micro-batches queue behind one another and latency increases
D.Spark runs overlapping batches on the same state store
Correct Answer: Micro-batches queue behind one another and latency increases
Explanation:
Triggers schedule processing but do not force parallel execution of overlapping micro-batches for one query. If processing takes longer than the interval, effective latency and backlog increase.
Incorrect! Try again.
54Two consumers belong to the same Kafka consumer group and process different partitions. Consumer A commits offset 120 for partition 0, while Consumer B fails before committing offset 85 for partition 1. After rebalance, what does the group normally resume from?
Producer and consumer messaging model
Hard
A.Offset 120 for partition 0 and the last committed offset for partition 1
B.The latest offset for both partitions regardless of commit state
C.The earliest retained offset for both partitions
D.Offset 85 for both partitions because the group commits globally
Correct Answer: Offset 120 for partition 0 and the last committed offset for partition 1
Explanation:
Offsets are committed per topic-partition, not as one global group position. Partition 0 uses its committed offset, while partition 1 reprocesses data after its own last committed offset.
Incorrect! Try again.
55A consumer processes a record for 40 seconds, while max.poll.interval.ms is 30 seconds. The consumer continues sending heartbeats but does not call poll during processing. What is the likely result?
Producer and consumer messaging model
Hard
A.The consumer may be removed from the group for exceeding poll interval
B.The consumer automatically receives a larger poll interval
C.The consumer remains assigned because heartbeats replace polling
D.The broker commits the record after the heartbeat timeout
Correct Answer: The consumer may be removed from the group for exceeding poll interval
Explanation:
max.poll.interval.ms limits the time between application poll calls. Heartbeats maintain session liveness but do not satisfy the processing-progress requirement enforced by the poll interval.
Incorrect! Try again.
56A producer sends keyed events to a partition. Retries are enabled, but idempotence is disabled. A transient acknowledgment failure causes a retry after the first append succeeded. Which issue is possible?
Producer and consumer messaging model
Hard
A.The retry is guaranteed to replace the original record
B.The consumer group removes the original record during retry
C.The same event can appear twice in the partition log
D.Kafka assigns the retry to a different partition automatically
Correct Answer: The same event can appear twice in the partition log
Explanation:
Without idempotence, the producer cannot prevent a retry from being appended after an earlier attempt already succeeded. Kafka preserves both records unless application-level deduplication is used.
Incorrect! Try again.
57A pipeline consumes clickstream events, enriches them, and republishes results to a second Kafka topic. The enrichment service is nondeterministic and the output topic is compacted. Which design most reliably supports replay without inconsistent final state?
Kafka pipeline
Hard
A.Disable output compaction so replayed records are discarded
B.Commit offsets before enrichment to reduce duplicate processing
C.Persist deterministic enrichment inputs and use stable output keys
D.Use random output keys so every replay remains independently visible
Correct Answer: Persist deterministic enrichment inputs and use stable output keys
Explanation:
Replay can repeat processing, and nondeterministic enrichment can change results. Stable keys and reproducible inputs allow later records to represent the intended final state in a compacted topic.
Incorrect! Try again.
58A Kafka pipeline has a source topic, a stream processor, and a sink topic. The processor commits source offsets before publishing sink records. If it crashes immediately afterward, what failure mode is most likely?
Kafka pipeline
Hard
A.Records are duplicated because sink publication precedes commits
B.The sink reconstructs missing records from consumer lag
C.Kafka rolls back the source commit automatically
D.Records can be lost because committed offsets hide unpublished output
Correct Answer: Records can be lost because committed offsets hide unpublished output
Explanation:
Committing before the sink write means a crash can advance the source position without producing the corresponding output. Restarted processing skips those records.
Incorrect! Try again.
59A pipeline uses a compacted Kafka topic for the latest customer profile. A tombstone for customer C7 is produced, but downstream consumers start after the tombstone has been removed. What conclusion is correct?
Kafka pipeline
Hard
A.Compaction permanently preserves every tombstone for replay
B.The consumer is guaranteed to infer deletion from the missing key
C.Kafka recreates the deleted profile when a consumer joins
D.The consumer may retain stale state unless it rebuilt from a valid snapshot
Correct Answer: The consumer may retain stale state unless it rebuilt from a valid snapshot
Explanation:
Compaction eventually removes tombstones after the configured delay. A consumer that missed the tombstone may not learn about the deletion unless it has another authoritative state-rebuild mechanism.
Incorrect! Try again.
60A Spark streaming application must ingest a bursty Kafka workload while preventing a temporary spike from exhausting executor memory. Which strategy is most appropriate?
Ingestion patterns
Hard
A.Bound records per trigger and allow Kafka lag to absorb bursts
B.Increase Kafka retention while reading every available record immediately
C.Use one consumer for every event to eliminate queueing
D.Set the trigger interval to zero and process unlimited records
Correct Answer: Bound records per trigger and allow Kafka lag to absorb bursts
Explanation:
A per-trigger ingestion limit, such as maxOffsetsPerTrigger, controls batch size and memory pressure. Unprocessed records remain in Kafka and contribute to lag until capacity catches up.
Incorrect! Try again.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill.
The rest comes out of a student's own pocket: the domain, the storage,
and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason.
to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it.
What it pays for →