Easy interview questions in Flutter & Dart
What is the difference between final and const in Dart?
Tests compile-time versus runtime immutability in Dart. A strong answer: final allows single assignment at runtime, but const requires a compile-time constant and deep immutability.
Explain Dart positional vs named parameters and write one signature
Tests Dart parameter syntax. A strong answer covers required positional args, optional positional args in square brackets, and named args in curly braces with defaults. Red flag: claiming named parameters are always optional or confusing bracket types.
Convert List<User> to Map<String, User> keyed by user id
Tests Dart collection-to-map idioms. A strong answer picks the for-element literal {for (var u in users) u.id: u}, mentions Map.fromIterable as a verbose alternative, and flags duplicate-key overwrites. Red flag: manually looping to populate an empty map.
Difference between final and const Dart class properties?
This tests your grasp of Dart's compile-time versus runtime constant model. A strong answer contrasts final variables set once with static const compile-time values, notes const is implicitly final, gives examples. Red flag: const as non-static instance field.
Deduplicate a List of emails in Dart
Tests knowledge of Dart's Set semantics and LinkedHashSet insertion order. The idiomatic solution is emails.toSet().toList(), which deduplicates in O(n) time while preserving order. Avoid manual loops with contains, which are O(n^2) and unidiomatic.
Define a Dart Future, return Future<String>, and handle errors with both patterns.
Tests Dart async primitives and error handling. A strong answer defines Future as a pending async result, writes a delayed Future<String>, consumes it with then/catchError, and mirrors with async/await try/catch.
Difference between Future<void> and void from an async function
Future<void> lets callers await and catch errors; void hides the Future, preventing await and leaving exceptions uncaught.
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.
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.

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?
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.
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.
Handle taps on a non-button Container: GestureDetector vs InkWell
This tests gesture propagation and Material feedback. Use GestureDetector for raw taps, drags, or scales; InkWell for Material ripples, which needs a Material ancestor. Red flag: InkWell without Material or ignoring GestureDetector drag support.
How do you retrieve and listen to TextField changes in Flutter?
Use TextEditingController, attach to TextField, listen with addListener, read controller.text, dispose in State.dispose.
Explain the validator property in TextFormField and what triggers error display
Tests Form validation lifecycle knowledge. Strong answer: validator returns String? error or null; formKey.currentState.validate() triggers all fields; returned string renders as inline error.
How do you pass data with Navigator.push and return data with Navigator.pop?
Tests imperative navigation and async result patterns. Strong answer: push via MaterialPageRoute with constructor args; await the Future from Navigator.push; pop with Navigator.pop(context, result). Red flag: using global state instead of the Future result.
Navigator.push vs Navigator.pushNamed in Flutter
Tests Flutter navigation patterns and scalability. A strong answer contrasts inline widget construction with centralized route tables, noting pushNamed centralizes routes but complicates type-safe data. Red flag: named routes are always better for large apps.
Explain ephemeral vs app state and when to use setState
This tests state scoping judgment. Ephemeral state is local to one widget, like a page index or checkbox value, and setState fits perfectly. App state is shared, like a user profile or cart, and needs a state management solution.
Provider package versus raw InheritedWidget
It removes boilerplate, adds lifecycle disposal and scoped reads, and exposes select for granular rebuilds.
Make a GET request with http and parse JSON in Dart
Practical Dart async networking with package:http and dart:convert. Import http, await get(Uri.parse(url)), verify statusCode is 200, then jsonDecode(response.body) as List<Map<String, dynamic>>. Skipping status checks or decoding without a cast.
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