0% found this document useful (0 votes)
870 views33 pages

Flutter Interview Handbook

The 'Flutter Developer Interview Handbook' by Anand Gaur is a comprehensive guide designed to help candidates prepare for Flutter interviews across various experience levels. It includes over 500 real interview questions, covering topics such as Dart programming, UI development, state management, and application security, along with practical examples and scenario-based discussions. The handbook aims to provide a structured learning path, ensuring developers can approach their interviews with confidence and clarity.

Uploaded by

Sign In
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
870 views33 pages

Flutter Interview Handbook

The 'Flutter Developer Interview Handbook' by Anand Gaur is a comprehensive guide designed to help candidates prepare for Flutter interviews across various experience levels. It includes over 500 real interview questions, covering topics such as Dart programming, UI development, state management, and application security, along with practical examples and scenario-based discussions. The handbook aims to provide a structured learning path, ensuring developers can approach their interviews with confidence and clarity.

Uploaded by

Sign In
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Flutter Developer

Interview Handbook
Your Ultimate Guide to Crack Flutter Interviews with Confidence

500+ Real Interview


Questions with Clear Explanations

Written By
Anand Gaur
​Table of Contents​
​1.​​Introduction​​……..……..……..……..……..…...……..……..……..………………………..……..​​8​

​​
● ​ hy This Handbook?​
W
​●​ ​How to Use This Handbook Effectively​
​●​ ​Levels of Flutter Interviews (Fresher, Mid-level, Senior, Architect)​
​●​ ​Common Interview Patterns in Product & Service Companies​

r​
​2.​​Flutter Basics​​……..……..……..……..……..…..…….…..……..……………………………………….…..11​

au
​​
● ​ istory of Flutter & Ecosystem​
H
​●​ ​Flutter vs React Native vs Native Development​

G
​●​ ​Flutter Architecture (Framework, Engine, Embedder)​
​●​ ​Flutter App Lifecycle​
​●​ ​Widgets 101: Stateless vs Stateful​

d
​●​ ​Common Widgets & Their Use Cases​


an
​3. Dart Programming Language​​……....……..……..……..……..……..….…..……..……..…….29​

​​ ​ asics of Dart (Variables, Data Types, Functions)​


B
An
​●​ ​Null Safety in Dart​
​●​ ​Futures, async/await, Streams​
​●​ ​Higher Order Functions & Lambdas​
​●​ ​Extensions & Mixins​
by

​●​ ​Generics in Dart​

​4.​​Object-Oriented & Functional Programming in Dart​​……....……..……..……..……...…….65​


ed

​​
● ​ OP Concepts (Encapsulation, Inheritance, Polymorphism)​
O
​●​ ​Abstract Classes vs Interfaces​
​●​ ​Composition​
at

​●​ ​Functional Programming Style in Dart​


re

​5.​​UI Development in Flutter​​……....……..……..……..……………………………………...…….96​

​​
● ​ lutter Rendering Pipeline​
F
​C

​●​ ​Material Design & Cupertino Widgets​


​●​ ​Layout Widgets (Row, Column, Stack, Expanded, Flex)​
​●​ ​Navigation (Navigator 1.0, Navigator 2.0, go_router)​
​●​ ​Lists & Grids (ListView, GridView, Slivers)​
​●​ ​GestureDetector & Input Handling​
​●​ ​Responsive & Adaptive UI​
​●​ ​Accessibility in Flutter​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​4​


​6.​​State Management​​……....……..……..……………………………………………....…..…….141​

​​
● ​ etState & InheritedWidget​
s
​●​ ​Provider​
​●​ ​Riverpod​
​●​ ​BLoC / Cubit​
​●​ ​Redux in Flutter​
​●​ ​GetX & MobX​
​●​ ​Choosing the Right State Management Approach​

r​
​7.​​Data Persistence & Storage​​……....……..……..…………………………………...……..….195​

au
​​
● ​ haredPreferences​
S
​●​ ​SQLite in Flutter (sqflite package)​

G
​●​ ​Drift (Moor ORM)​
​●​ ​Hive Database​
​●​ ​ObjectBox & Isar DB​

d
​●​ ​File System Storage​

an
​●​ ​Secure Storage​

​8.​​Networking in Flutter​​……....……..……..……..……………………………………...……...…221​
An
​​
● ​ TTP Package Basics​
H
​●​ ​REST API Integration​
​●​ ​JSON Parsing (manual vs code generation)​
​●​ ​Dio for Networking​
by

​●​ ​WebSockets in Flutter​


​●​ ​GraphQL in Flutter​
​●​ ​Offline Data & Caching​
ed

​●​ ​Error Handling in API Calls​

​9.​​Asynchronous Programming & Concurrency​​……....……..……………..…….……..……243​


at

​​
● ​ utures & async/await​
F
​●​ ​Streams & StreamControllers​
re

​●​ ​Isolates in Flutter​


​●​ ​Compute Function​
​●​ ​Concurrency Best Practices​
​C

​10.​​Architecture & Design Patterns​​……....……..……..……..……………………………..….273​

​​
● ​ VC, MVVM in Flutter​
M
​●​ ​BLoC Architecture​
​●​ ​Clean Architecture in Flutter​
​●​ ​Dependency Injection (get_it, injectable, Riverpod DI)​
​●​ ​Common Design Patterns (Singleton, Factory, Observer, Repository)​
​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​5​


​●​ ​SOLID Principles in Flutter Apps​

​11.​​Package & Dependency Management​​……....……..……..……………………………..….308​

​​
● ​ ubspec.yaml Deep Dive​
p
​●​ ​Popular & Must-Know Packages from pub.dev​
​●​ ​Semantic Versioning & Dependency Resolution​
​●​ ​Private/Internal Packages​
​●​ ​Modularization for Large Flutter Projects​

r​
​12.​​Performance Optimization & Memory Management​​……....……..……..…….....……….321​

au
​​
● ​ lutter Performance Profiling Tools (DevTools)​
F
​●​ ​Avoiding Unnecessary Rebuilds (const Widgets, Keys)​

G
​●​ ​RepaintBoundary & Skia Rendering​
​●​ ​Optimizing ListViews & Grids​
​●​ ​Memory Leaks & Garbage Collection​

d
​●​ ​Jank-Free Animations & 60fps Smoothness​

● ​ nit Testing in Dart​


U
an
​13.​​Testing in Flutter​​……....……..……..……..……………………………………………...…….342​

​​
An
​●​ ​Widget Testing​
​●​ ​Integration Testing​
​●​ ​Mocking in Flutter (Mockito, mocktail)​
​●​ ​Golden/Snapshot Testing​
by

