Why this matters: two things are notable about this API — the message size cap, which constrains the storage design, and the operation that is missing, which confirms the retention model.
Key takeaway
Six calls. Parameters like producer or consumer IDs are assumed available from the underlying connection context, so they do not appear in the signatures.
Topic lifecycle
create(topic_ID, topic_name)
Parameter
Description
topic_ID
Uniquely identifies the topic
topic_name
Contains the name of the topic
Returns an acknowledgment on success or an error on failure.
delete_topic(topic_ID)
Parameter
Description
topic_ID
The ID of the topic which is to be deleted
Publishing and reading
write(topic_ID, message)
Parameter
Description
message
The message to be written in the system
Writes a message to the specified topic_ID. Messages have a maximum size of 1 MB. Returns an acknowledgment or error.
read(topic_ID)
Parameter
Description
topic_ID
The ID of the topic against which the message will be read
Retrieves a message object from the specified topic_ID.
Subscription
subscribe(topic_ID)
Parameter
Description
topic_ID
The ID of the topic to which the consumer will be subscribed
Registers the consumer as a subscriber to the specified topic_ID.
unsubscribe(topic_ID)
Parameter
Description
topic_ID
The ID of the topic against which the consumers will be unsubscribed
Removes the consumer's subscription to the specified topic_ID.
What is missing
Key takeaway
Six calls: create and delete_topic for lifecycle, write and read for data, subscribe and unsubscribe for registration. The 1 MB cap enables the append-only storage design, and the absence of delete_message is what makes a shared single copy safe.
Interview signal by level
Level
What a strong answer sounds like
L4
"Publish, subscribe, and read, plus create and delete topics."
L5
Notes the subscription is durable: "subscribe writes a record, so a consumer that restarts keeps its subscription and its position rather than starting over."
Staff+
Reads the absence: "there's no delete-message call, unlike a queue — deletion is retention-driven, because a consumer deleting a message would destroy other subscribers' data. That's what makes a single shared copy safe and forces per-consumer offsets. And the 1 MB cap is what keeps writes as small contiguous appends; anything large goes to blob storage with a reference in the message."
Next: the design that looks obvious and does not work.
Enjoying the preview?
Create a free account to unlock the rest of this course, the in-browser judge, and live AI mock interviews.