What is the difference between batch processing and stream processing? Give an example of stream processing, such as using Apache Kafka.
💡 Model Answer
Batch processing handles data in large, discrete chunks at scheduled intervals, typically using tools like Hadoop MapReduce or Spark batch jobs. It is suitable for historical analytics where latency is not critical. Stream processing, on the other hand, processes data continuously as it arrives, providing low‑latency, real‑time insights. It uses event‑driven architectures and stateful operators. An example of stream processing is using Apache Kafka as a messaging backbone, where producers publish events to topics and consumers subscribe to those topics. A Kafka Streams application can perform real‑time aggregation, filtering, or enrichment on the fly, emitting results to downstream systems. This allows use cases like fraud detection, live dashboards, or real‑time recommendation engines, where decisions must be made within milliseconds.
This answer was generated by AI for study purposes. Use it as a starting point — personalize it with your own experience.
🎤 Get questions like this answered in real-time
Assisting AI listens to your interview, captures questions live, and gives you instant AI-powered answers on a discreet on-screen overlay.
Get Assisting AI — Starts at ₹500