# Kafka for System Design Interviews

DevFeed: [Kafka for System Design Interviews](<https://devfeed.tech/articles/kafka-for-system-design-interviews-32314.md>)

Original publisher: [Read original article](<https://evanking1.medium.com/kafka-for-system-design-interviews-f031ac05d186?source=rss-9736778727ef------2>)

Author: Evan King

Published: 2024-07-01T03:18:09Z

Content type: article

Language: en

Sources: [Evan King](<https://devfeed.tech/sources/evan-king.md>)

Topics: [Apache Kafka](<https://devfeed.tech/topics/apache-kafka.md>), [Event-Streaming](<https://devfeed.tech/topics/event-streaming.md>), [Publish-subscribe pattern](<https://devfeed.tech/topics/pubsub.md>), [real-time](<https://devfeed.tech/topics/real-time.md>)

Tags: [event-streaming](<https://devfeed.tech/tags/event-streaming.md>), [google](<https://devfeed.tech/tags/google.md>), [interviews](<https://devfeed.tech/tags/interviews.md>), [kafka](<https://devfeed.tech/tags/kafka.md>), [message-queue](<https://devfeed.tech/tags/message-queue.md>), [meta](<https://devfeed.tech/tags/meta.md>), [performance-scalability](<https://devfeed.tech/tags/performance-scalability.md>), [scalability](<https://devfeed.tech/tags/scalability.md>), [stream-processing](<https://devfeed.tech/tags/stream-processing.md>), [system-design](<https://devfeed.tech/tags/system-design.md>), [system-design-interview](<https://devfeed.tech/tags/system-design-interview.md>)

## AI overview

Kafka is presented as a distributed event streaming platform that can serve as a message queue or stream processing system. The World Cup example shows how brokers and partitions distribute storage and processing, while routing events for a game to the same partition preserves their order. Producers write messages to topics; consumers read them, and consumer groups distribute processing across consumers. Topics organize data by subject and let consumers subscribe selectively. Partitions are ordered, append-only logs that enable parallel consumption. The text says queue consumers acknowledge processed messages, while stream consumers do not, allowing more complex processing. Kafka stores and serves data, while developers create and process the messages. The supplied text is an excerpt and does not cover the article's promised advanced detail.

## Source excerpt

By the Co-founder of www.hellointerview.comIntro There is a good chance you've heard of Kafka. It's popular. In fact, according to their website, it's used by 80% of the Fortune 100. If it's good enough to help scale the largest companies in the world, it's probably good enough for your next system design interview. In fact, it's one of the top 5 technologies we see used in design interviews. Apache Kafka is an open-source distributed event streaming platform that can be used either as a message queue or as a stream processing system. Kafka excels in delivering high performance, scalability, and durability. It's engineered to handle vast volumes of data in real-time, ensuring that no message is ever lost and that each piece of data is processed as swiftly as possible. In this deep dive, we're going to take a top down approach. Starting with a zoomed out view of Kafka and progressing into more and more detail. If you know the basics, feel free to skip ahead to the more advanced sections. A Motivating Example It's the World Cup (my personal favorite competition). And we run a website that provides real-time statistics on the matches. Each time a goal is scored, a player is booked, or a substitution is made, we want to update our website with the latest information. Events are placed on a queue when they occur. We call the server or process responsible for putting these events on the queue the producer. Downstream, we have a server that reads events off the queue and updates the website. We call this the consumer. Now, imagine the World Cup expanded from just the top 48 teams to a hypothetical 1,000-team tournament, and all the games are now played at the same time. The number of events has increased significantly, and our single server hosting the queue is struggling to keep up. Similarly, our consumer feels like it has its mouth under a firehose and is crashing under the load. We need to scale the system by adding more servers to distribute our queue. But how do we e