Flow & Operators
KOTLIN › Concurrency
Cold flows, intermediate vs terminal operators, context, buffering, and exception transparency in Kotlin Flow.
Flow is the backbone of reactive, asynchronous streams on modern Android, sitting between coroutines and UI state. Interviewers probe whether you understand cold execution, the upstream/downstream model, where context and exceptions are handled, and which operator solves which problem. Mixing up combine/zip, catch placement, or flowOn direction is a common way candidates get caught out.
What this covers
- Cold vs hot flows: each collector re-runs a cold flow's producer block independently
- Intermediate (map/filter/transform/debounce) return a Flow lazily; terminal (collect/toList/first) trigger execution
- flowOn changes only the upstream context; downstream stays in the collector's context
- Exception transparency: emit only in flow {}, never wrap emit in try/catch; recover with the catch operator
- catch handles upstream exceptions only, not the collect lambda or downstream operators
- Backpressure and merging: buffer vs conflate vs collectLatest, and combine vs zip vs flatMapLatest
Study this topic
- Flow & Operators explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Flow & Operators interview questions and answers