​14.​​Advanced Flutter Topics​​……....……..……..……..…………………………………….…….359​

​​
● ​ lutter Web & Desktop Basics​
F
ed

​●​ ​Platform Channels & Native Code Integration​


​●​ ​FFI (Foreign Function Interface)​
​●​ ​Push Notifications (Firebase Messaging)​
at

​●​ ​Deep Linking & Dynamic Links​


​●​ ​Background Services in Flutter​
re

​●​ ​Flutter Plugin Development​

​15.​​Application Security in Flutter Apps​​……....……..……..……..……….………………..….372​


​C

​​
● ​ ecure Coding Practices in Dart​
S
​●​ ​SSL Pinning & Certificate Validation​
​●​ ​Secure Storage for Sensitive Data​
​●​ ​Data Encryption & Decryption​
​●​ ​Reverse Engineering & Obfuscation in Flutter​
​●​ ​OWASP Mobile Security Guidelines​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​6​


​16.​​Flutter Ecosystem Knowledge​​……....……..……..……..……………………………..…….387​

​​
● ​ oogle Play Store Submission Process​
G
​●​ ​App Signing & Certificates​
​●​ ​iOS App Store Submission Basics for Flutter Devs​
​●​ ​Flutter Release Channels (Stable, Beta, Dev, Master)​
​●​ ​Handling Flutter Upgrade & Breaking Changes​

​17.​​DevOps for Flutter​​…………………....……..……..……..……..……………...………………393​

r​
​​
● I​ntroduction to Mobile DevOps​

au
​●​ ​CI/CD Pipelines for Flutter (GitHub Actions, GitLab, Bitrise, Codemagic)​
​●​ ​Automated Builds & Testing​
​●​ ​Fastlane with Flutter​

G
​●​ ​Firebase App Distribution / TestFlight Distribution​
​●​ ​Crash Reporting & Monitoring (Firebase Crashlytics, Sentry)​

d
​18.​​Scenario-Based Interview Questions​​……....……..……..……..………...…………..…….412​

​​

​●​
​●​
H
an
​ ow do you handle offline mode in a Flutter app?​
​How to optimize long lists with images?​
​How to debug performance issues in production?​
An
​●​ ​How to handle multiple API calls in parallel?​
​●​ ​How to structure a large-scale Flutter project?​
​●​ ​How to integrate the Flutter module into an existing native app?​
​●​ ​Many more​
by
ed
at
re
​C

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​7​


​1. Introduction​

​Why This Handbook?​


​ reparing for​​Flutter interviews​​can feel overwhelming​​because the questions vary a lot​
P
​depending on the company and the role. One round might test your Dart language​
​fundamentals, another might focus on Flutter UI or State Management, and at senior levels​

r​
​you’ll often be asked to discuss app architecture, scalability, and system design for large-scale​
​applications.​

au
​ hat’s exactly why this handbook was created — to be your​​one-stop guide for Flutter​
T
​interview prep​​. It brings together all the key concepts,​​common questions, and scenario-based​

G
​discussions in a structured way, so you don’t waste hours searching through scattered​
​resources.​

d
​ s a developer, I know this struggle firsthand. Preparing for Flutter interviews often means​
A

an
​juggling between Dart documentation, Flutter.dev guides, random blog posts, and YouTube​
​tutorials. There was no single place that covered​​real, repeatedly asked interview questions​
​with​​clear explanations and practical examples​​. That’s​​when I decided to create this​
An
​handbook — a structured and reliable guide that helps every Flutter developer prepare smarter​
​and faster.​

​ his handbook has been compiled by collecting​​real​​interview questions from the past​
T
​several years​​, shared by developers who have gone​​through interview processes across​
by

​product companies, startups, and service-based organizations. Over time, I documented every​
​challenging question I encountered, not only to improve myself but also to share with others so​
​they can benefit too.​
ed

​Here’s what you’ll find inside:​

​●​ T
​ opic-wise categorized questions​​so you can prepare​​step by step (Dart, Widgets,​
at

​State Management, Architecture, System Design, etc.)​


re

​●​ C
​ overage for all experience levels​​— from freshers​​who are just starting out to senior​
​developers and architects aiming for leadership roles​
​C

​●​ P
​ ractical examples and scenario-based discussions​​that reflect real-world interview​
​patterns in Flutter​

​●​ L
​ atest Flutter ecosystem topics​​like Riverpod, BLoC,​​Clean Architecture, DevOps​
​pipelines, and performance optimization​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​8​


​ o matter how much experience you have, this handbook will give you a​​clear roadmap of​
N
​what to expect​​and how to prepare, helping you approach​​your interviews with confidence.​

​How to Use This Handbook Effectively​


​Think of this handbook as a​​step-by-step preparation​​path​​:​

​ . Begin with the fundamentals​​– If you’re a fresher,​​start with Dart basics, Flutter​
1
​architecture, and the Flutter app lifecycle. Build a strong foundation before moving into complex​

r​
​topics.​

au
​ . Progress gradually​​– Move into UI development (widgets,​​layouts, navigation), then cover​
2
​state management approaches (setState, Provider, Riverpod, BLoC), followed by data​

G
​persistence, networking, and async programming.​

​ . Focus on real-world problems​​– Don’t just read​​theory. Practice scenario-based questions​


3

d
​like​​“How would you implement offline caching in a​​Flutter app?”​​or​​“How do you optimize a long​
​list with images?”​​since interviews increasingly emphasize​​practical problem-solving​​.​

4
an
​ . Advance to higher-level concepts​​– For mid-level​​to senior developers, dive into​
​architecture (MVVM, BLoC, Clean Architecture), dependency injection, performance​
An
​optimization, and handling large-scale apps.​

​ . Don’t ignore DevOps and Security​​– Continuous integration,​​automated builds, app​


5
​distribution (Play Store, TestFlight), SSL pinning, secure storage, and obfuscation are becoming​
​standard expectations​​, even in interviews.​
by

​ . Revise smartly​​– Use the scenario-based and system​​design sections as your​​final revision​
6
​before the interview to sharpen problem-solving skills.​
ed

​ y following this order, you’ll avoid the common trap of studying random topics without direction​
B
​and instead build a​​structured learning path​​from​​basics to advanced.​
at

​Levels of Flutter Interviews​


re

​●​ F
​ resher / Junior (0–2 years)​
​Expect questions on Dart basics, widget tree concepts, Stateful vs Stateless widgets,​
​C

​navigation, basic REST API calls, and handling lists/grids.​

​●​ M
​ id-level (2–5 years)​
​Focus shifts to architectural patterns (BLoC, Provider, Riverpod), local storage (SQflite,​
​Hive), state management in depth, handling async tasks with Futures/Streams, error​
​handling, and app performance basics.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​9​


