Skip to main content
InterviewHubPRO
Section Overview
Q19

Question 19 of 50

Part 2: Coroutines, Flow & Concurrency Architecture (11 - 24)

38%
Kotlin & Coroutines (50 Qs)•Part 2: Coroutines, Flow & Concurrency Architecture (11 - 24)

What is the difference between StateFlow, SharedFlow, and Channels in Kotlin?

senior LevelSystem DesignGolang

In Simple Words:

  • StateFlow: Hot state holder that always has a current value and emits updates to collectors (conflates duplicate values).
  • SharedFlow: Hot event stream that can broadcast one-time events to multiple subscribers with configurable replay buffers.
  • Channel: Point-to-point communication where each value is delivered to exactly one consumer.