Skip to content

ONE QUESTION. YOUR REASONING.

Design a distributed message queue

Design a distributed message queue like Kafka: producers write messages to topics, consumers read them once or many times, and messages are kept for two weeks.

System designInfrastructure and platformStaff

YOUR BRIEF

What to work through

Work through a distributed message queue as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.

  • Producers send messages and consumers read them
  • A message can be read once or many times
  • Order is kept within a partition
  • Messages are kept for two weeks, then truncated
  • Delivery is configurable: at most once, at least once or exactly once

BEFORE YOU START

Constraints to discuss

  • Two-week retention, durable on disk and copied across nodes
  • High throughput or low latency, chosen per use case
  • Scales with a sudden surge of messages
  • At-least-once delivery at minimum
Need a starting point?

Watch for these common gaps as you prepare:

  • Promising order across a whole topic
  • Storing messages in a relational database
  • Committing before processing and calling it at least once
  • More consumers than partitions, expecting more throughput
  • No answer for rebalancing
Read: System design questions and who asks them

Why this question is in the collection

These sources connect the problem to company interview reports or preparation guides. They do not guarantee what a company will ask you.

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.