​●​ S
​ enior (5+ years)​
​You’ll be evaluated on how you design scalable apps, apply clean architecture, use​
​dependency injection, manage complex state, optimize rendering performance, and​
​mentor teams. Expect tough discussions around package selection, testing strategies,​
​and scalability trade-offs.​

​●​ A
​ rchitect / Lead​
​Interviews go beyond code. You’ll be asked to design enterprise-level solutions, build​

r​
​modular architectures, integrate CI/CD pipelines, ensure security best practices, and​
​make decisions around scalability and productivity. Soft skills—like leadership,​

au
​communication, and decision-making—become as important as technical depth.​

​Common Interview Patterns in Product & Service Companies​

G
​Product Companies (FAANG, unicorn startups, product-focused firms)​

d
​●​ A ​ lgorithms and Data Structures​​– usually easy to medium​​level, but expected in at​

an
​least one round.​
​●​ ​Deep technical rounds on Dart & Flutter​​– widget lifecycle,​​state management​
​(Provider, Riverpod, BLoC, GetX), async programming (Futures, Streams, async/await).​
An
​●​ ​System design and scalability​​– clean architecture,​​modularization, handling​
​large-scale apps with multiple teams.​
​●​ ​Performance optimization​​– reducing widget rebuilds,​​avoiding jank, memory​
​optimization, smooth animations, efficient API handling.​
​●​ ​Behavioral and culture fit interviews​​– teamwork,​​ownership, problem-solving,​
by

​handling ambiguity.​

​Service Companies (Infosys, TCS, Accenture, Wipro, etc.)​


ed

​●​ S ​ trong focus on​​practical implementation-based questions​​– UI design, API​


​integration, navigation, forms, error handling.​
at

​●​ ​Framework and ecosystem knowledge​​– Flutter basics,​​commonly used plugins (http,​
​dio, shared_preferences, hive, firebase, sqflite).​
​●​ ​Scenario-based questions​​– offline caching, local​​database, state management​
re

​choices, handling failures.​


​●​ ​Usually​​fewer rounds with faster decision-making​​compared​​to product companies.​
​C

​●​ ​May include​​basic Android/iOS platform integration​​using MethodChannels or​


​platform-specific APIs.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​10​


​2. Flutter Basics​

​Q1: When was Flutter first announced and by whom?​


​●​ ​Flutter was first announced by​​Google​​at the​​Google​​I/O conference in May 2017​​.​

​●​ ​The first​​stable release (Flutter 1.0)​​came in​​December​​2018​​.​

r​
​●​ G
​ oogle created Flutter to solve the problem of writing separate apps for Android and​

au
​iOS.​

​Q2: What is Flutter and why is it popular?​

G
​●​ ​Flutter​​is an​​open-source UI toolkit​​from Google.​

d
​●​ I​t allows developers to create​​cross-platform apps​​(Android, iOS, Web, Desktop) with a​
​single codebase​​.​

​Why is it popular?​ an
An
​1.​ ​Fast development​​with hot reload.​

​2.​ ​Beautiful UI​​– built-in Material & Cupertino widgets.​


by

​3.​ ​Single codebase​​saves time & cost.​

​4.​ ​High performance​​– runs using its own rendering engine.​


ed

​ 3: How is Flutter different from React Native and Native​


Q
​Development?​
at

​Flutter vs React Native​


re

​ .​ F
1 ​ lutter uses​​Dart​​, React Native uses​​JavaScript​​.​
​2.​ ​Flutter has its own rendering engine (Skia), React Native uses native components.​
​C

​3.​ ​Flutter provides a consistent UI across platforms, React Native depends on OS widgets.​

​Flutter vs Native Development​

​ .​ N
1 ​ ative uses​​Java/Kotlin (Android)​​or​​Swift/Objective-C​​(iOS)​​.​
​2.​ ​Native apps give best performance but require​​two​​separate codebases​​.​
​3.​ ​Flutter balances between speed of development (single codebase) and good​
​performance.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​11​


​Q4: Explain Flutter’s Architecture.​
​Flutter has​​three main layers​​:​

​Framework (Dart SDK + Widgets)​

​●​ ​Where developers write app code.​

​●​ ​Contains Material, Cupertino, and widget libraries.​

r​
au
​Engine (C++ based)​

​●​ ​Uses​​Skia Graphics Engine​​to render UI.​

G
​●​ ​Handles animations, text, and graphics at 60/120 FPS.​

​Embedder​

d
​●​ ​Platform-specific layer (Android/iOS/Web/Desktop).​

an
​●​ ​Makes Flutter run inside a native app shell.​
An
​Q5: How does the Flutter app lifecycle work?​
​ lutter apps mainly follow​​Android/iOS lifecycle states​​,​​exposed through​
F
WidgetsBindingObserver​
​ ​.​
by

​The important states are:​

resumed​

ed

​●​ ​App is visible on screen and user can interact.​


at

​●​ ​Example: scrolling, typing, clicking.​


re

inactive​

​●​ ​App is still in foreground but not receiving input.​


​C

​●​ ​Example: phone call overlay, control center pulled down.​

paused​

​●​ ​App is running in background (not visible).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​12​


​●​ ​Example: user pressed home button.​

​●​ ​Still in memory but UI not visible.​

detached​

​●​ ​App is terminated or still loaded but not attached to any host view.​

​●​ ​Example: system kills the app to free resources.​

r​
au
​Why Lifecycle is Important?​

​●​ ​Save/Restore data​​→ Save form data when app goes background.​

G
​●​ ​Pause heavy tasks​​→ Stop video/audio when paused.​

d
​●​ ​Manage resources​​→ Release camera/microphone when​​app is inactive.​

an
​●​ ​Analytics​​→ Track when users enter/exit the app.​

​Flutter vs Native Lifecycle​


An
​●​ ​In​​Android​​: Activity lifecycle (​​
onCreate​ onPause​
​,​​ onResume​
​,​​ ​).​

​●​ ​In​​iOS​​: UIApplication lifecycle (​​


applicationDidEnterBackground​
​).​
by

​●​ I​n​​Flutter​​: Unified states (​​


resumed​ inactive​
​,​​ paused​
​,​​ detached​
​,​​ ​) so you don’t worry​
​about platform differences.​
ed

​Q6: What are Widgets in Flutter?​


at

​●​ ​In Flutter,​​everything is a widget​​– UI, layout, even​​app structure.​

​●​ ​A widget describes​​what the UI should look like​​.​


re

​●​ ​Flutter rebuilds widgets when state/data changes.​


​C

​Q7: Difference between Stateless and Stateful Widgets.​


​Stateless Widget​

