Advanced everything in Mobile Dev, page 6

Implement an API caching layer with offline support and storage trade-offs
Use in-memory for hot data and disk for offline, pick Hive or SQLite by shape, and use TTL with a sync queue.
Explain Dio interceptors and automatic token refresh
Define interceptors as hooks; queue concurrent 401s during refresh; retry with Bearer header via token manager.
Custom fade-and-scale transition with PageRouteBuilder and GoRoute
Tests bridging imperative transitions to declarative routers. Use PageRouteBuilder with FadeTransition and ScaleTransition, set globally in theme or per route via GoRoute pageBuilder with CustomTransitionPage. Red flag: omitting child rebuilds the page.
Explain Flutter's GestureArena and overlapping detector scenario
The arena opens on pointer down; recognizers accept or reject; the last accepted member wins.
Implement efficient async username validation in Flutter
Tests async field hygiene in Flutter. Outline: debounce 300ms, cancel inflight requests, decouple loading UI from errors, use reactive_forms async validators or manual streams. Red flag: API calls per keystroke without cancellation, loading treated as errors.
What problem does IntrinsicWidth solve and what are its performance costs?
This tests Flutter constraints and intrinsic sizing. A great answer covers: capping width to the child's max intrinsic width, aligning Column children, and the speculative pass that costs O(N²) in tree depth. A red flag is omitting performance cost.
Explain Flutter's 'constraints down, sizes up' rule and unbounded height error
Parents constrain down, children size up. ListView in Column throws unbounded height as Column gives infinite maxHeight; fix with Expanded or shrinkWrap.
How does const on a widget constructor impact build and reconciliation?
Tests widget canonicalization and reconciliation. Strong answers: const creates identical widget instances; Element.updateChild skips subtree rebuild when oldWidget == newWidget, saving elements and GC.
What are Keys in Flutter and why are they critical?
Tests widget identity during reconciliation. Keys let Flutter distinguish moved widgets from changed data; without ValueKeys, ReorderableListView leaves state at old positions, e.g., a checkbox swap. Red flag: calling them performance tools.
Explain the lifecycle of a State object
List initState through dispose, emphasizing didUpdateWidget reacts to parent config changes.
Explain StreamController, write a broadcast stream example, and why close it?
This tests Dart stream lifecycle and memory safety. A strong answer uses StreamController.broadcast(), adds data and errors, closes it, and explains unclosed controllers leak memory.
How does Dart resolve mixin method conflicts and application order?
Tests understanding of Dart's mixin linearization. Answer: Dart applies mixins left-to-right, building a superclass chain where the last mixin wins conflicts. Red flag: claiming first mixin wins or confusing with multiple inheritance.

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.
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.

Explain R8's shrinking, obfuscation, and optimization phases and how to influence optimization
Separate dead code removal, renaming, and bytecode transformation; cite ProGuard keep rules and selective passes.

How would you use Perfetto and Trace.beginSection to find a non-obvious bottleneck?
Tests correlation beyond CPU sampling. Covers coarse Trace.beginSection to limit 1-10us overhead, recording app ATrace with CPU/scheduling tracks, and correlating slices against scheduler latency. Red flag: omitting overhead or ignoring Perfetto SQL queries.

Explain generational GC in ART and why onDraw must avoid allocations
Covers young-gen nursery, mark-sweep fallback, and why a 5-10ms GC pause misses 16ms frame deadline.

Use Android Keystore to secure a database encryption key
Tests Android Keystore key generation and hardware trust boundaries. Strong answers: KeyGenParameterSpec with AES/GCM, TEE vs StrongBox isolation, setIsStrongBoxBacked on API 28+ with fallback, wrapping the database key. Red flag: claims Keystore encrypts DBs.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles