Easy everything in Android & Kotlin, page 3

What is a suspend function in Kotlin and its compiler rules?
This tests your understanding of suspendable computations and compiler transformation. A strong answer notes non-blocking suspension, the call-from-suspend-context rule, and compiler support for pausing and resuming. A red flag is claiming they block threads.

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.

Explain val vs var in Kotlin and null safety risks
Val is read-only, var is mutable; nullables use ? like String?; risk is NullPointerException if checks are missed.

How do you pass data between Fragments with Jetpack Navigation?
Tests knowledge of modern, type-safe argument passing. A good answer defines the argument in the nav graph XML, uses the Safe Args plugin to generate Directions/Args classes, navigates with the action, and retrieves the data in the destination via `by…

Explain ViewModel, Repository, and Data Source in MVVM
This tests your understanding of separation of concerns. A great answer defines ViewModel (UI state), Repository (data abstraction), and Data Sources (implementation), then explains the unidirectional data flow.

What is a Jetpack ViewModel and the problem it solves?
This tests your understanding of lifecycle-aware state preservation. A good answer explains that ViewModels survive configuration changes (like rotation) to hold UI data, separating it from the transient UI controller.

How do you arrange UI elements in Jetpack Compose?
Tests your grasp of Compose's declarative layout model. Explain Row (horizontal) and Column (vertical) as the core layout composables. Define Modifier as the standard way to configure size, spacing, and behavior.

What is the purpose of `remember` in Jetpack Compose?
This tests your grasp of Compose's recomposition lifecycle. A good answer explains remember caches an object across recompositions, preventing state loss. It's used with mutableStateOf to hold the same state instance.

LinearLayout vs. RelativeLayout vs. FrameLayout
This tests your knowledge of fundamental View layouts and performance trade-offs. Define LinearLayout (single axis), RelativeLayout (relative positioning), and FrameLayout (stacking), giving a clear use case for each.

Started vs. Bound Services: Differences and Use Cases
Tests Android component lifecycle and IPC knowledge. A good answer defines lifecycle control (start vs. bind), communication (one-way vs. two-way IBinder), and gives clear use cases. A red flag is assuming services run on a background thread by default.

What happens to an Activity and its text on screen rotation?
Tests understanding of configuration changes and state preservation. A great answer explains the Activity is destroyed and recreated, EditText state is often saved automatically, but the robust solution is using a ViewModel with SavedStateHandle.

Trace an Activity's lifecycle when a user navigates away and returns
This tests your understanding of resource management and state preservation, not just memorization. A great answer traces onPause -> onStop when leaving, and onRestart -> onStart -> onResume when returning, explaining what happens in each.

What is the `res/` directory and how do you use resource qualifiers?
This tests your grasp of Android's resource system. Explain that res/ separates assets from code and that qualifiers (e.g., layout-land) let the OS pick the right layout. A red flag is checking orientation manually in code instead of using this system.

Difference between project and module build.gradle files?
This tests your understanding of Gradle's project structure and build configuration scope. The project-level file configures global settings like repositories, while the module-level file configures specifics like dependencies and app ID.

Purpose and Key Elements of AndroidManifest.xml
Tests if you know the manifest is the app's contract with the Android OS. A good answer defines its role and lists key elements like activities, permissions, and the launcher intent. A red flag is calling it just a generic 'config file'.

Explain Kotlin's scope functions: let, run, with, apply, also
This tests your grasp of idiomatic Kotlin and the two key differentiators: context object (this/it) and return value (object/lambda result). A great answer defines these axes, categorizes each function, and provides a clear example.

What is a `suspend` function in Kotlin?
Tests your grasp of Kotlin's core concurrency primitive. A suspend function can pause and resume. It must be called from another suspend function or a coroutine builder.

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

Purpose of Kotlin's safe call (`?.`) and Elvis (`?:`) operators?
This tests your grasp of Kotlin's null safety philosophy. A good answer defines the safe call (?.) for conditional access and the Elvis operator (?:) for default values, then combines them. A red flag is using verbose if/else checks for simple cases.

Explain val vs. var and null safety in Kotlin
Tests your grasp of Kotlin's core principles: immutability and compile-time null safety. Define val (read-only) vs. var (mutable), declare nullables with ?, and identify the risk as runtime NullPointerExceptions.
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