Appendices: Projects, Interview Questions, Cheat Sheet & Study Plan
Capstone projects, interview questions, a Dart cheat sheet, Dart for developers coming from other languages, and resources with a study plan.
Appendix A: Capstone Projects
Beginner: Console Quiz Game. Lists, maps, functions, stdin, scoring, questions loaded from JSON.
Beginner: Contact Book CLI. Classes, null safety, file persistence (JSON), the args package, unit tests.
Intermediate: Expense Tracker Library + CLI. Sealed classes for transactions, records for summaries, pattern matching, CSV import/export, Iterable analytics, 90% test coverage.
Intermediate: Weather CLI. package:http, async/await, JSON models via json_serializable, error handling with a Result type, caching to disk, compiled to a native executable.
Intermediate: Concurrent File Processor. Streams (openRead + transformers), isolates for CPU-heavy hashing/compression, progress output with mason_logger.
Advanced: REST API with Dart Frog or shelf. PostgreSQL via the postgres package or drift, JWT auth middleware, validation, integration tests, Docker deployment to Cloud Run.
Advanced: Full-Stack Dart with Serverpod. A Serverpod backend + Flutter client sharing generated models, real-time streaming, auth.
Advanced: Code Generator. A source_gen builder that generates copyWith/toString or API clients from annotations, published as a package.
Advanced: FFI Wrapper. Bind a C library (e.g., SQLite, libsodium, or your own) with ffigen + native assets, and provide an idiomatic Dart API with finalizers.
Web: Dart + Wasm App. A Jaspr or package:web app compiled to Wasm with JS interop to a charting library.
Flutter: Notes App. Riverpod or Bloc, go_router, drift/Isar local DB, sync with a REST backend, widget and integration tests, CI/CD.
Open Source: Publish a Package. Build a well-documented utility package (e.g., a validation library using extension types), with CI, examples, and pub.dev publishing.
Appendix B: Interview Questions
What is Dart, and what are its main use cases?
var vs final vs const vs late vs dynamic?
Explain sound null safety. What do ?, !, ??, ??=, and ?. do?
What is type promotion, and when does it fail (fields vs locals)?
int vs double vs num? What does ~/ do?
Explain the cascade (..) and spread (..., ...?) operators.
What are collection if/for and null-aware elements?
Optional positional vs named parameters? What does required do?
What are closures and tear-offs?
What are typedefs?
Explain the constructor kinds: generative, named, const, factory, redirecting, initializer lists, super parameters.
extends vs implements vs with?
What is an implicit interface?
What are mixins? What does on do? What is a mixin class?
Explain the class modifiers: abstract, base, interface, final, sealed.
What are enhanced enums?
Extension methods vs extension types?
How does library privacy (_) work?
How do you implement value equality? Why must hashCode match ==?
What are callable classes?
What are records? How do they compare to classes?
Explain patterns: destructuring, object/list/map/record patterns, guards, if-case.
How does exhaustiveness checking work with sealed classes?
What are reified generics? Explain covariance in Dart generics.
sync* vs async* generators? What does yield* do?
Async and Concurrency Explain the event loop, the microtask queue, and the event queue.
What is a Future? How do then, catchError, whenComplete, and async/await relate?
How do you run futures in parallel (Future.wait, record .wait)?
Single-subscription vs broadcast streams? What is a StreamController?
How do you handle stream errors and cancellation?
What are isolates? How do they differ from threads? When do you use Isolate.run?
What are zones, and what is runZonedGuarded used for?
Common async pitfalls (unawaited futures, async forEach)?
Tooling and Production What does pubspec.yaml contain? What do the caret version constraints mean?
How do build_runner, json_serializable, and freezed work? Why were macros cancelled?
How do you configure lints and analysis options?
How do you test async code and mock dependencies?
JIT vs AOT? What are Dart's compilation targets (native, JS, Wasm)?
How does dart:ffi work? What are native assets?
How does the new JS interop (dart:js_interop, package:web) differ from dart:html?
How would you structure a Flutter app's state management?
How do you optimize Dart/Flutter performance?
Implement a generic Stack<T> with push, pop, peek, and a custom Iterable.
Write a sealed Shape hierarchy and an exhaustive area switch expression.
Parse nested JSON safely using patterns and return a Result type.
Write a function that fetches 3 URLs concurrently with a timeout and retries.
Implement debounce for a Stream (without rxdart).
Compute word frequencies from a large file using streams, and offload the counting to an isolate.
Create an extension type Email that validates on construction.
Write a sync* generator for prime numbers and take the first 20.
Appendix C: Dart Cheat Sheet
// ===== Variables & types =====
var a = 1; final b = 'x'; const c = 3.14; late String d; String? e; dynamic f; Object g = 1;
int i = int.parse('1'); double? n = double.tryParse('x'); var big = 1_000_000;
// ===== Null safety =====
e?.length; e ?? 'default'; e ??= 'set'; e!; [...?list]; [1, ?maybe];
// ===== Strings =====
'Hello $a ${a + 1}'; '''multi'''; r'raw\n'; s.split(','); s.trim(); s.contains('x'); StringBuffer()..write('a');
// ===== Collections =====
var l = [1, 2]; var s = {1, 2}; var m = {'k': 1};
[0, ...l, if (cond) 3, for (var x in l) x * 2];
l.map((x) => x * 2).where((x) => x > 2).toList(); l.fold(0, (p, x) => p + x);
// ===== Control flow =====
if (x case int v when v > 0) {}
final r = switch (x) { 0 => 'zero', > 0 => 'pos', _ => 'neg' };
for (final (i, v) in l.indexed) {}
// ===== Functions =====
int add(int a, [int b = 0]) => a + b;
void user({required String name, int age = 18}) {}
final sq = (int x) => x * x; typedef Op = int Function(int);
// ===== Classes =====
class P { final int x, y; const P(this.x, this.y); P.origin() : this(0, 0); factory P.fromJson(Map j) => P(j['x'], j['y']); }
abstract interface class Repo { Future<void> save(); }
mixin Log { void
…dart create -t console app | dart run | dart test | dart analyze | dart format . | dart fix --apply
dart pub add http | dart compile exe bin/main.dart | dart compile js | dart compile wasm | dart docAppendix D: Dart for Other Developers
final / const string | null interface (TS) Implicit + interface class Multiple inheritance of behavior Interfaces with bodies mixins (with) Records / freezed / manual sealed class enum (associated values) { x -> x * 2 } (x) => x * 2 Promise + async/await Future + async/await Observable (RxJS) Erased (reified inline) _ = library-private Key gotchas:
Java/Kotlin devs: privacy is per library (file), not per class. There are no checked exceptions, no overloading by parameter types (use named/optional parameters), and every class is an interface.
JS/TS devs: Dart is soundly typed (types are checked at runtime too), there's no truthiness (conditions must be bool), and == is overridable value equality.
Swift devs: classes are reference types (records are the closest thing to value aggregates), memory is GC-managed (no ARC), and concurrency uses isolates instead of shared-memory threads.
Appendix E: Resources and Study Plan
dart.dev: Language tour, Effective Dart, library tour, codelabs, API reference (api.dart.dev), the null safety guide, the patterns/records docs, the async guide, the isolates guide
DartPad (dartpad.dev), pub.dev (packages), the Dart blog (medium.com/dartlang), the Dart SDK changelog and language funnel (github.com/dart-lang/language)
flutter.dev: Flutter docs, cookbook, the architecture guide, YouTube (Flutter and Dart channels) Books and Courses
*Dart Apprentice: Fundamentals* and *Dart Apprentice: Beyond the Basics* (Kodeco) *Flutter Apprentice* (Kodeco)
*Flutter Complete Reference* (Alberto Miola) *Dart in Action* (classic, pre-null-safety concepts)
Online: the Dart/Flutter courses by Andrea Bizzotto (Code With Andrea), Very Good Ventures' blog, Reso Coder (architecture), Google Codelabs r/dartlang, r/FlutterDev, the Flutter Community on Medium, the Dart/Flutter Discord, Stack Overflow (dart, flutter), conferences (Flutter Forward, FlutterCon, Fluttercon Europe) 11-Week Study Plan Setup, variables/types, null safety
Numbers/strings, operators, control flow, collections Functions, iterables, classes, constructors
Inheritance/interfaces, mixins, class modifiers, enums Extensions/extension types, exceptions, records, patterns
Generics, operators/equality, generators Event loop, Futures, async/await, Streams, isolates, zones
Libraries, pub, core libraries, I/O, JSON, HTTP, code generation
Lints, testing, DevTools, docs, compilation targets, FFI, JS interop
CLI, server-side, Flutter overview, state management 47–50 + Capstone
Performance, security, deployment, internals, Effective Dart
Final tip: Practice daily in DartPad, read Effective Dart, and master null safety, async/await, and pattern matching with sealed classes: they're the heart of modern Dart. Then build a CLI tool, a small backend, and a Flutter app to see Dart shine everywhere. Happy coding! 🎯