​ .​ U
1 ​ I that does not change once built.​
​2.​ ​Lightweight, faster to render because nothing changes.​
​3.​ ​No internal state, only external data (immutable).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​13​


​3. Dart Programming Language​
​Q1: What are the different ways to declare variables in Dart?​

var​
​1. Using​​

​●​ ​Dart will​​infer the type​​based on the value assigned.​

r​
​●​ ​Variables are​​mutable​​(you can change the value later,​​but not the type).​

au
​ar​​
v name =​​
"Anand"​
;​​
​ // String inferred​

G
name =​​
​ "Gaur"​
;​​
​ // allowed​
// name = 25; //
​ ❌
not allowed (type is already String)​

d
dynamic​
​2. Using​​

an
​●​ ​Type is determined​​at runtime​​, can hold​​any type​​.​
An
​●​ ​Flexible, but less safe (avoid unless necessary).​

​ynamic​​
d data =​​
"Hello"​
;​

data =​​
​ 123​
;​ ​
​ // allowed​ ✅

by

data =​​
​ true​
;​ ​
​ // allowed​

​3. Using explicit types​


ed

​●​ ​You can directly declare the type.​

​●​ ​Safer and more readable.​


at

​tring city =​​


S "Delhi"​
;​

re

int age =​​


​ 30​
;​

double price =​​
​ 99.99​
;​

​C

bool isActive =​​


​ true​
;​

final​
​4. Using​​

​●​ ​Value can be set​​only once​​.​

​●​ ​It’s​​runtime constant​​(decided when the program runs).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​29​


​inal​​
f today = DateTime.now();​​
// allowed​ ✅
// today = DateTime.now(); //
​ not allowed​ ❌
const​
​5. Using​​

​●​ ​Value is​​compile-time constant​​(must be known before​​running).​

final​
​●​ ​More restrictive than​​ ​.​

r​

au
​onst​​
c pi =​​
3.14159​
;​​
​ // compile-time constant​
// const time = DateTime.now(); //
​ not allowed​ ❌

G
late​
​6. Using​​

​●​ ​Declares a variable that will be initialized​​later​​,​​but not immediately.​

d
an
​●​ ​Useful for non-nullable variables you can’t initialize at declaration.​

​ate String description;​


l

An
description =​​
​ "Flutter is awesome"​
;​​
​ // assigned​​
later​

​Q2: Explain the concept of type inference in Dart.​


by

​ ype inference means​​Dart can figure out the type​​of a variable automatically​​based on the​
T
​value you assign to it, so you don’t always need to explicitly write the type.​
ed

​For example:​
​ar​​
v name =​​
"Anand"​
;​
​ ​/ Dart infers this as String​
/
at

var​​
​ age =​​
30​
;​
​ // Dart infers this as int​

var​​
​ price =​​
99.99​
;​
​ // Dart infers this as double​

re

​ ere, even though we used​​


H var​​, Dart assigns​​String​​,​​int​​, and​​double​​behind the scenes.​
​Once inferred, the type​​cannot change​​:​
​C

​ar​​
v city =​​
"Delhi"​
;​

// city = 123;
​ // ❌ Error: city is String, can't assign int​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​30​


​How does Dart infer types?​

​1. From the initializer value​

var​​
​ isActive =​​
true​
;​ ​
​ // inferred as bool​

​2. From the function return type​

r​
var​​
​ greeting = getGreeting();​​
// type inferred from​​
return type of getGreeting()​

au
​3. From generic context​

G
var​​
​ numbers = <int>[​
1​
​,​​
2​
,​​
3​
];​ ​
// inferred as List<int>​

​When NOT to use inference​

d
an
​●​ ​If code readability suffers (e.g., complex return types).​

​●​ ​When you want clarity or strictness, use​​explicit​​types​​.​


An
List<String> names = [​
​ "Anand"​
​ ,​​
​ "Gaur"​
];​ ​
​ // clearer​​
than just var​

dynamic​
​Difference from​​
by

​●​ ​Type inference (​​


var​
​)​​→ Dart decides the type​​once​​and locks it.​

​●​ ​
dynamic​​→ Dart allows the variable to change type​​anytime (less safe).​
ed

​ar​​
v message =​​
"Hello"​
;​


at

// message = 10; //
​ Error​

​ynamic​​
d anything =​​
"Hello"​
;​


re

anything =​​
​ 10​
;​ ​
​ // Allowed​
​C

​Q3: What are the built-in data types available in Dart?​


​ art is a​​strongly typed language​​, meaning every variable​​has a type.​
D
​It comes with a set of​​core (built-in) data types​​that are used all the time in Flutter and Dart​
​development.​

​1. Numbers​
​●​ ​int​​→ Whole numbers (positive or negative, no decimals).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​31​


​5. UI Development in Flutter​

​ 1: What are the three main phases of Flutter's rendering​


Q
​pipeline?​
​Flutter renders the UI in​​three key phases​​:​

r​
​1. Widget Phase​​(Describing the UI)​

au
​●​ ​Flutter apps are built from​​widgets​​.​

G
​●​ I​n this phase, Flutter builds a​​widget tree​​, which​​is just a configuration describing what​
​the UI should look like.​

d
​●​ ​Widgets themselves are​​immutable​​(they don’t change​​once created).​

an
​●​ ​If something changes (like a counter value), Flutter rebuilds parts of the widget tree.​

​2. Element Phase​​(Managing the lifecycle & links)​


An
​●​ ​Widgets are immutable, so Flutter needs something mutable to handle changes.​

​●​ ​That’s where​​Elements​​come in.​


by

​●​ ​Elements:​
​○​ ​Act as a​​bridge​​between widgets and the underlying​​render objects.​
StatefulWidget​
​○​ ​Store widget state (for​​ ​s).​
ed

​○​ ​Form the​​element tree​​, which mirrors the widget tree​​but stays alive across​
​rebuilds.​
at

​●​ W
​ hen a widget rebuilds, Flutter tries to​​reuse existing​​elements​​instead of destroying​
​and recreating everything.​
re

👉
​ Think of Elements as the​​managers​​that keep things​​consistent between widgets and the​
​rendered UI.​
​C

​3. Render Object Phase​​(Painting on the screen)​

​●​ ​At the lowest level, Flutter uses​​RenderObjects​​.​

​●​ ​They:​
​○​ H ​ andle​​layout​​(decide size and position).​
​○​ ​Handle​​painting​​(draw pixels on the screen).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​95​


​○​ ​Form the​​render tree​​, which is directly used by the rendering engine (Skia).​

RenderParagraph​​is responsible for​​actually drawing text on screen.​


​●​ ​For example, a​​

​ 2: What is the difference between widgets, elements, and​


