NEW
Font size
S
M
L
XL
WorksheetsBig Data 5: Kafka
Total questions: 73
Worksheet time: 37mins
Name
Class
Date
1.
Which motivation for Kafka is explicitly stated as a reason it decouples data pipelines?
a)
Producers do not need to know about consumers
b)
Consumers must synchronously acknowledge producers before sending continues
c)
Producers directly call consumer endpoints over point-to-point channels
d)
Consumers decide which broker stores the topic data at publish time
e)
Brokers rewrite record payloads to match consumer-specific schemas
2.
According to the slide, which party is delegated responsibility for tracking the log partition offset (location)?
a)
Kafka brokers
b)
Zookeeper
c)
Consumers (clients)
d)
Producers
e)
Topic segments
3.
Which description best matches the slide's definition of Apache Kafka?
a)
A fast, scalable, durable, fault-tolerant publish-subscribe messaging system
b)
A single-node queue that deletes messages immediately after reading
c)
A transactional database that enforces strict ACID semantics on all writes
d)
A file transfer protocol optimized for moving large binary objects
e)
A request/response RPC framework using synchronous calls
4.
Kafka is presented as being used instead of JMS, RabbitMQ, and AMQP primarily because it provides which advantages on the slide?
a)
Built-in complex event processing as part of the broker
b)
Higher throughput, reliability, and replication
c)
Mandatory end-to-end encryption enforced by default
d)
Automatic global ordering across all partitions in a topic
e)
Guaranteed exactly-once delivery without extra design work
5.
Which use case is explicitly listed as a possibility for Kafka?
a)
Feeding events to CEP for complex event processing
b)
Replacing the operating system's scheduler for disk writes
c)
Providing a universal schema validator for all producers
d)
Serving as a DNS-based service discovery mechanism
e)
Running batch-only jobs without any streaming component
6.
The slide mentions Kafka as an external commit log for distributed systems. Which purpose is tied to that idea?
a)
Replicated data between nodes and re-sync for nodes to restore state
b)
Enforcing row-level security for consumers
c)
Guaranteeing global ordering across all topics
d)
Automatically converting records into relational tables
e)
Eliminating the need for replication across nodes
7.
Which set of companies is cited as processing 1 billion messages a day with Kafka?
a)
LinkedIn, Microsoft, and Netflix
b)
Google, Apple, and Amazon
c)
Meta, Oracle, and IBM
d)
Uber, Airbnb, and Lyft
e)
Salesforce, SAP, and Cisco
8.
The slide states that ordering is preserved at what granularity?
a)
Across the entire Kafka cluster
b)
Across all topics in the cluster
c)
At shard level (topic partition)
d)
Per consumer group across partitions
e)
Per broker across all hosted partitions
9.
Kafka's publish-subscribe/queue flexibility is said to scale with what factor?
a)
The number of consumer groups
b)
The number of topics only
c)
The retention period length
d)
The number of Zookeeper nodes
e)
The compression ratio configured on disk
10.
In the basic concepts diagram, Kafka is positioned primarily between which two categories of systems?
a)
Source systems and downstream consuming systems
b)
Only consumer systems and Zookeeper
c)
Only brokers and operating system kernels
d)
Only databases and batch schedulers
e)
Only monitoring systems and security systems
11.
Which downstream system is explicitly shown as a consumer destination in the basic concepts diagram?
a)
Real-time monitoring
b)
Email gateway
c)
DNS service
d)
Version control system
e)
OLTP transaction engine
12.
A Kafka record is described as immutable and containing which fields?
a)
Key (optional), value, and timestamp
b)
Key (required) and mutable value only
c)
Topic name, broker ID, and retention period
d)
Partition ID and consumer group ID only
e)
Segment ID, checksum, and encryption key
13.
Which term is defined as the category/feed name under which Kafka maintains message streams?
a)
Topic
b)
Segment
c)
Broker
d)
Offset
e)
ISR
14.
Which responsibility is attributed to Zookeeper in the architecture described on the slide?
a)
Providing an in-sync view of cluster configuration and enabling leadership election for broker and partition pairs
b)
Storing all topic log partitions and serving consumer fetch requests
c)
Performing batching and compression of messages on behalf of producers
d)
Assigning record keys and timestamps at write time
e)
Guaranteeing exactly-once delivery by tracking every consumer read
15.
The slide specifies that component communication uses what interface and transport?
a)
A simple binary API over TCP
b)
REST over HTTP
c)
SOAP over HTTP
d)
gRPC over QUIC
e)
File-based IPC via shared folders
16.
In the topics/producers/consumers diagram, which internal label appears inside the Kafka cluster in addition to Topic A and Topic B?
a)
__consumer_offsets
b)
__producer_offsets
c)
__topic_metadata
d)
__isr_state
e)
__cluster_config
17.
Which diagram-level statement best matches what is shown about producers and consumers?
a)
Multiple producers publish into the cluster while multiple consumers read from topics
b)
Consumers push records into the cluster while producers fetch from topics
c)
Brokers directly call producers to request new messages
d)
Zookeeper streams records directly to consumer applications
e)
Consumers and producers communicate point-to-point without topics
18.
In the ecosystem diagram, which component is shown as a core dependency above Kafka Core?
a)
Zookeeper
b)
Schema Registry
c)
Kafka Streams
d)
Avro
e)
Kafka REST Proxy
19.
Which statement aligns with the slide's description of a Kafka topic?
a)
A topic is a stream of records stored in a log
b)
A topic is a mutable table that updates records in place
c)
A topic is a per-consumer mailbox that deletes messages on read
d)
A topic is a network socket shared by all brokers
e)
A topic is a security policy applied to brokers
20.
In the pub/sub framing on the slide, which entity is described as a subscriber that can be zero or many per topic?
a)
Consumer groups
b)
Brokers
c)
Partitions
d)
Segments
e)
Producers
21.
Topics are broken into partitions that are usually decided by what attribute of a record, per the slide?
a)
The key of the record
b)
The consumer group ID
c)
The broker ID
d)
The retention period setting
e)
The timestamp only
22.
What scaling purpose is explicitly tied to partitions on the slide?
a)
Scaling Kafka across many servers
b)
Making messages mutable after publishing
c)
Eliminating replication across brokers
d)
Guaranteeing cluster-wide ordering across topics
e)
Encrypting every record by partition automatically
23.
Which claim about ordering is explicitly made for Kafka logs on the slide?
a)
Order is maintained only within a single partition
b)
Order is maintained across all partitions in a topic
c)
Order is maintained across all topics in the cluster
d)
Order is maintained across consumer groups by the broker
e)
Order is randomized to maximize throughput
24.
Records in a partition are assigned a sequential id number called what, according to the slide?
a)
Offset
b)
Segment
c)
Watermark
d)
Epoch
e)
Shard key
25.
In the partition layout illustration, writes are shown occurring relative to the "Older" and "Newer" direction in which way?
a)
Appended toward the "Newer" end
b)
Inserted into the middle of each partition
c)
Written backward toward "Older"
d)
Randomly distributed across prior offsets
e)
Reordered by consumers before storage
26.
What does the partition layout illustration imply about the number of records per partition at a given time?
a)
Different partitions can have different log lengths at the same time
b)
All partitions always contain the same number of records
c)
Partitions are merged into a single log before writes occur
d)
Partitions do not grow; they only rotate in place
e)
Partitions exist only in memory and never persist
27.
In Kafka partition replication, which server handles all read and write requests for a partition?
a)
Leader server
b)
Any follower server
c)
Zookeeper node
d)
Consumer instance
e)
Schema registry
28.
What is the term for a follower that is in-sync with the leader, per the slide?
a)
ISR (in-sync replica)
b)
Quorum replica
c)
Standby leader
d)
Segment mirror
e)
Broker proxy
29.
A record has been written to a partition leader, but not all in-sync replicas have written it yet. According to the slide, what should a consumer expect?
a)
The record is not readable until it is committed
b)
The record is readable immediately after the leader write
c)
The record is readable only after a consumer acknowledges it
d)
The record is readable only after the topic is compacted
e)
The record is never readable because replication is asynchronous
30.
The slide defines a record as "committed" when which condition holds?
a)
All ISRs for the partition wrote the record to their log
b)
At least one follower has started replication
c)
The producer has retried the send operation twice
d)
A consumer has fetched the record once
e)
Zookeeper has refreshed broker metadata
31.
The slide explicitly notes that leadership can be distributed. What is the statement made about leaders across partitions?
a)
Another partition can be owned by another leader on another Kafka broker
b)
All partitions must always share the same leader broker
c)
Partition leaders are always consumers elected by the client
d)
Leaders rotate on every write request regardless of partition
e)
Leaders exist only in Zookeeper and not on brokers
32.
Which Kafka retention mechanism is described as keeping only the latest record?
a)
Compaction
b)
Round-robin retention
c)
ISR retention
d)
Leader-only retention
e)
Offset truncation
33.
Which aspect is stated as not being impacted by the size of retained data, per the slide?
a)
Consumption speed
b)
Leader election speed
c)
Number of partitions per topic
d)
Producer key selection
e)
Zookeeper quorum size
34.
For a topic with replication factor N, how many server failures can Kafka tolerate without losing messages committed to the log, per the slide?
a)
Up to N-1
b)
Up to N
c)
Up to N/2
d)
Up to 1
e)
Up to 0
35.
What is the purpose of configuring a minimum available ISR, as described on the slide?
a)
Return an error if enough replicas are not available to replicate data
b)
Force consumers to read only from the leader broker
c)
Guarantee compaction runs before messages are readable
d)
Disable batching to reduce latency
e)
Ensure producers never need to pick a partition
36.
In the durable writes table, which request.required.acks setting corresponds to acknowledging only after all ISRs have received the record?
a)
-1
b)
0
c)
1
d)
2
e)
N
37.
Which request.required.acks value is paired with "ACK once the leader has received" in the durable writes table?
a)
1
b)
0
c)
-1
d)
All
e)
None
38.
Which option correctly matches the table's lowest durability behavior to its required acknowledgements and latency?
a)
No ACKs required; request.required.acks = 0; lowest per-event latency
b)
ACK once the leader has received; request.required.acks = 0; highest per-event latency
c)
ACK all ISRs have received; request.required.acks = 1; lowest per-event latency
d)
ACK all ISRs have received; request.required.acks = -1; medium per-event latency
e)
No ACKs required; request.required.acks = -1; highest per-event latency
39.
According to the producers slide, which component picks the partition a record is appended to?
a)
Producer
b)
Consumer
c)
Zookeeper
d)
Broker controller
e)
Schema registry
40.
Which partitioning approach is illustrated by sending all events of a given employeeId to the same partition?
a)
Semantic partitioning based on a key in the message
b)
Round-robin partitioning
c)
Time-based partitioning by timestamp
d)
Random partitioning per request
e)
Broker-driven partition assignment
41.
If producers are writing at offset 12 while Consumer Group A is reading from offset 9 (as shown), what offset gap is indicated between them?
a)
3
b)
1
c)
9
d)
12
e)
21
42.
Which statement best matches the offset depiction on the slide?
a)
Producers are positioned at a later offset than the consumer group's current read position
b)
The consumer group is reading from a later offset than producers are writing
c)
Producers and consumers are both fixed at offset 0
d)
Offsets are assigned per broker, so producer and consumer offsets cannot be compared
e)
Offsets decrease as records become newer
43.
Which statement about message lifecycle is explicitly stated on the consumer slide?
a)
Messages stay on Kafka; they are not removed after they are consumed
b)
Messages are removed immediately after a consumer fetch
c)
Messages are removed only after all consumer groups fetch them
d)
Messages are removed when the producer disconnects
e)
Messages are removed only after compaction runs
44.
According to the slide, what is each consumer responsible for managing?
a)
Its own offset
b)
The broker ID assignment
c)
The topic retention policy
d)
The partition leader election
e)
The log segment size threshold
45.
Within a single consumer group, how is a given record delivered according to the slide?
a)
Delivered to one consumer in the group
b)
Delivered to all consumers in the group
c)
Delivered only to the producer that wrote it
d)
Delivered only after log compaction
e)
Delivered only to consumers in different groups
46.
Which capability enables multiple consumer groups to perform different functions on the same topic, per the slide?
a)
Each consumer group maintains its own offset
b)
Producers keep separate logs per consumer group
c)
Brokers delete records immediately after a group reads them
d)
Consumer groups share a single global offset
e)
Topics are restricted to exactly one subscriber
47.
Which pattern is described as acting like a traditional queue with load balancing?
a)
All consumer instances in one group
b)
All consumer instances in different groups
c)
One consumer per topic only
d)
One group per partition only
e)
No consumer groups; direct broker reads
48.
Which pattern results in all messages being broadcast to all consumer instances?
a)
All consumer instances in different groups
b)
All consumer instances in one group
c)
Many consumer instances in one group
d)
One consumer per partition only
e)
Consumers are added only for durability
49.
What constraint is explicitly stated regarding the number of consumer instances relative to partitions?
a)
There cannot be more consumer instances than partitions
b)
There cannot be more partitions than consumer instances
c)
There must be exactly one consumer instance per topic
d)
There must be exactly one partition per broker
e)
There must be exactly one consumer group per cluster
50.
In the consumer-group diagram, what do consumer groups provide with respect to topics and partitions?
a)
Isolation
b)
Compaction
c)
Encryption
d)
Batching
e)
Service discovery
51.
According to the slide, what happens when new consumers join a consumer group?
a)
It gets a share of partitions
b)
All partitions are duplicated to every consumer
c)
The topic is repartitioned automatically into fewer partitions
d)
Offsets are reset to zero for all consumers
e)
The broker disables replication to avoid duplicates
52.
If a consumer dies, how are its partitions handled per the slide?
a)
Its partitions are split among remaining live consumers in the group
b)
Its partitions are permanently abandoned
c)
Its partitions are moved to a new topic
d)
Its partitions become readable only after compaction
e)
Its partitions are assigned to producers
53.
If a consumer fails before sending a commit offset to the broker, what delivery behavior is explicitly described on the slide?
a)
At least once (some records could be reprocessed)
b)
At most once (records are lost but never redelivered)
c)
Exactly once (records are delivered once and only once)
d)
Best effort (ordering is not preserved within partitions)
e)
None (consumption stops permanently)
54.
The slide recommends messages be idempotent. What reason is explicitly tied to this recommendation?
a)
Some Kafka records could be reprocessed after a failure
b)
Brokers randomly reorder records to improve throughput
c)
Producers cannot choose partitions
d)
Retention policy deletes uncommitted records immediately
e)
Consumers cannot read from replicated partitions
55.
Which definition matches "high watermark" on the slide?
a)
Offset of last record successfully replicated to all partition followers
b)
Offset of last record written by any producer
c)
Offset of first record in the log segment
d)
Offset of the next record a consumer will process
e)
Offset chosen by Zookeeper during leader election
56.
What is the consumer read limit stated on the slide?
a)
Consumers only read up to the high watermark
b)
Consumers can read beyond the log end offset
c)
Consumers can read un-replicated data if they are fast enough
d)
Consumers read only from followers, never leaders
e)
Consumers read only from compacted segments
57.
Within the same consumer group, how many consumers can access a single partition at a time, per the slide?
a)
Only one
b)
All consumers in the group
c)
Exactly two
d)
One per broker
e)
One per topic across the cluster
58.
What happens when the consumer count exceeds the partition count, according to the slide?
a)
Extra consumers remain idle and can be used for failover
b)
Partitions are automatically increased to match consumer count
c)
Consumers share a partition concurrently to maximize throughput
d)
Offsets are merged across consumers to eliminate duplicates
e)
The topic is deleted and recreated with more partitions
59.
Which statement about broker connectivity is explicitly stated on the slide?
a)
Connecting to one broker bootstraps the client to the entire cluster
b)
A client must connect to every broker to discover topics
c)
Clients can only connect through Zookeeper
d)
Each consumer group must connect to a separate broker
e)
Brokers cannot be discovered once the cluster starts
60.
What does a broker contain according to the slide?
a)
Topic log partitions
b)
Only consumer offsets
c)
Only producer metadata
d)
Only Zookeeper configuration
e)
Only schema registry objects
61.
According to the scaling slide, what mechanism allows Kafka to scale reads and writes on a single topic log?
a)
Sharding the topic log into partitions
b)
Deleting records after every consumer fetch
c)
Routing all writes through a single broker controller
d)
Disabling replication to reduce overhead
e)
Storing topics entirely in Zookeeper
62.
The slide attributes fast writes primarily to which property of filesystem I/O?
a)
Sequential writes to the filesystem are fast (e.g., around 700 MB/s or more)
b)
Random writes are faster than sequential writes
c)
Writes are avoided by keeping all data only in memory
d)
Consumers write the data instead of producers
e)
Zookeeper performs the disk I/O on behalf of brokers
63.
Which technique is described as amortizing network overhead by appending and consuming chunks together?
a)
Batching of individual messages
b)
Per-message synchronous RPC calls
c)
Leader election on every fetch request
d)
Compaction on every write
e)
Disabling compression to reduce CPU usage
64.
Zero copy I/O is described as using which OS call and Java method on the slide?
a)
Linux sendfile() and Java NIO FileChannel transferTo
b)
Linux fork() and Java Thread start
c)
Linux mmap() and Java ObjectOutputStream writeObject
d)
Linux cron and Java Timer schedule
e)
Linux chmod and Java File setReadable
65.
Which statement best matches how Linux PageCache and the I/O scheduler contribute to throughput on the slide?
a)
They batch consecutive small writes into bigger physical writes and attempt to re-sequence writes to minimize disk head movement
b)
They force every write to sync to disk immediately to minimize latency
c)
They disable batching so that each message is written separately
d)
They require manual configuration of free memory before Kafka can start
e)
They prevent the use of sendfile() to ensure data copies are explicit
66.
Which delivery semantic matches: messages are never lost but may be redelivered?
a)
At least once
b)
At most once
c)
Exactly once
d)
Leader only
e)
Follower only
67.
Which delivery semantic is labeled as the default on the slide set?
a)
At least once
b)
At most once
c)
Exactly once
d)
Best effort
e)
No delivery guarantee
68.
Which delivery semantic is characterized as "Much Harder (Impossible??)" on the slide?
a)
Exactly once
b)
At least once
c)
At most once
d)
Leader only
e)
Follower only
69.
Which delivery semantic matches: messages are lost but never redelivered?
a)
At most once
b)
At least once
c)
Exactly once
d)
Compacted only
e)
ISR only
70.
On the producer side of exactly-once considerations, what is the suggested response to a network error before an ack is returned?
a)
Use a single writer per partition and check the latest committed value after network errors
b)
Switch to request.required.acks = 0 to avoid retries
c)
Allow multiple writers per partition to increase throughput
d)
Delete the topic and recreate it with more partitions
e)
Force consumers to read beyond the high watermark
71.
On the consumer side, which combination of techniques is proposed on the slide to approach exactly-once behavior?
a)
Include a unique ID for de-duplication and consider storing offsets with data
b)
Disable compaction and rely on time-based retention only
c)
Force all consumers into a single group and avoid rebalancing
d)
Read only from followers and never from leaders
e)
Use round-robin partitioning and ignore message keys
72.
What position does the slide take on using Kafka for really large file transfers?
a)
Probably not; it is designed for messages, so consider file transfer or breaking files up and reading per line
b)
Yes; Kafka is designed primarily for moving large files as single messages
c)
Yes; Kafka automatically chunks and reassembles files at the broker
d)
No; Kafka cannot handle any payloads larger than a few bytes
e)
It depends only on Zookeeper quorum size
73.
If security on the broker and across the wire is important, what limitation is stated on the slide?
a)
Not right now; much in the way of security cannot be enforced
b)
Security is fully enforced and required for all clients
c)
Security is handled entirely by compaction settings
d)
Security is provided by having consumers manage their own offsets
e)
Security is guaranteed by shard-level ordering
Reset
