tezvyn:

📱Mobile Dev

Mobile app development across platforms

351 bites

Android & Kotlin30 sec read

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.

Android & Kotlin31 sec read

Android Style vs. Theme and Attribute Resolution

Tests your grasp of Android's resource scope and resolution timing. A Style targets a single View, while a Theme applies to a whole Context. `@color/` is a direct, compile-time link; `?attr/` is an indirect pointer resolved against the Theme at runtime.

Android & Kotlin30 sec read

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.

Android & Kotlin30 sec read

Bound Service Lifecycle with Config Changes & Multiple Clients

Tests your grasp of bound Service lifecycles. Explain that with BIND_AUTO_CREATE, the Service survives an Activity's config change recreation. It's only destroyed after the *last* client unbinds. A red flag is assuming the Service dies with the first client.

Android & Kotlin30 sec read

Explain app restoration after Android process death

Tests your grasp of process death vs. configuration changes. A good answer explains that the entire app process is recreated, starting with onCreate, and state must be restored from the SavedStateHandle.

Android & Kotlin30 sec read

Static vs. Dynamic BroadcastReceivers: Implications & Restrictions

This tests your grasp of Android's background restrictions. Explain that static receivers live with the app but are restricted post-API 26, while dynamic receivers are tied to a component's lifecycle. Ignoring modern API restrictions is a major red flag.

Android & Kotlin30 sec read

When and why to use a Foreground Service?

Tests your grasp of Android's background execution limits. A great answer explains they're for user-visible tasks like music playback, requires `startForegroundService()`, and must show a notification within 5 seconds.

Android & Kotlin30 sec read

Describe the back stack for A -> B -> C with singleTask

Tests understanding of the `singleTask` launch mode. A great answer explains that launching C destroys B, as `singleTask` clears all activities above it in the task. The final back stack becomes [A, C]. A red flag is confusing this with `singleTop`.

Android & Kotlin30 sec read

How does a ViewModel survive configuration changes?

Tests understanding of lifecycle-aware components. ViewModels are retained by a ViewModelStore owned by the Activity/Fragment, which survives configuration changes. The ViewModel is cleared only when its scope is permanently finished.

Android & Kotlin30 sec read

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.

Android & Kotlin30 sec read

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

Android & Kotlin30 sec read

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.

Android & Kotlin30 sec read

How do you diagnose a memory leak using the Android Studio Profiler?

This tests your practical skill with the Android Memory Profiler, not just theory. A great answer involves capturing a heap dump, filtering for unreachable objects, and inspecting the reference tree to find the leak's source.

Android & Kotlin30 sec read

Explain Gradle Build Types vs. Product Flavors

Tests your grasp of Gradle's build matrix. A great answer defines build types for lifecycle (debug/release) and product flavors for user-facing versions (free/paid), then explains how they combine into variants.

Android & Kotlin30 sec read

What is ADB and what are two common commands you use?

Tests your hands-on familiarity with the core Android toolchain. Define ADB's client-server architecture, then explain `adb install` for APKs and `adb logcat` for logs. A red flag is being unable to name specific commands or only knowing IDE buttons.

Android & Kotlin30 sec read

Which tool inspects the view hierarchy to debug layouts?

This tests your knowledge of core Android Studio debugging tools. A great answer names the Layout Inspector, describes its 3D component tree and attributes pane, and notes its live update capability on API 29+. A red flag is only mentioning XML files.

Android & Kotlin30 sec read

What is a Gradle product flavor?

This tests your understanding of build variants beyond debug/release. Define flavors for user-facing versions (free/pro), contrast with build types, and configure with `applicationIdSuffix` and `buildConfigField`.

Android & Kotlin30 sec read

How would you debug an app crash in Android Studio?

This tests your systematic debugging process. A good answer starts with Logcat to find the stack trace, then uses breakpoints to inspect program state *before* the crash occurs. A red flag is randomly adding print statements instead of using the debugger.

Android & Kotlin30 sec read

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.

Android & Kotlin30 sec read

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.