Q
​render objects?​

​1. Widgets –​​The Blueprint​

r​
au
​●​ ​Widgets are​​immutable configurations​​that describe​​how the UI should look.​

​●​ ​Role:​
​○​ T ​ hey don’t actually “do” anything themselves.​

G
​○​ ​Think of them as​​instructions​​(like a blueprint of​​a house).​

d
​●​ ​Examples:​
​○​ ​
Text("Hello")​
​○​ ​
Column(children: [...])​
​○​ ​
Scaffold()​
an
An
​2. Elements –​​The Middle Manager​

​●​ ​Elements are​​mutable objects​​that live in the​​element​​tree​​.​


by

​●​ ​Role:​
​○​ T ​ hey link the​​Widget tree​​to the​​Render tree​​.​
​○​ ​They manage widget lifecycles (​​ mount​ update​
​,​​ unmount​
​,​​ ​).​
ed

​○​ ​They ensure widgets don’t always rebuild from scratch — instead, elements​
​decide if they can​​reuse​​render objects.​
at

​●​ ​Types:​
​○​ ​
StatelessElement​​→ for​​
StatelessWidget​
re

​○​ ​
StatefulElement​​→ for​​
StatefulWidget​

​3. Render Objects –​​The Worker​


​C

​●​ ​Render objects are responsible for the​​actual layout​​and painting​​on the screen.​

​●​ ​Role:​
​○​ M ​ easure size and position (layout).​
​○​ ​Draw pixels on the screen (paint).​
​○​ ​Handle hit testing (for gestures/taps).​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​96​


​●​ ​Examples:​
​○​ ​
RenderParagraph​​→ draws text​
​○​ ​
RenderFlex​​→ handles​​
Row​
​/​​
Column​​layout​
​○​ ​
RenderBox​​→ basic box rendering​

​Q3: What occurs during the paint phase of rendering?​


​ lutter’s rendering pipeline has several steps:​​layout​​→ painting → compositing →​
F

r​
​rasterization​​.​

au
​So, what happens in the paint phase?​

​●​ ​After layout, every​​RenderObject​​knows​​its size and​​position​​.​

G
​●​ I​n the​​paint phase​​, Flutter asks each render object​​to​​describe how it should be​
​drawn on the canvas​​.​

d
an
​Key points:​

​1. Draw commands are recorded​


An
​●​ I​nstead of immediately drawing pixels, Flutter records paint commands (like drawRect,​
​drawImage, drawText) into​​layers​​.​

Canvas.drawRect(...)​​or​​
​●​ ​Example:​​ Canvas.drawCircle(...)​
​.​
by

​2. Painting is hierarchical​

​●​ ​The rendering system traverses the​​render tree​​from​​parent to child.​


ed

​●​ ​Each widget paints itself​​relative to its own coordinate​​system​​.​


at

​3. Use of Layers​


re

​●​ C
​ omplex effects (opacity, clips, transforms, shaders) create​​separate layers​​in the​
​scene.​
​C

​●​ L
​ ayers help with​​efficient redrawing​​, so Flutter doesn’t​​need to repaint the whole​
​screen if only part of it changes.​

​4. No actual pixels yet​

​●​ ​The paint phase only prepares a​​display list​​.​

​●​ ​The final conversion to pixels (GPU rasterization) happens later.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​97​


​6. State Management​
​ 1: What is state in Flutter and why is state management​
Q
​important?​
​●​ ​State​​means the​​data or information​​that can​​change​​during the lifetime of a widget​​.​

r​
​●​ ​Example:​
​○​ ​A counter value that increases when you press a button.​

au
​○​ ​A checkbox that toggles between checked and unchecked.​
​○​ ​A text field where the user types input.​

👉 If something in the UI can​​change dynamically​​,​​it is controlled by​​state​​.​

G

​Types of State in Flutter​

d
​1. Ephemeral (local) state​

an
​●​ ​Small, temporary state that only affects a​​single​​widget​​.​
An
TextField​​input,​​
​●​ ​Example:​​ PageView​​index.​

​●​ ​Managed using​​StatefulWidget + setState()​​.​


by

​2. App-wide (shared) state​

​●​ ​Data that must be​​shared across multiple widgets or​​screens​​.​


ed

​●​ ​Example: user login info, theme mode, shopping cart data.​

​●​ ​Managed using​​state management solutions​​like Provider,​​Riverpod, Bloc, Redux, etc.​


at

​Why is State Management Important?​


re

​●​ ​In Flutter, the​​UI is rebuilt when state changes​​.​


​C

​●​ ​If state is not managed properly:​

​○​ ​The app becomes​​hard to debug​​.​

​○​ ​UI may not update correctly.​

​○​ ​Code gets messy and unscalable.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​140​


👉
​ ​​State management ensures​​:​

​1.​ ​Data consistency​​– the same data is reflected correctly​​across the app.​

​2.​ ​Separation of concerns​​– business logic (how state​​changes) is kept separate from UI.​

​3.​ ​Reusability and scalability​​– easy to manage state​​in large apps.​

​4.​ ​Performance optimization​​– only necessary widgets​​rebuild when state changes.​

r​
au
​ 2: How does the setState() method work and when should you​
Q
​use it?​

G
setState()​​Works​
​How​​

​●​ I​n Flutter, the UI is built using widgets. Many widgets are​​stateless​​, meaning they don’t​

d
​change once built.​

​●​ B
an
​ ut sometimes, you need widgets that​​change over time​​(like a counter, a toggle​
​button, or fetched data). That’s where​​stateful widgets​​come in.​
An
StatefulWidget​
​Inside a​​ ​, you manage state in its associated​​State class​​.​
setState()​
​When something changes (say, a variable’s value), you call​​ ​.​

👉 What happens:​
by

setState()​​callback.​
​1.​ ​You update your variable(s) inside the​​
ed

​2.​ ​Flutter marks that part of the widget tree as​​dirty​​(needing rebuild).​

​3.​ F build()​​method of that widget​​to reflect the updated values on the​


​ lutter re-runs the​​
at

​screen.​
re

setState()​
​When Should You Use​​

setState()​​for​​simple, local state management​​,​​such as:​


​Use​​
​C

​●​ ​Updating a counter​

​●​ ​Showing/hiding a widget​

​●​ ​Changing colors, text, or icons locally​

​●​ ​Small UI updates inside a single widget​


​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​141​


​8. Networking in Flutter​

​ 1: What is the HTTP package in Flutter and how do you add it to​
Q
​your project?​
​ he​​http​​package in Flutter is the most commonly used​​package for making HTTP requests​
T

