Try
↑ ↓ move↵ openesc close

Interview prep / Partitioned logs

Junior · Partitioned logs · System design interview question

What is an offset, and how does a consumer use it?

Sketch your own answer first, then compare it with the one below.

A strong answer

An offset is the position of a message inside one partition, counted from the start. It never changes for that message.

A consumer remembers the offset of the next message it should read. It saves that value from time to time, which is called committing. After a restart, it begins from the committed offset.

Work done after the last commit is repeated, so consumers should tolerate repeats. An offset only means something inside its own partition.

Sources

Learn it by running it

The partitioned logs lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms