androidengineers.Book a session
โ† All interview questions
KotlinIntermediate4 min

What is Unidirectional Flow?

Answer

Unidirectional Data Flow (UDF) is a design pattern where data flows in only one direction.

The Cycle

  1. State: Flows down from the ViewModel to the UI.
  2. Events: Flow up from the UI to the ViewModel (user actions).
  3. Mutation: The ViewModel processes the event and updates the State.

Benefits

  • Predictability: State is only changed in one place.
  • Debuggability: Easy to trace where data changed.
  • Testability: UI and Logic are decoupled.

Commonly implemented using `StateFlow` or `LiveData`.

Mark this when you can explain the answer in your own words.

Share & Help Others

Help fellow developers prepare for interviews

Sharing helps the Android community grow ๐Ÿ’š

Keep practising