r​
​(like GET, POST, PUT, DELETE) to REST APIs or web servers. It helps you fetch data from the​
​internet, send JSON to servers, and work with APIs without having to manually manage sockets​

au
​or lower-level networking code.​

​Key Features​

G
​●​ ​Supports all major HTTP methods (​​
GET​ POST​
​,​​ PUT​
​,​​ DELETE​
​,​​ PATCH​
​,​​ ​).​

d
​●​ ​Easy handling of​​headers​​,​​query parameters​​, and​​request​​bodies​​.​

an
dart:convert​
​●​ ​Built-in​​JSON encoding/decoding​​with​​ ​.​
An
async/await​
​●​ ​Works asynchronously using​​Futures​​and​​ ​.​

​How to Add the HTTP Package​


by

pubspec.yaml​​file.​
​1. Open your Flutter project’s​​

dependencies​
​2. Under​​ ​, add:​
ed

dependencies:​

flutter:​

sdk: flutter​

at

http: ^​
​ 1.2.1​ ​
​ # (check pub.dev​​
for​​
the latest version)​
re

​3. Run the command in terminal:​


flutter pub​​
​ get​
​C

​4. Import it in your Dart file:​

import​​
​ 'package:http/http.dart'​​
as​​
http;​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​219​


​ 2: What is the difference between http.get() and http.post()​
Q
​methods?​

​http.get()​

​●​ ​Used to​​retrieve data​​from a server.​

​●​ ​Doesn’t send a request body — only URL and optional headers.​

r​
au
​●​ ​Commonly used for​​reading data​​(e.g., fetching JSON,​​images, text).​

​Example:​

G
final​​
​ response =​​
await​​
http.​
get​
​ (​

Uri.parse(​
​ 'https://jsonplaceholder.typicode.com/posts/1'​
​ ),​

d
headers: {​
​ "Accept"​
​ :​​
​ "application/json"​
},​

);​

print(response.body);​

an
An
​http.post()​

​●​ ​Used to​​send data​​to a server (like creating a new​​record).​


by

​●​ ​Can include​​request body​​(e.g., JSON, form data).​

​●​ ​Commonly used for​​submitting forms, login, registration,​​uploading data​​.​


ed

​Example:​

final​​
​ response =​​
await​​
http.post(​
at

Uri.parse(​
​ 'https://jsonplaceholder.typicode.com/posts'​
​ ),​

headers: {​
​ "Content-Type"​
​ :​​
​ "application/json"​
},​

re

body: jsonEncode({​

"title"​
​ :​​
​ "foo"​
,​

"body"​
​ :​​
​ "bar"​
,​

​C

"userId"​
​ :​​
​ 1​
,​
}),​

);​

print(response.body);​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​220​


​10. Architecture & Design Patterns​

​ 1: What is the MVC (Model-View-Controller) pattern and how​


Q
​does it apply to Flutter?​
​●​ ​MVC​​stands for​​Model – View – Controller​​, a classic​​software design pattern.​

r​
​●​ T
​ he main idea is to​​separate responsibilities​​so that​​code is cleaner, easier to test, and​

au
​easier to maintain.​

​Components of MVC:​

G
​Model​

d
​●​ ​Represents the​​data​​and​​business logic​​of the app.​

​●​ ​Knows nothing about UI.​

an
​●​ ​Example: User model, data from API, database layer.​
An
​View​

​●​ ​The​​UI​​part (what the user sees).​


by

​●​ ​Displays data from the model.​

Scaffold​
​●​ ​Example: Flutter widgets like​​ Text​
​,​​ ListView​
​,​​ ​.​
ed

​Controller​
at

​●​ ​The​​middleman​​between View and Model.​

​●​ ​Handles user input and updates the model or view accordingly.​
re

​●​ ​Example: Responding to button clicks, calling API services, updating state.​
​C

​How it Applies to Flutter​

​Flutter doesn’t​​force​​MVC, but you can structure apps​​in MVC style:​

User​
​●​ ​Model:​​Dart classes for data (like​​ Product​
​,​​ Post​
​,​​ ​), or API/database logic.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​270​


​●​ ​View:​​Flutter widget tree (​​
MaterialApp​ Scaffold​
​,​​ Text​
​,​​ ListView​
​,​​ ​).​

​●​ C
​ ontroller:​​A class (or sometimes the​​State​​of a StatefulWidget)​​that contains logic for​
​fetching data, validating input, and updating state.​

​Advantages of MVC​

​●​ ​Clear separation of concerns.​

r​
​●​ ​Easier to test (business logic separate from UI).​

au
​●​ ​Makes large apps more maintainable.​

G
​Limitations in Flutter​

​●​ ​Flutter encourages​​reactive UI​​(UI rebuilds automatically​​when state changes).​

d
an
​●​ M
​ VC is sometimes considered​​less natural​​in Flutter​​compared to​​MVVM​
​(Model-View-ViewModel) or using​​state management solutions​​(Provider, Riverpod,​
​Bloc, etc.).​
An
​●​ ​In small apps, MVC might feel like extra boilerplate.​

​ 2: What is MVVM (Model-View-ViewModel) and how does it​


Q
by

​differ from MVC?​


​●​ ​MVVM​​=​​Model – View – ViewModel​
ed

​●​ I​t’s a design pattern that evolved from MVC to better suit​​UI-driven applications​​(like​
​Flutter, Android, iOS, WPF).​
at

​●​ ​The key idea:​​UI (View) reacts automatically to changes​​in data (ViewModel)​​.​
re

​Components of MVVM​

​Model​
​C

​●​ ​Same as MVC → Handles data and business logic.​

​●​ ​Example: API services, database, User model class.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​271​


​View​

​●​ ​The​​UI layer​​→ Flutter widgets.​

​●​ ​Displays data but contains​​no business logic​​.​

Scaffold​
​●​ ​Example:​​ ListView​
​,​​ Text​
​,​​ ​.​

​ViewModel​

r​
​●​ ​The​​bridge​​between Model and View.​

au
​●​ ​Holds app​​state​​and​​business logic​​.​

G
​●​ E
​ xposes data as​​streams, observables, or state objects​​so that View can​
​automatically react.​

d
ChangeNotifier​
​●​ ​Example in Flutter:​​ Provider​
​,​​ Riverpod​
​,​​ Bloc​
​,​​ ​.​

​How MVVM Works in Flutter​


an
An
​●​ ​The​​View​​listens to the​​ViewModel​​.​

​●​ ​When the​​Model updates​​, the​​ViewModel notifies​​the​​View.​


by

​●​ ​The UI rebuilds automatically (reactive approach).​

​Key Difference Between MVC and MVVM:​


ed

​Aspect​ ​MVC​ ​MVVM​

