Filter by the role you are applying for, open a question, and practise explaining the answer out loud. Mark it practised when you can.
Why they ask this: The first concept of every Flutter app; it shows you understand how the UI rebuilds.
Answer
StatelessWidget has no mutable state. Its build() output depends only on its constructor arguments (and inherited data such as the theme). Examples: a label or an icon button.StatefulWidget has a separate State object that lives across rebuilds. Calling setState() marks it dirty so build() runs again. Examples: a form, a counter, a tab view.class Counter extends StatefulWidget {
const Counter({super.key});
@override
State<Counter> createState() => _CounterState();
}
class _CounterState extends State<Counter> {
int count = 0;
@override
Widget build(BuildContext context) {
return TextButton(
onPressed: () => setState(() => count++),
child: Text('Tapped $count times'),
);
}
}Use the lifecycle methods: for setup and to release controllers, streams and timers.
Why they ask this: A practical question that shows real hands-on Flutter experience.
Answer
main(), so all state is lost. It is still faster than a full rebuild.AndroidManifest.xml or Info.plist edits, and some asset changes.Hot reload will not pick up changes to main(), initState() logic that already ran, global or static variable initialisers, or enum and generic type changes. Use hot restart for those.
Why they ask this: There is no single right answer; interviewers want reasoning, not a favourite library.
Answer
Why they ask this: Misusing BuildContext causes common runtime errors, so this tests deeper Flutter knowledge.
Answer
Why they ask this: Networking, databases and real-time features in Flutter depend on async Dart.
Answer
StateinitState()dispose()setState: local state inside one widget. Simple and perfectly fine for small screens.InheritedWidget / ValueNotifier + ValueListenableBuilder: built into Flutter and lightweight.InheritedWidget. Good for simple app-wide state, such as the logged-in user or the theme.BuildContext. Good for async data and testing.How to choose: keep state as local as possible. Pick a shared solution when several screens need the same data. Consider the team's experience, how testable it is, and how much boilerplate you can accept. Be ready to explain one approach in depth with code from a project you built.
A BuildContext is a handle to a widget's location in the widget tree (it is actually the widget's Element). It is used to look up the tree for inherited data and services:
final theme = Theme.of(context);
final size = MediaQuery.sizeOf(context);
Navigator.of(context).push(MaterialPageRoute(builder: (_) => const JobScreen()));
ScaffoldMessenger.of(context).showSnackBar(const SnackBar(content: Text('Saved')));Common pitfalls:
Scaffold.of(context) fails if context belongs to a widget above the Scaffold. Wrap the child in a Builder to get a context below it.await, the widget may have been removed. Check if (!context.mounted) return; before using the context again.Future<T> delivers one value (or an error) later, such as an HTTP response. Use it with async/await or FutureBuilder.Stream<T> delivers many values over time, such as location updates, Firestore snapshots, WebSocket messages or user input. Use it with await for, listen() or StreamBuilder.Future<List<Job>> fetchJobs() async {
final res = await http.get(Uri.parse('https://api.example.com/jobs'));
if (res.statusCode != 200) throw Exception('Failed: ${res.statusCode}');
return (jsonDecode(res.body) as List).map((j) => Job.fromJson(j)).toList();
}
Stream<int> countdown(int from) async* {
for (var i = from; i >= 0; i--) {
await Future.delayed(const Duration(seconds: 1));
yield i;
}
}Always cancel stream subscriptions in dispose() to avoid memory leaks.