Skip to content
tezvyn:

Flutter & Dart

Flutter framework, Dart language, packages, Impeller

138 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.

Interview questions in Flutter & Dart, page 2

intermediate2 min read

Fetch user profiles concurrently and handle individual failures

Tests Future.wait concurrency and per-future error isolation. Answer: map IDs to fetchProfile, pass to Future.wait. For partial failures, attach catchError per future to return null, then filter. Red flag: try-catch around Future.wait or sequential awaits.

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.

easy2 min read

Explain StatelessWidget vs StatefulWidget and when to choose each

This tests immutable UI versus persistent state. StatelessWidget rebuilds when config changes; StatefulWidget owns State surviving rebuilds. Use StatelessWidget for static UI and StatefulWidget for interactive elements.

easy2 min read

What is the build method's purpose and key constraints?

It returns a Widget tree, can run every frame, must avoid side effects, and uses BuildContext for inherited data.

intermediate2 min read

Relationship between Widget, Element, and RenderObject trees and their benefits

Widget configures, Element owns state, RenderObject paints; Element.update reuses the RenderObject, so rebuilds stay cheap.

intermediate2 min read

What is BuildContext? Give two tree-interaction examples.

Tests if you know BuildContext is an Element handle to a widget's tree location. Strong answers cite Theme.of and Scaffold.of as ancestor lookups, explain the own-context trap, and warn against caching across async gaps. Red flag: calling it the widget itself.

intermediate2 min read

How can you prevent unnecessary child rebuilds in Flutter?

Tests your grasp of Flutter build-boundary isolation. Strong answers hit const constructors, extracting the child into its own widget, and granular state selectors. Red flag: saying Keys alone stop rebuilds or recommending RepaintBoundary to skip builds.

intermediate2 min read

Explain lifting state up with a concrete scenario and benefits

Tests moving state to a common ancestor when siblings share data. Outline: pick two siblings, hoist state to the parent, pass values and callbacks down. Red flag: mutating a sibling via GlobalKey or choosing Provider before proving the parent cannot own it.

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.

In a Row, how do you space children evenly across the width?
easy2 min read

In a Row, how do you space children evenly across the width?

Set mainAxisAlignment to spaceEvenly; contrast with spaceBetween and spaceAround.

How do you split a Column 1/3 and 2/3 using Expanded?
easy2 min read

How do you split a Column 1/3 and 2/3 using Expanded?

Tests understanding of flex allocation in Flutter layouts. Strong answers wrap both containers in Expanded, assign flex values of 1 and 2, and note that Expanded forces children to fill the Column's main axis. Red flag: proposing fixed heights instead of flex.

easy2 min read

mainAxisAlignment vs crossAxisAlignment in Column, and textDirection in Row

Tests Flutter flex axis awareness. In a Column, mainAxisAlignment is vertical and crossAxisAlignment is horizontal. In a Row, textDirection governs the main axis, not crossAxisAlignment; verticalDirection governs the cross axis.

intermediate2 min read

How do Flexible and Expanded differ in a Row or Column?

Tests Flutter main-axis flex constraints. Key point: Flexible uses FlexFit.loose so the child may be smaller than its space share; Expanded uses FlexFit.tight so the child must fill its share.

intermediate2 min read

Fix RenderFlex overflow in Row with long truncating text

Wrap Text in Expanded; set overflow to TextOverflow.ellipsis and maxLines: 1; leave siblings unwrapped.

intermediate2 min read

Describe a strategy for ListView on phones and GridView on tablets

This tests Flutter adaptive layout skills. Use LayoutBuilder or MediaQuery to read screen width, pick a breakpoint near 600 dp, and return ListView or GridView conditionally.

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.

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