​Middle layer​ ​Controller​​→ Directly updates UI​ ​ViewModel​​→ Exposes state, View​
at

​listens​
re

​UI updates​ ​Controller calls methods like​ ​View automatically rebuilds when​
setState​
​ ​ViewModel notifies​
​C

​Data binding​ ​Manual (Controller → View)​ ​Reactive (View observes ViewModel)​

​example​ StatefulWidget​​with​
​Using​​ Provider​
​Using​​ Riverpod​
​,​​ Bloc​
​,​​ ​,​
​setState​ MobX​

​Best for​ ​Smaller/simple apps​ ​Larger apps needing scalability &​


​testability​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​272​


​Real-life Analogy:​

​MVC:​

​​ Y
● ​ ou ask a​​chef (Controller)​​for food.​
​●​ ​The chef brings it to you directly.​

​MVVM:​

r​
​​ Y
● ​ ou ask a​​waiter (ViewModel)​​.​
​●​ ​The waiter keeps checking the​​kitchen (Model)​​and​​updates you automatically when​

au
​food is ready.​

​Interview Key Points​

G
​●​ ​MVC:​​Controller manually updates View.​

d
​●​ ​MVVM:​​ViewModel exposes state, View​​reacts automatically​​(reactive programming).​

​●​ F
an
​ lutter is reactive → MVVM (with Provider, Bloc, Riverpod, etc.) feels more natural than​
​MVC.​
An
​●​ ​MVVM makes code​​more testable and scalable​​.​

​Q3: What is BLoC architecture and what are its core principles?​
by

​●​ ​BLoC​​=​​Business Logic Component​

​●​ ​A​​state management pattern​​for Flutter.​


ed

​●​ ​It separates:​


at

​○​ ​Business logic​​(how data is processed)​


re

​○​ ​UI (widgets)​​(how data is displayed)​

​●​ ​It uses​​Streams​​(from Dart) to handle data flow.​


​C

👉 In short: UI sends​​events​​→ BLoC processes logic​​→ outputs new​​state​​→ UI rebuilds.​


​Why BLoC?​

​●​ ​Keeps UI code clean.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​273​


​15. Application Security in Flutter Apps​
​ 1: What are the fundamental secure coding principles that​
Q
​apply to Dart development?​

​1. Input Validation and Sanitization​

r​
​●​ ​Never trust user input—always validate and sanitize it.​

au
​●​ P
​ revent​​XSS​​,​​SQL injection​​, and​​command injection​​in APIs or backend-connected​
​apps.​

G
​●​ ​Example: Use​​RegExp​​for input validation and escape/encode​​dangerous characters.​

​2. Principle of Least Privilege​

d
​●​ ​Grant only the minimum permissions your app actually needs.​

an
​●​ ​Example: If you don’t need location services, don’t request them.​
An
​●​ K AndroidManifest.xml​​and iOS​​
​ eep your Android​​ Info.plist​​clean from unused​
​permissions.​

​3. Secure Storage of Sensitive Data​


by

​●​ ​Never hardcode secrets (API keys, tokens) in source code.​


ed

​●​ U
​ se​​flutter_secure_storage​​or platform keystore/keychain​​instead of​
SharedPreferences​​for sensitive data.​

at

​●​ ​Avoid storing access tokens in plain text files.​

​4. Strong Authentication & Authorization​


re

​●​ ​Implement proper user authentication flows (OAuth2, Firebase Auth, JWTs).​
​C

​●​ ​Validate authorization on the​​server side​​(never rely​​only on client-side check​

​5. Safe Use of Cryptography​

crypto​​or​​
​●​ ​Use trusted libraries like​​ pointycastle​
​.​

​●​ ​Never implement your own encryption algorithms.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​368​


​●​ ​Always prefer strong, modern algorithms (AES, SHA-256, RSA/ECDSA).​

​6. Secure Network Communication​

​●​ ​Enforce​​HTTPS/TLS​​for all API calls (disable plain​​HTTP).​

​●​ ​Validate SSL certificates (avoid blindly trusting all certificates).​

r​
​●​ ​Don’t log sensitive data like tokens or passwords.​

au
​7. Proper Error Handling​

G
​●​ ​Don’t expose stack traces or system info to the user in production.​

​●​ ​Use custom error messages that don’t reveal implementation details.​

d
​8. Dependency Management​

an
​●​ ​Keep Dart/Flutter packages up to date (​​
dart pub outdated​
​).​
An
​●​ ​Avoid unmaintained or suspicious third-party packages.​

flutter pub audit​​to check for known vulnerabilities.​


​●​ ​Run​​
by

​9. Memory & Resource Management​

dispose()​​on controllers, streams, and sockets​​to prevent leaks.​


​●​ ​Call​​
ed

​●​ ​Prevent unbounded list growth (e.g., caching without limits).​

​10. Logging & Monitoring​


at

​●​ ​Don’t log sensitive information.​


re

​●​ U
​ se monitoring tools (like Firebase Crashlytics, Sentry) but configure them to redact​
​C

​sensitive data.​

​ 2: What are the security considerations when using reflection in​


Q
​Dart?​

​1. Code Exposure & Obfuscation Risks​

​●​ ​Reflection can expose class names, method names, and fields at runtime.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​369​


​17. DevOps for Flutter​

​ 1: What is DevOps and how does it apply to mobile app​


Q
​development?​
​●​ ​DevOps​​=​​Development + Operations​

r​
​●​ I​t’s a​​set of practices, tools, and culture​​that brings​​together​​software development​

au
​(Dev)​​and​​IT operations (Ops)​​.​

​●​ ​Goal:​​deliver apps faster, reliably, and with high​​quality​​.​

G
​●​ ​Key principles:​
​○​ ​Automation​​: Build, test, deploy automatically​

d
​○​ ​Collaboration​​: Dev & Ops teams work together​

an
​○​ ​Continuous improvement​​: Monitor, feedback, iterate​

​DevOps in Mobile App Development​


An
​ obile DevOps focuses on the​​unique challenges of​​mobile apps​​(iOS, Android,​
M
​cross-platform) and aims to​​speed up development,​​testing, and release cycles​​.​
by

​Key Areas:​

​a) Continuous Integration (CI)​


ed

​●​ ​Developers​​merge code frequently​​into a shared repository.​

​●​ ​Automated builds and​​unit/widget tests​​run on every​​commit.​


at

​●​ ​Tools: GitHub Actions, GitLab CI, Bitrise, CircleCI​


re

​b) Continuous Delivery/Deployment (CD)​


​C

​●​ ​Automates​​release process​​for mobile apps.​

​●​ ​Generates​​signed APK/AAB (Android)​​or​​IPA (iOS)​​automatically.​

