Skip to content
tezvyn:

Flutter & Dart

Flutter framework, Dart language, packages, Impeller

29 bites

Test yourself: Top 30 Flutter & Dart interview questionsMultiple choice, with the correct answer and why it is correct on every question. Free, no sign-in. No advanced set yet. This is the full Flutter & Dart quiz.

Advanced interview questions in Flutter & Dart

advanced2 min read

What are Dart extension methods? Implement toIntOrDefault on String.

Tests Dart extension syntax and static resolution. A strong answer defines an extension on String, uses int.tryParse with a fallback, and notes extensions do not mutate the original type. Red flag: using try-catch over tryParse or claiming dynamic dispatch.

advanced2 min read

Explain Dart switch exhaustiveness for enums versus sealed classes

This tests Dart 3 exhaustiveness. A strong answer notes that enums and sealed classes both require exhaustive switches, but sealed classes allow distinct payloads because subclasses stay in the same library. A red flag is calling them just enums with methods.

Explain Dart's event loop, microtask queue, event queue, and await behavior
advanced2 min read

Explain Dart's event loop, microtask queue, event queue, and await behavior

Tests Dart single-threaded event loop model. Strong answer: microtasks drain before event queue tasks; await suspends the function and schedules its resumption via the event loop when the Future completes. Red flag: claiming await blocks the thread.

advanced2 min read

How does Dart resolve mixin method conflicts and application order?

Tests understanding of Dart's mixin linearization. Answer: Dart applies mixins left-to-right, building a superclass chain where the last mixin wins conflicts. Red flag: claiming first mixin wins or confusing with multiple inheritance.

advanced2 min read

Explain StreamController, write a broadcast stream example, and why close it?

This tests Dart stream lifecycle and memory safety. A strong answer uses StreamController.broadcast(), adds data and errors, closes it, and explains unclosed controllers leak memory.

advanced2 min read

Explain the lifecycle of a State object

List initState through dispose, emphasizing didUpdateWidget reacts to parent config changes.

advanced2 min read

What are Keys in Flutter and why are they critical?

Tests widget identity during reconciliation. Keys let Flutter distinguish moved widgets from changed data; without ValueKeys, ReorderableListView leaves state at old positions, e.g., a checkbox swap. Red flag: calling them performance tools.

advanced2 min read

How does const on a widget constructor impact build and reconciliation?

Tests widget canonicalization and reconciliation. Strong answers: const creates identical widget instances; Element.updateChild skips subtree rebuild when oldWidget == newWidget, saving elements and GC.

advanced2 min read

Explain Flutter's 'constraints down, sizes up' rule and unbounded height error

Parents constrain down, children size up. ListView in Column throws unbounded height as Column gives infinite maxHeight; fix with Expanded or shrinkWrap.

advanced1 min read

LayoutBuilder versus MediaQuery for responsive widgets

MediaQuery reports the whole window; LayoutBuilder gives the parent's actual constraints.

advanced2 min read

What problem does IntrinsicWidth solve and what are its performance costs?

This tests Flutter constraints and intrinsic sizing. A great answer covers: capping width to the child's max intrinsic width, aligning Column children, and the speculative pass that costs O(N²) in tree depth. A red flag is omitting performance cost.

advanced2 min read

Implement efficient async username validation in Flutter

Tests async field hygiene in Flutter. Outline: debounce 300ms, cancel inflight requests, decouple loading UI from errors, use reactive_forms async validators or manual streams. Red flag: API calls per keystroke without cancellation, loading treated as errors.

advanced2 min read

Explain Flutter's GestureArena and overlapping detector scenario

The arena opens on pointer down; recognizers accept or reject; the last accepted member wins.

advanced2 min read

Custom fade-and-scale transition with PageRouteBuilder and GoRoute

Tests bridging imperative transitions to declarative routers. Use PageRouteBuilder with FadeTransition and ScaleTransition, set globally in theme or per route via GoRoute pageBuilder with CustomTransitionPage. Red flag: omitting child rebuilds the page.

advanced1 min read

Immutable bloc state versus mutable ChangeNotifier

Immutable gives predictable diffs, easy debugging and replayability at the cost of boilerplate; mutable is terse but error-prone.

advanced2 min read

Explain Dio interceptors and automatic token refresh

Define interceptors as hooks; queue concurrent 401s during refresh; retry with Bearer header via token manager.

Implement an API caching layer with offline support and storage trade-offs
advanced2 min read

Implement an API caching layer with offline support and storage trade-offs

Use in-memory for hot data and disk for offline, pick Hive or SQLite by shape, and use TTL with a sync queue.

advanced2 min read

Why are stale search requests problematic and how do you cancel them?

This tests race conditions and resource waste in async UI. Strong answers note stale requests waste bandwidth and overwrite newer results; cancel the previous call with a CancelToken before issuing the next.

advanced2 min read

How do you safely add a non-nullable column in sqflite?

Tests onCreate for fresh installs vs onUpgrade for existing data. Outline: bump version; in onUpgrade use ALTER TABLE ADD COLUMN NOT NULL DEFAULT for existing rows; keep onCreate as latest schema. Red flag: only changing onCreate so old users crash.

advanced2 min read

Implement staggered animations using a single AnimationController and Interval

This tests multiplexing one ticker into sequential animations. Use one AnimationController, map each Tween to an Interval on distinct 0-to-1 sub-ranges, and rebuild with AnimatedBuilder. Red flag: multiple controllers or manual forward chaining.

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles