Interview questions in Mobile Dev, page 3

When would you use a sealed class instead of an enum?
This tests your understanding of state representation. Explain that sealed classes define a hierarchy of types that can hold different data, while enums are a set of singleton constants.

When to use a sealed class instead of an enum?
Tests your grasp of Kotlin's type hierarchies. Use sealed class for states with associated data (e.g., Success(data)), as subclasses can have unique properties. Use enum for simple, constant states. A red flag is treating them as interchangeable.
alignItems vs justifyContent in flexbox
JustifyContent aligns along the main axis, alignItems aligns along the cross axis; with column direction main is vertical and cross is horizontal.
Explain protocols and how extensions provide default implementations
Tests behavior sharing without inheritance. A strong answer defines protocols as requirements, shows extensions injecting default implementations, and contrasts this with base-class inheritance.
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.

Compare Kotlin apply and let scope functions
Apply uses this and returns receiver for configuration; let uses it and returns lambda result for null-safe transforms.

Compare and contrast Kotlin's `apply` and `let` scope functions
This tests your grasp of idiomatic Kotlin scope functions. apply uses this and returns the object, ideal for configuration. let uses it and returns the lambda result, useful for null-safe chaining.

Compare and contrast `apply` and `let` scope functions
Tests Kotlin scope function knowledge: context (this/it) & return value. apply uses this, returns the object (for config). let uses it, returns lambda result (for null-checks/transforms). Red flag: mixing up return values or use cases.
Using position absolute in React Native
Absolute removes a view from flex flow and positions it relative to its nearest positioned ancestor using top, left, right, bottom; ideal for overlays and badges.
What is a retain cycle in ARC with closures?
It tests reference counting and closure capture semantics. A retain cycle forms when a closure captures self strongly while self holds the closure; break it with weak if self can deallocate, or unowned if it will outlive the closure.

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.

What does inline solve for higher-order functions, and what is reified?
It tests lambda overhead and type erasure. Answer: inline flattens lambdas into call sites to remove allocation and virtual calls; reified needs inline so the compiler knows the concrete type at the call site, enabling is T checks.

Explain `inline` and `reified` in Kotlin
Tests your grasp of JVM performance costs and type erasure. A great answer explains how inline avoids object allocation for lambdas, and how this enables reified to bypass type erasure for runtime checks. A red flag is just saying 'it's for performance'.

What problem does `inline` solve, and how does `reified` relate?
This tests your grasp of Kotlin compiler optimizations and JVM type erasure. Explain that inline eliminates the runtime overhead of lambda objects. Then, describe how reified leverages inlining to make generic types accessible at runtime.
Circular View with centered text
Set equal width and height, borderRadius to half that, then justifyContent and alignItems center to place the Text in the middle.
What are Swift generics, why useful, and write a swap function?
This tests parametric polymorphism and type-safe reuse. A strong answer defines generics as placeholder types for reusable code, then writes a swap<T> function using inout parameters. Red flag: confusing generics with Any or omitting inout.
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 the difference between launch and async in Kotlin Coroutines
This tests scope behavior and side effects versus results. A strong answer says launch returns a Job for side effects, async returns a Deferred for results, and both are scope children. A red flag is using async for all tasks or ignoring exception handling.

Difference between launch and async in Kotlin Coroutines
This tests your grasp of coroutine result handling and exception propagation. Explain that launch is fire-and-forget (returns Job), while async is for results (returns Deferred). Mention async defers exceptions until await().

Explain launch vs. async in Kotlin Coroutines
Tests your grasp of structured concurrency, return values, and exceptions. launch is for fire-and-forget tasks (returns Job), while async is for tasks that produce a result (returns Deferred).
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