All interview guides

Flutter Interview Questions and Answers

24 questions that come up in Flutter technical interviews, each with the answer and an explanation of why it is right.

Test yourself — 90 question bank

1. What is Flutter?

Beginner

Answer: An open-source UI toolkit by Google for building natively compiled applications

Flutter is Google's open-source UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

2. What is RenderObject?

Advanced

Answer: Both b and c

RenderObject is the low-level object in Flutter's rendering pipeline. It handles layout calculations, painting, and hit testing. Custom rendering requires extending RenderObject.

3. What is the difference between hot reload and hot restart?

Intermediate

Answer: Hot reload preserves state, hot restart doesn't

Hot reload injects updated code while preserving app state. Hot restart completely restarts the app and loses all state. Use hot restart for major structural changes.

4. What is InheritedWidget?

Intermediate

Answer: Base class for widgets that efficiently propagate data down the tree

InheritedWidget is a base class for widgets that efficiently propagate information down the tree. Used by Provider, Theme, MediaQuery for data sharing.

5. What is the widget tree vs element tree vs render tree?

Advanced

Answer: Both b and c

Flutter has three trees: Widget tree (immutable configuration), Element tree (manages widget lifecycle and state), Render tree (handles layout and painting).

6. What programming language does Flutter use?

Beginner

Answer: Dart

Flutter uses Dart, a client-optimized programming language developed by Google. Dart is optimized for fast apps on any platform.

7. What is Isolate in Dart?

Advanced

Answer: Both b and c

Isolates are independent workers with their own memory heap. They enable true parallelism in Dart. Communicate via message passing. Use for heavy computations.

8. What is Provider in Flutter?

Intermediate

Answer: Both b and c

Provider is a wrapper around InheritedWidget making it easier to use and more reusable. It is the recommended state management solution by the Flutter team.

9. What is a Widget in Flutter?

Beginner

Answer: The basic building block of a Flutter app UI

In Flutter, everything is a widget. Widgets are the basic building blocks of a Flutter app's user interface. They describe what their view should look like.

10. What is compute() function?

Advanced

Answer: Both b and c

compute() function runs a function in a separate isolate and returns the result. It simplifies isolate usage for one-off computations without managing isolate lifecycle.

11. What are the two types of widgets in Flutter?

Beginner

Answer: Stateful and Stateless

Flutter has two main types of widgets: StatelessWidget (immutable, doesn't change) and StatefulWidget (mutable, can change over time based on user interaction or data).

12. What is FutureBuilder?

Intermediate

Answer: Both b and c

FutureBuilder builds a widget based on the latest snapshot of a Future. It automatically rebuilds when the Future completes, making async operations easier to handle.

13. What is StreamBuilder?

Intermediate

Answer: Both b and c

StreamBuilder builds a widget based on snapshots from a Stream. It automatically rebuilds when new data arrives, perfect for real-time updates.

14. What is the const constructor optimization?

Advanced

Answer: Both b and c

const constructors create compile-time constants. Widgets created with const are reused instead of recreated, reducing rebuilds and improving performance.

15. What is RepaintBoundary?

Advanced

Answer: Both b and c

RepaintBoundary creates a separate layer for its subtree. When the subtree repaints, it doesn't affect the parent. Used to optimize frequent repaints.

16. What does setState() do?

Beginner

Answer: Notifies the framework that internal state has changed

setState() notifies the Flutter framework that the internal state of a StatefulWidget has changed, triggering a rebuild of the widget with the updated state.

17. What is the purpose of keys in Flutter?

Intermediate

Answer: Preserve widget state when moving in tree

Keys preserve widget state when widgets move in the tree. They help Flutter identify which widgets have changed, are added, or removed. Types include ValueKey, ObjectKey, UniqueKey.

18. What is the DevTools timeline?

Advanced

Answer: Both b and c

DevTools timeline is a performance profiling tool showing frame rendering times, GPU usage, memory usage, and widget rebuild information for optimization.

19. Which widget is used for scrollable lists?

Beginner

Answer: ListView

ListView is a scrollable list of widgets arranged linearly. It is the most commonly used scrolling widget and automatically provides scrolling when content exceeds viewport.

20. What is GestureDetector?

Intermediate

Answer: Both b and c

GestureDetector detects gestures like tap, double tap, long press, pan, scale, etc. It wraps a widget and provides callbacks for gesture events.

21. What is AnimatedContainer?

Intermediate

Answer: Both b and c

AnimatedContainer automatically animates between property values over a duration. It is an implicit animation widget that makes animations easy without controllers.

22. What is the main entry point of a Flutter app?

Beginner

Answer: main()

The main() function is the entry point of every Flutter app. It calls runApp() which inflates the given widget and attaches it to the screen.

23. What is widget testing vs integration testing?

Advanced

Answer: Both b and c

Widget tests (unit tests) test individual widgets in isolation. Integration tests test complete user flows across multiple screens. Both use testWidgets() API.

24. What is MaterialApp?

Beginner

Answer: A convenience widget that wraps common Material Design widgets

MaterialApp is a convenience widget that wraps a number of widgets commonly required for Material Design applications. It includes Navigator, Theme, and more.

Ready to test yourself?

The full Flutter bank has 90 questions across 3 difficulty levels — timed, shuffled, and scored.

Take the Flutter quiz