All jobs / Mobile developer / Cross-Platform
Mobile developer interview question · 1–3 years
A Flutter screen parses a large file and the UI freezes for about a second while it does. Why, and what do you do?
The strongest answer
Dart runs your code and the UI on one isolate, so a long parse blocks the frame loop. Move that CPU work to another isolate; making it async alone changes nothing because nothing is waiting
Why it works
Right — async helps when you are waiting on something; here the CPU itself is busy, so the work has to move.
What a good answer covers
- One isolate runs UI and code.
- CPU work blocks the frame loop.
- Move heavy parsing to an isolate.
- Async does not free the CPU.
Answers that fall short
- Close, but not the strongest: Make the parse asynchronous and await it so it stops blocking the screen
Close, but await only yields around waiting. A synchronous parse still holds the isolate and the frames still drop. - Weak: Show a spinner during the parse so it does not look frozen to the user
A spinner that does not animate is worse than no spinner: the UI thread is blocked, so nothing paints. - Red flag: Run it in a loop with small delays, and if it still stutters we can lower the app’s frame rate
Degrading the whole app’s smoothness to hide one slow parse spreads the cost to every other screen.
Who gets asked this
More Cross-Platform questions
- A cross-platform codebase has is-iOS / is-Android checks scattered through the screens, and a fix for one…
- A Flutter upgrade enables Impeller everywhere. What do you do before the store push?
- A native app will host one React Native flow. What do you insist on?
- An RN screen is slow and the team wants to “rewrite in native.” What do you do first?
- You will migrate a native app toward RN (or the other way) over a year. What does the programme look like?
- Frontend web engineers will contribute to RN. What ownership model actually works?
- A Flutter screen rebuilds the whole tree on every keystroke. What is the first fix?
- A React Native list reshuffles items and several rows show the wrong image. What do you look at first?