What is unidirectional data flow in a mobile UI, and why do modern frameworks like SwiftUI and Jetpack Compose lean on it?

technical-conceptual · Junior level · software-engineering

What the interviewer is really asking

Probes whether the candidate understands the state-drives-UI model behind declarative mobile frameworks and why it reduces a class of UI-consistency bugs.

What to say

What to avoid

Example answers

Strong: Unidirectional data flow means state flows down into the UI and events flow up: I hold a single source of truth, the view is rendered as a function of that state, and a user action sends an event that updates the state, which re-renders the view. In SwiftUI and Compose I'm not poking widgets imperatively from ten places, so the screen can't drift out of sync with the data. The big win is predictability — the same state always produces the same UI, which makes bugs far easier to trace.

Weak: It's the way SwiftUI and Compose handle state automatically. You set up bindings and the UI just updates itself, so you don't really have to think about the data flow.

Want questions matched to your role? Paste a job title, job description, or CV and get a personalized set, or go Pro to unlock the full bank.