Concepts in Mobile Dev, page 3
Dart Generics: Type-Safe Containers and Reusable Code
Generics let you define code that works with multiple types without sacrificing type safety. A List<String> is a list that only accepts strings. This is essential for collections.

Kotlin Coroutines on Android
Kotlin coroutines let Android code write asynchronous logic that reads like sequential code, suspending instead of blocking a thread. Structured concurrency ties each coroutine to a scope, so a destroyed ViewModel cancels its children automatically.
React Native's Text Component: Beyond Displaying Words
The React Native <Text> component creates a special text layout context, not a Flexbox one. Use it for all text, nesting components to style parts of a sentence.
Protocol Extensions: Default Behavior for Free
Protocol extensions give conforming types default functionality "for free," like a standard toolkit with every blueprint. Use them to add common behavior to your protocols or even extend system types.
Dart Streams: Asynchronous Data Sequences
A Dart Stream is like a conveyor belt for asynchronous data, delivering events or file chunks as they arrive. Use them for continuous data flows like button clicks or reading large files.

Coroutine Dispatchers: Telling Your Coroutines Which Thread to Use
A Dispatcher tells a coroutine which thread or thread pool to use for its work. Use Dispatchers.Default for CPU-intensive tasks. If none is specified, it inherits from its parent. The main footgun: Unconfined can resume on an unexpected thread.
React Native's Image Component
The Image component is React Native's tool for displaying pictures from network URLs, local app assets, or the device's camera roll. The biggest footgun: you must manually set width and height for any image loaded from a URL or it won't appear.
Retain Cycles and Capture Lists in Swift
A retain cycle is a memory leak where two objects hold strong references to each other, preventing deallocation. This often happens in closures that capture self, like network callbacks.

CoroutineScope: The Parent of Your Coroutines
A CoroutineScope acts as a parent to a group of coroutines, managing their lifecycles. When the parent scope is cancelled, all its children are cancelled too. It's used with builders like launch to group related work, like in an Android ViewModel.
ScrollView: For Simple, Bounded Content
ScrollView is a container for a limited amount of scrollable content, rendering everything inside at once. Use it for short forms or articles where upfront loading is fine. The footgun: it's slow for long lists—use FlatList instead to avoid performance hits.
Copy-on-Write (CoW) in Swift
Copy-on-write lets Swift's Array, Dictionary, Set, and String share one underlying buffer across copies until one is mutated, giving full value-type semantics with the performance of sharing, deferring the actual copy until it is truly needed.

Kotlin Flow: Asynchronous Data Streams
A Kotlin Flow is like an async Sequence, emitting multiple values over time without blocking. It's used for live data from a database or streaming network responses. The footgun: Flows are cold; the code doesn't run until a collector calls .collect().
React Native TextInput: Handling User Input
TextInput is your app's keyboard entry point. Use it for search bars and forms, configuring features like auto-capitalization and keyboard type. Be careful with styling: Android adds a default underline, and multiline mode can break single-side border styles.
Associated Types: Making Protocols Generic
Associated types make protocols generic. Think of them as a "fill-in-the-blank" type name. A protocol like Sequence has an Element type, which a conforming Array<String> fills in as String.

Structured Concurrency in Kotlin
Structured concurrency treats async operations like code blocks: a parent task's lifetime contains its children. In Kotlin, a CoroutineScope ensures if the parent is cancelled, all its child coroutines are too.

Kotlin's Job: A Handle to a Background Task
A Job is a handle to a coroutine, letting you manage its lifecycle. You get one from launch to control background tasks like network calls. The key footgun: a child's *failure* (Exception) cancels its parent, but a child's *cancellation* does not.
Pressable: A More Powerful Way to Handle Touches
The Pressable API wraps any component to detect granular press stages like press-in, press-out, and long-press. Use it for custom interactive elements. The main footgun is forgetting to use hitSlop on small targets, making them difficult to tap.
Static Members: Belong to the Class, Not the Instance
A static member is shared across all instances of a class, belonging to the class itself. Use it for constants or utility functions that don't depend on an instance's state, like a global counter. The footgun: you cannot use this inside a static context.

Key-Path Expressions: Type-Safe Pointers to Properties
A key path is a type-safe "pointer" to a property, like \User.name. It lets you pass around a reference to a property itself, not just its value, making it ideal for generic sorting or SwiftUI data binding. The footgun is forgetting they are strictly typed.

Kotlin Coroutines: async/await for Parallel Results
async starts a coroutine for a parallel result, returning a Deferred value. await pauses until that result is ready. Use it to run independent network calls concurrently. The footgun: using it for sequential tasks creates a needless race condition.
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