Flutter Interview Questions: Practical and Conceptual

Published · by JOBB GROUP FZE

Flutter interviews test two things at once. Conceptual questions check that you understand how the framework turns widgets into pixels and when it rebuilds them. Practical questions check that you can read a short piece of Dart and say what will go wrong. This guide gives you both, in the order interviewers tend to raise them, with answers based on the official Flutter documentation checked in November 2026.

Each answer is written as a model you can adapt, not a script to memorise. Interviewers notice recited answers; they reward candidates who connect a concept to something they built.

Part 1: Questions every candidate should expect

What is the difference between a StatelessWidget and a StatefulWidget?

A StatelessWidget describes UI that depends only on its configuration and on inherited data. A StatefulWidget pairs an immutable widget with a separate, long-lived State object that can change over time.

A stronger answer adds when build runs. The Flutter API reference lists three typical triggers for a stateless widget: the first time it is inserted into the tree, when its parent changes its configuration, and when an InheritedWidget it depends on changes.

What does setState actually do?

The API reference says it notifies the framework that the internal state of the State object has changed, which schedules a rebuild. Three details separate good answers from average ones:

  • The callback must be synchronous. It must not return a future, so do the async work first and wrap only the assignment in setState.
  • Calling it after the framework has called dispose is an error. Checking mounted works, but the documentation prefers cancelling the timer, animation or subscription that triggered the call.
  • The direct cost is small; the indirect cost of rebuilding a large subtree is not. Keep slow work, such as writing to a file, outside the callback.

Hot reload or hot restart: what is the difference?

According to the Flutter docs, hot reload loads code changes into the running Dart VM (or, on the web, the browser) and rebuilds the widget tree while preserving app state; it does not rerun main() or initState(). Hot restart loads the changes but restarts the app and loses state. Both work only in debug mode, and the docs now state that Flutter web supports both.

Interviewers often follow up with “when does hot reload not pick up a change?” The documented cases include native code changes (Kotlin, Java, Swift, Objective-C), changing a class to an enum or the reverse, changing generic type declarations, and edits to global variable or static field initialisers, which are treated as state. A change inside initState() will also appear to do nothing, because that code does not run again.

What are keys and when do you need them?

The API reference defines a Key as an identifier for widgets, elements and semantics nodes. A new widget only updates an existing element if its key matches; without keys, Flutter matches widgets by runtime type and position in the tree.

That second sentence is the practical answer. If you reorder, insert into or delete from a list of stateful items of the same type, position-based matching can attach the wrong State to the wrong item. A ValueKey built from a stable ID fixes it. Custom keys subclass either LocalKey or GlobalKey.

How do Flutter tests differ?

The testing overview names three categories. A unit test checks a single function, method or class. A widget test checks a single widget’s UI and interactions. An integration test checks a complete app or a large part of one. The documentation’s trade-off table rates them as follows.

Trade-off Unit Widget Integration
Confidence Low Higher Highest
Maintenance cost Low Higher Highest
Dependencies Few More Most
Execution speed Quick Quick Slow

The docs describe a well-tested app as having many unit and widget tests, tracked by code coverage, plus enough integration tests to cover the important use cases. Quote that balance and give one example of each from your own project.

Part 2: Questions that separate experienced candidates

How would you choose a state management approach?

Start with the built-in options listed in the Flutter docs: setState for widget-specific, ephemeral state; ValueNotifier and InheritedNotifier for updating state with only Flutter’s own APIs; and InheritedWidget and InheritedModel, the low-level way to pass data between ancestors and descendants. The same page notes that package:provider and many other approaches use InheritedWidget under the hood.

Then explain your criteria rather than naming a favourite package: how much state is shared across screens, how testable the logic needs to be, team familiarity, and how much boilerplate the team will tolerate. An answer that says “for a two-screen form I kept it in setState; for the shopping basket shared by six screens we used X because…” is worth more than any list.

The UI stutters while parsing a large JSON file. What do you do?

Diagnose first, then move the work off the main isolate. The isolates page explains that all Dart code runs in isolates, which have their own memory and communicate only by messages. By default a Flutter app does everything on the main isolate. The documented rule of thumb: use another isolate when a computation takes longer than the gap between frames and causes jank.

