Sparround

Rapid-fire Flutter questions

Most Flutter interviews open with 10-20 short questions, 20-30 seconds each. The aim is not depth but checking that the fundamentals are solid.

The answer formula has three parts:

1. The direct answer — no preamble, no restating the question 2. A one-line WHY — the mechanism or the reason 3. One concrete example — the part that separates memorisation from real knowledge

Together they take 20-25 seconds. A long answer is a negative signal in this round: it suggests you did not notice the question was simple.

Question20-30 second answer
Stateless vs Stateful?Stateless holds no mutable internal state. Widgets are immutable, so mutable state lives in a separate `State` object that survives rebuilds — which is why controllers go there.
What does `setState` do?Runs the callback synchronously and marks the element dirty; the rebuild happens next frame. Which is why awaiting inside it is pointless.
What are the three trees?Widget (configuration, cheap), element (the live instance holding state), render (measure and paint). Diffing happens on the element tree.
What does `const` buy you?The widget is created at compile time and canonicalised, recognised as the same object on rebuild, so its whole subtree is skipped.
When do you need a Key?In a list of same-typed items that can reorder and hold state. Without it matching is positional and state lands on the wrong item.
The layout rule?Constraints go down, sizes go up, the parent sets position. Which is why a child cannot know its parent’s size.
Expanded vs Flexible?Expanded forces the child to fill the space (tight); Flexible lets it take less (loose). Expanded is a Flexible with a tight fit.
What is an InheritedWidget?The mechanism for passing data down the tree. `of(context)` both finds and subscribes, so only dependants rebuild when it changes. Provider is built on it.
What is a BuildContext?The widget’s position in the element tree. Being a position is what lets you look upward — and a wrong-level context is what produces "No Scaffold found".
watch vs read?watch subscribes and triggers rebuilds, read does not. The rule: watch in build, read in callbacks.
Future vs Stream?A Future is a single result, a Stream a sequence of events. A request is a Future; live updates are a Stream.
What is an isolate for?Moving heavy synchronous computation off the UI thread. Memory is not shared and communication is by message, so there are no race conditions.
UI vs raster thread?The UI thread runs Dart (build, layout); the raster thread paints via the GPU. Which one janks determines the fix.
The frame budget?About 16 ms at 60 fps. Exceed it and a frame drops, which the user sees as jank.
What does a widget test not need?A real device. Which is why it runs in seconds and can gate every PR in CI.
The pumpAndSettle trap?With an endless animation it never returns and the test times out. Those screens need an explicit `pump(Duration)`.
Hot reload vs hot restart?Hot reload swaps code and keeps state. Hot restart starts the app over and loses state. Changes to `main()` or globals need a restart.
Why profile mode?For measuring performance. Debug is unoptimised and release has profiling disabled.

Interview tip. Saying "I don't know" in this round is entirely normal and far better than inventing. Not knowing two or three out of fifteen is expected; interviewers almost always sense an invented answer, and afterwards they doubt everything else you said. The phrasing "I'm not certain, but my expectation would be..." shows both honesty and how you reason.

📚 Sources and documentation