All bites
The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.
8668 bites
Page 170
Convert List<User> to Map<String, User> keyed by user id
Tests Dart collection-to-map idioms. A strong answer picks the for-element literal {for (var u in users) u.id: u}, mentions Map.fromIterable as a verbose alternative, and flags duplicate-key overwrites. Red flag: manually looping to populate an empty map.

Explain Dart's event loop, microtask queue, event queue, and await behavior
Tests Dart single-threaded event loop model. Strong answer: microtasks drain before event queue tasks; await suspends the function and schedules its resumption via the event loop when the Future completes. Red flag: claiming await blocks the thread.
Explain Dart switch exhaustiveness for enums versus sealed classes
This tests Dart 3 exhaustiveness. A strong answer notes that enums and sealed classes both require exhaustive switches, but sealed classes allow distinct payloads because subclasses stay in the same library. A red flag is calling them just enums with methods.
What are Dart extension methods? Implement toIntOrDefault on String.
Tests Dart extension syntax and static resolution. A strong answer defines an extension on String, uses int.tryParse with a fallback, and notes extensions do not mutate the original type. Red flag: using try-catch over tryParse or claiming dynamic dispatch.
What is a Dart closure? Write a function that returns a function.
Tests lexical scoping: define a closure as a function plus its captured environment, show a makeAdder where the inner function uses a parent variable after the parent returns.
How do you use collection-if and collection-for to declaratively build a list?
Tests Dart's declarative collection control-flow features. Answer: show collection-for to filter inside a literal, collection-if for conditional items, and combine both in one expression. Red flag: imperative loops and add() instead of literal syntax.
What problem does late solve in Dart?
Tests definite assignment and lazy init in null-safe Dart. Strong answers cover: deferred non-nullable field init, lazy final evaluation, and LateInitializationError on early access. Red flag: treating late as nullable or saying it bypasses null safety.

Describe Dart's null-aware ?. and null assertion ! operators
Tests Dart null safety mechanics: ?. short-circuits member access on null, while ! casts away nullability. A strong answer notes ?. avoids NPEs and ! is a risky opt-out. Red flag: claiming ! is safe or that ?. provides a default value.
Explain Dart positional vs named parameters and write one signature
Tests Dart parameter syntax. A strong answer covers required positional args, optional positional args in square brackets, and named args in curly braces with defaults. Red flag: claiming named parameters are always optional or confusing bracket types.
What is the difference between final and const in Dart?
Tests compile-time versus runtime immutability in Dart. A strong answer: final allows single assignment at runtime, but const requires a compile-time constant and deep immutability.
Flutter Performance Overlay
Flutter's Performance Overlay is a real-time EKG for frame budgets. Two graphs reveal whether Dart UI work or GPU rasterization is causing jank during animations. The footgun is rewriting widget logic when the raster thread is actually the bottleneck.
Tree Shaking Removes Unused Flutter Code
Tree shaking is the compiler deleting code your app never calls, so importing a massive package only costs the pieces you use. It runs automatically in release builds. Relying on dynamic dispatch or dart:mirrors silently disables it and brings back the bloat.
Legacy Integration Testing with flutter_driver
flutter_driver remotely pilots your app from a host via Dart VM service, common in legacy codebases with host-side scripts. Do not treat it as an in-process widget test because it runs outside the app; you cannot inspect state or use flutter_test matchers.
Repository Pattern: Hide Your Data Sources
A repository is a contract that hides where your data lives. Your Flutter app should not care if a user profile comes from Firebase, SQLite, or a mock. Engineers often leak HTTP clients or database models into UI instead of returning domain models.
Flutter Network Errors: Fail Gracefully
Treat every network call as a promise that might break. In Flutter, catch exceptions at the HTTP boundary and map them to UI states like retry widgets. The footgun is letting Dio or http exceptions bubble up, crashing the app instead of degrading gracefully.
Full-Text Search in Local Flutter Databases
SQLite FTS5 is an inverted index in your app: words map to row IDs, skipping brute-force scans. Use it when local tables exceed thousands of rows and LIKE lags. The footgun is that FTS virtual tables never auto-sync, so stale indexes return wrong rows.
Passing Arguments to Flutter Named Routes
Flutter named routes pass data through an arguments field instead of global variables. Use this when navigating to a route that needs an ID or configuration object. Arguments are untyped by default, so unsafe casts crash at runtime.
Explain layered filesystems like OverlayFS and their efficiency vs monolithic models
This tests copy-on-write layering and deduplication in container storage. A strong answer covers lowerdir/upperdir/merged mounts, layer reuse across images, and why diff-based distribution beats monolithic blobs.
Describe the relationship between containerd and runc in starting a container.
Tests the OCI runtime split and lifecycle ownership. A great answer states containerd handles image pull, storage, and API lifecycle, then invokes runC to spawn the isolated process.
How do containers enforce CPU and memory limits via cgroups?
Cover CPU CFS quota and shares, memory limits and OOM, and runtime cgroup config.