Isolate.run is the simplest tool. It spawns an isolate, runs a callback, returns the result and shuts the isolate down. On mobile and desktop, compute(fun, message) is equivalent; on the web, which does not support isolates, compute runs on the main thread, so the code still compiles. For repeated work, a long-lived background isolate communicating through SendPort and ReceivePort can perform better.

Mention the limits too. Spawned isolates cannot do widget or UI work or read assets through rootBundle, and while platform plugins can be used from a background isolate, it cannot receive unsolicited messages from the host platform.

How do you call native code from Flutter?

Flutter’s guide to platform-specific code describes platform channels as passing messages asynchronously between the Flutter client and the host platform, and lists Kotlin or Java for Android and Swift or Objective-C for iOS (plus C++ on Windows, Objective-C on macOS and C on Linux). Experienced candidates should mention Pigeon, which its documentation describes as a code generator that makes communication between Flutter and the host platform type-safe, easier and faster, and which removes the need to manage method-name strings across languages by hand.

How do you keep rebuilds cheap in a large screen?

The StatelessWidget reference gives a ready-made checklist:

  1. Use const widgets where possible, and give your own widgets const constructors.
  2. Reduce the number of nodes, for example by replacing a stack of Padding, Row and SizedBox with a single Align, or layered Containers with one CustomPaint.
  3. Extract reusable UI into widgets rather than helper methods, so a rebuild can be limited to what changed.
  4. Push state down so that setState rebuilds the smallest possible subtree.

Part 3: Read the code

Practical rounds often show a short snippet and ask what is wrong. The examples below are illustrative, written for this guide.

Exercise 1: the async setState

// Illustrative example
Future<void> _refresh() async {
  setState(() async {
    _items = await api.fetchItems();
  });
}

What to say: the callback is async and returns a future, which the API reference forbids. Fetch first, then check that the widget is still mounted and update state synchronously:

// Illustrative fix
Future<void> _refresh() async {
  final items = await api.fetchItems();
  if (!mounted) return;
  setState(() => _items = items);
}

A senior answer adds that the cleaner long-term fix is to cancel the request in dispose so the late update never arrives.

Exercise 2: the to-do list that swaps checkboxes

// Illustrative example
ListView(
  children: todos.map((t) => TodoTile(todo: t)).toList(),
)

TodoTile is stateful and keeps an “expanded” flag. After the user deletes the first item, the second tile appears expanded. What to say: without keys, Flutter matched the remaining widgets to the existing elements by type and position, so the State of the deleted tile moved to its neighbour. Add key: ValueKey(t.id).

Exercise 3: the change that “did not work”

A candidate edits a value assigned inside initState(), presses hot reload and sees no change. What to say: hot reload preserves state and does not run initState() again, so a hot restart is needed.

How answers should differ by level

Topic Fresher answer Experienced answer
State Explains setState correctly Justifies where each piece of state lives and why
Performance Knows const widgets help Has profiled jank and moved work to an isolate
Testing Names the three test types Describes the mix used on a real project and what it caught
Native code Knows platform channels exist Has written or generated channel code, for example with Pigeon

Before the interview

Pick one app you built and be ready to walk through its widget tree, its state, its tests and one bug you fixed. Put the same project, with a link to the repository, near the top of your CV; a software engineer resume builder can help you lay out projects, packages and platforms clearly. If you apply through online portals, run the CV through an ATS resume score checker to confirm that terms such as Flutter, Dart and the state management package from the advert are picked up. For questions about CV content itself, see our resume questions hub.

Frequently asked questions

What Flutter interview questions are asked of freshers?

Mostly the foundations: stateless versus stateful widgets, what setState does, hot reload versus hot restart, how layout widgets combine, and the three kinds of test. Expect to explain a small app you built, line by line.

What do experienced Flutter developers get asked?

Rebuild performance, keys, choosing and defending a state management approach, isolates for heavy work, platform integration, testing strategy and how you structured a large codebase. Interviewers want trade-offs, not definitions.

Do I need to know Dart well for a Flutter interview?

Yes. Most practical rounds are really Dart rounds: async and await, futures and streams, null safety, collections and immutability. Revise Dart alongside the framework.

Should I learn a specific state management package before the interview?

Learn whichever one the job advert names. If none is named, be fluent in setState and InheritedWidget-based approaches and able to explain why you would choose a package for a larger app.

Sources

Ready to build your resume?

Start with a sample or a blank page. No sign-up needed. Free to edit; US$1.00 only if you download a PDF.