​●​ ​Can deploy to:​


​○​ ​Test environments (Internal/QA testers)​
​○​ ​Production (Play Store, App Store)​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​389​


​c) Automated Testing​

​●​ ​Run​​unit tests, widget tests, integration tests​​automatically.​

​●​ ​Ensures​​new changes don’t break the app​​.​

​●​ ​Example tools: Flutter’s test framework, Appium, Firebase Test Lab​

​d) Monitoring & Feedback​

r​
​●​ ​After release, monitor​​app performance, crashes, and​​user feedback​​.​

au
​●​ ​Tools: Firebase Crashlytics, Sentry, AppDynamics​

G
​e) Version Control & Collaboration​

​●​ ​DevOps encourages​​Git branching strategies​​, pull requests,​​and code reviews.​

d
​●​ ​Helps​​track changes, rollback if needed, and maintain​​quality​​.​

​Benefits of DevOps for Mobile Apps​ an


An
​1.​ ​Faster releases​​→ new features reach users quicker​

​2.​ ​Higher app quality​​→ fewer crashes and bugs​


by

​3.​ ​Automated builds & tests​​→ saves manual effort​

​4.​ ​Better collaboration​​→ developers & QA work seamlessly​


ed

​5.​ ​Continuous monitoring​​→ proactive issue fixing​


at

​Q2: What is a CI/CD pipeline and what are its main components?​
​●​ ​CI/CD​​stands for​​Continuous Integration / Continuous​​Delivery (or Deployment)​​.​
re

​●​ A
​ ​​pipeline​​is a​​sequence of automated steps​​that take​​your code from​​development​
​C

​→ testing → release​​.​

​●​ ​Goal:​​deliver high-quality apps faster and reliably​​.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​390​


​18. Scenario-Based Interview Questions​
​ 1: Your Flutter app is crashing on some devices but not others.​
Q
​How would you debug this?​

​1. Check crash reports​

r​
​●​ ​Use​​Firebase Crashlytics​​to see stack traces and device​​info.​

au
​2. Reproduce the issue​

​●​ T
​ ry to replicate the crash on​​emulators and physical​​devices​​matching the reported​

G
​OS versions.​

​3. Analyze logs​

d
​●​ U flutter run --verbose​​or​​
​ se​​ adb logcat​​for Android​​and Xcode console for​
​iOS.​

​4. Check platform-specific code​ an


An
​●​ ​If using​​platform channels or FFI​​, verify native code​​compatibility.​

​5. Verify package versions​


by

​●​ ​Some crashes occur due to​​incompatible Flutter or​​package versions​​.​

​6. Test network & async code​


ed

​●​ ​Crashes may happen with​​null values or failed async​​operations​​.​

​7. Fix & test​


at

​●​ A
​ pply the fix, test on multiple devices, and release​​beta via Firebase App Distribution​
re

​or TestFlight​​.​

​ 2: Your Flutter app UI is lagging when displaying a large list of​


Q
​C

​items. What would you do?​

​1. Use ListView.builder​

ListView​
​●​ ​Instead of​​ ListView.builder​​for​​lazy​​loading of items​​.​
​, use​​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​408​


​2. Wrap heavy widgets in RepaintBoundary​

​●​ ​Prevents​​unnecessary redraws​​of static UI parts.​

​3. Use const constructors​

​●​ ​Reduce widget rebuilds by making widgets​​immutable​​where possible​​.​

​4. Avoid heavy computations on main thread​

r​
​●​ ​Use​​compute()​​or​​Isolates​​for CPU-intensive tasks.​

au
​5. Use caching​

G
​●​ ​Cache images with​​CachedNetworkImage​​or local data​​caching.​

​6. Profile the app​

d
​●​ ​Use​​Flutter DevTools​​to find frame drops or jank.​

Q
​two APIs. How would you do it?​ an
​ 3: You need to fetch user data and posts simultaneously from​
An
​1. Use Futures in parallel​
final​​
​ results =​​
await​​
Future.wait([​
by

fetchUserData(),​

fetchUserPosts(),​

]);​

ed

​2. Handle errors individually​

catchError()​​to prevent one​​failure from blocking the other.​


​●​ ​Wrap each future with​​
at

​3. Update UI after both complete​


re

setState​
​●​ ​Use​​ ​,​​StreamBuilder​​, or​​ValueNotifier​​to update​​UI.​
​C

​4. Consider loading states​

​●​ ​Show a​​progress indicator​​until both APIs respond.​

​5. Optimize network calls​

​●​ ​Use​​Dio interceptors or caching​​to reduce redundant​​requests.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​409​


​ 4: A widget rebuild is causing performance issues. How would​
Q
​you identify and fix it?​

​1. Use Flutter DevTools​

​●​ ​Check​​widget rebuild counts and frame rendering time​​.​

​2. Wrap widgets with const​

r​
​●​ ​Widgets that don’t change should be​​const​​.​

au
AutomaticKeepAliveClientMixin​
​3. Use​​

G
​●​ ​Prevents​​ListView widgets from rebuilding unnecessarily​​.​

​4. Split large widgets​

d
​●​ ​Break into​​smaller, reusable widgets​​to reduce rebuild​​scope.​

ValueNotifier​​or​​
​5. Use​​ Provider​
an
An
​●​ ​Update only the​​necessary widget subtree​​, avoiding​​full tree rebuilds.​

​ 5: You want to implement push notifications in Flutter. How​


Q
​would you handle background and foreground messages?​
by

​1. Use Firebase Cloud Messaging (FCM)​

pubspec.yaml​​and initialize​​Firebase.​
​●​ ​Add FCM dependency in​​
ed

​2. Foreground messages​


at

​●​ L FirebaseMessaging.onMessage​​and show​​local​​notifications​​using​


​ isten to​​
​flutter_local_notifications​​.​
re

​3. Background messages​


​C

​●​ U FirebaseMessaging.onBackgroundMessage​​to handle​​messages​​even when​


​ se​​
​app is terminated​​.​

​4. Notification click action​

​●​ ​Navigate users to specific screens on tap using​​onMessageOpenedApp​​.​

​Created By :​​Anand Gaur​

​(Mobile Tech Lead - + 91 9807407363)​ ​410​


If you enjoyed this, check out my other books

"Your Complete Guide to


Cracking Flutter Interviews"

About Author
Anand Gaur is a Mobile Tech Lead with rich experience in designing and
developing impactful mobile applications. Skilled across Android, iOS,
Flutter, and Kotlin Multiplatform, he has mentored many developers and
guided them to crack interviews at leading IT companies.

You can find Anand at https://linktr.ee/anandgaur

ISBN : 978-93-344-0304-6

You might also like