skip to content

Messaging & Streaming

The brokers and streaming platforms teams use to decouple services and move events between them. Interviewers probe this area because almost every distributed system has an async path, and picking the wrong messaging model is expensive to undo.

on this pageshow

explore

→ has its own guide

questions

1,094 · 2 sections

What is the purpose of bootstrap.servers, and why don't you need to list every broker?

level: juniorimportance: must knowfreq 80%
basics
~20 s

bootstrap.servers is the initial list of broker host:port pairs a client contacts to discover the full cluster. After the first metadata fetch the client learns all brokers, so the list only needs a few entries for redundancy.

open as a page

What is a Kafka broker, and what role does broker.id play in a cluster?

level: juniorimportance: must knowfreq 75%
basics
~10 s

A broker is a single Kafka server that stores topic partition data and serves produce/fetch requests. broker.id is its unique numeric identifier within the cluster; no two brokers may share the same id.

open as a page

What is a Kafka partition's commit log, and why is it split into segments on disk?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Each partition is an append-only log: records are only added to the end, never changed in place. Kafka splits that log into fixed-size files called segments so old data can be deleted or compacted one whole file at a time instead of editing one giant file.

open as a page

What is the Kafka log cleaner, and how do you enable it for a topic?

level: juniorimportance: must knowfreq 60%
basics
~20 s

The log cleaner is a background process that runs compaction: it scans a topic's log and keeps only the latest record per key, deleting older duplicates. You enable it by setting the topic config cleanup.policy=compact.

open as a page

Why does Kafka rely on the operating system page cache instead of maintaining its own in-process (JVM heap) record cache?

level: juniorimportance: must knowfreq 70%
basics
~20 s

Kafka writes data to files and lets the OS keep recently used file pages in RAM (the page cache). It avoids a JVM heap cache to dodge GC pressure, double-buffering, and to reuse the OS cache that survives broker restarts.

open as a page

A standby cluster is kept fed by an ongoing copy and carries no writers — what happens when an operator switches onto it?

level: juniorimportance: must knowfreq 58%
basics
~20 s

Writers are pointed at the standby, readers restarted there, and only one site keeps accepting writes. The standby holds only what the copier had carried, and a reader's stored position from the source names a different record there.

open as a page

Your only continuity plan for a live stream is last night's file backup of the broker data volumes. What has that already cost you by morning?

level: juniorimportance: must knowfreq 58%
basics
~20 s

A file backup fixes a stream at the instant it was taken, so every record written since is gone, along with every reader's progress. Streams keep moving while files do not, which is why the gap is counted in hours.

open as a page

Why is a cross-cluster copy of a stream always behind the source cluster that feeds it?

level: juniorimportance: must knowfreq 70%
basics
~20 s

A cross-cluster copier is an ordinary client of both clusters: the source stores a record and answers the writer before the copier has even read it. The record therefore exists on the source first and on the target some time later.

open as a page

Your stream is copied asynchronously to a second cluster — why can the recovery point you state for it never be smaller than the copy lag?

level: juniorimportance: must knowfreq 70%
basics
~20 s

The asynchronous copy hop sets the floor. Records acknowledged on the source cluster but not yet carried to the target exist in one place only, so losing the source loses them — the recovery point is at least the copy lag.

open as a page

Before a broker answers a write, what can the writer be made to wait for, and what does each option cost in write latency?

level: juniorimportance: must knowfreq 72%
basics
~20 s

A write can be answered with no wait at all, once the leader holds it, once a majority of copies hold it, or once every caught-up copy holds it. Each rung up adds a network round trip of latency and removes one way to lose the record.

open as a page