✅ DART INTERVIEW QUESTIONS & ANSWERS (1–100)
🔹 BASIC DART QUESTIONS (1–20)
1. What is Dart?
Dart is an open-source, object-oriented programming language developed by Google, mainly used with Flutter to build mobile, web, and desktop apps.
2. Who developed Dart?
Dart was developed by Google.
3. Is Dart compiled or interpreted?
Dart supports both:
- JIT (Just-In-Time) for development
- AOT (Ahead-Of-Time) for production
4. What are the features of Dart?
Fast performance, OOP support, null safety, garbage collection, async programming.
5. What is the Dart SDK?
It includes tools, libraries, and runtime to develop Dart applications.
6. Is Dart strongly typed?
Yes, Dart is strongly typed.
7. What is main() in Dart?
It is the entry point of a Dart program.
8. What are variables in Dart?
Variables store data values in memory.
9. How to declare a variable?
int age = 20;
10. What is var keyword?var automatically infers the data type.
11. What is dynamic?dynamic allows variable type to change at runtime.
12. Difference between var and dynamic?var type is fixed after assignment, dynamic is not.
13. What is null safety?
It prevents null reference errors in Dart.
14. How to declare nullable variable?
int? number;
15. What is final keyword?
Value cannot be changed after assignment.
16. What is const keyword?
Compile-time constant.
17. Difference between final and const?final → runtimeconst → compile-time
18. What is a comment?
Used to explain code.
19. Single-line comment?
// This is comment
20. Multi-line comment?
/* This is comment */
🔹 DATA TYPES & COLLECTIONS (21–40)
21. What are basic data types in Dart?
int, double, String, bool, List, Map
22. What is List?
An ordered collection of items.
23. Example of List
List<int> nums = [1,2,3];
24. What is Map?
Key-value pair collection.
25. Example of Map
Map<String,int> marks = {'Math':90};
26. What is Set?
Unordered collection with unique values.
27. Difference between List and Set?
List allows duplicates, Set does not.
28. What is String interpolation?
print("Age is $age");
29. What is is operator?
Used to check type.
30. What is as keyword?
Used for type casting.
31. What is spread operator?
[...list1]
32. What is cascade notation?
obj..method1()..method2();
33. What is late keyword?
Used for lazy initialization.
34. What is type inference?
Dart automatically detects data type.
35. What is List.generate()?
Creates dynamic list.
36. What is List.filled()?
Creates fixed-length list.
37. What is Map iteration?
Looping through Map entries.
38. What is forEach()?
Used to loop collection.
39. What is contains()?
Checks value exists or not.
40. What is length property?
Returns size of collection.
🔹 FUNCTIONS & CONTROL FLOW (41–60)
41. What is function?
A reusable block of code.
42. Function syntax
int add(int a,int b)=>a+b;
43. What is arrow function?
Short syntax using =>.
44. What is optional parameter?
Parameter not mandatory.
45. Named parameters example
void fun({int? age}){}
46. What is required keyword?
Makes named parameter mandatory.
47. What is default parameter?
Parameter with default value.
48. What is anonymous function?
Function without name.
49. What is recursion?
Function calling itself.
50. What is if-else?
Conditional statement.
51. What is switch case?
Multiple condition handling.
52. What is for loop?
Iterates fixed number of times.
53. What is while loop?
Runs while condition true.
54. What is do-while loop?
Runs at least once.
55. What is break?
Stops loop.
56. What is continue?
Skips iteration.
57. What is ternary operator?
a>b ? a : b
58. What is assert?
Debugging condition check.
59. What is exception?
Runtime error.
60. How to handle exception?
try{}catch(e){}
🔹 OOPS & ADVANCED (61–100)
61. What is OOP?
Programming using objects.
62. What is class?
Blueprint of object.
63. What is object?
Instance of class.
64. What is constructor?
Initializes object.
65. Types of constructor?
Default, Named, Parameterized
66. What is inheritance?
Child class acquires parent properties.
67. What is extends keyword?
Used for inheritance.
68. What is polymorphism?
Many forms of method.
69. What is method overriding?
Redefining parent method.
70. What is abstraction?
Hiding implementation details.
71. What is interface?
Contract implemented by class.
72. Does Dart support multiple inheritance?
No (uses interfaces)
73. What is mixin?
Reuse code without inheritance.
74. What is with keyword?
Used to apply mixin.
75. What is encapsulation?
Wrapping data and methods.
76. What is private variable?
Starts with _.
77. What is getter?
Access private data.
78. What is setter?
Modify private data.
79. What is async?
Asynchronous execution.
80. What is await?
Waits for Future result.
81. What is Future?
Represents delayed result.
82. What is Stream?
Multiple async values.
83. Difference between Future & Stream?
Future → one value
Stream → many values
84. What is isolate?
Independent thread.
85. What is garbage collection?
Memory cleanup.
86. What is Flutter?
UI framework using Dart.
87. Why Dart for Flutter?
Fast UI rendering.
88. What is hot reload?
Instant UI update.
89. What is pub?
Dart package manager.
90. What is pubspec.yaml?
Project configuration file.
91. What is package?
Reusable code library.
92. What is dependency?
External library.
93. What is SDK constraint?
Defines Dart version.
94. What is static keyword?
Belongs to class, not object.
95. What is factory constructor?
Returns instance conditionally.
96. What is enum?
Collection of constant values.
97. What is typedef?
Function alias.
98. What is extension?
Add methods to existing class.
99. What is operator overloading?
Custom operator behavior.
100. Is Dart platform independent?
Yes ✅