tezvyn:

Android & Kotlin

Jetpack Compose, Android Studio, Kotlin, Material You

243 bites

Android & Kotlin33 sec read

What is ADB? Describe two common commands and what they accomplish.

This tests command-line debugging fluency. Define ADB as a client-server bridge, then give two commands such as adb install for APK deployment and adb logcat for streaming device logs. Red flag: calling it the Android Studio debugger or omitting the daemon.

Android & Kotlin30 sec read

Which Android Studio tool inspects view hierarchy and what does it show?

Tests practical knowledge of runtime UI debugging tools. A strong answer names Layout Inspector, cites live view hierarchy with bounds and attributes, and distinguishes it from the static Layout Editor. Red flag: citing Logcat or the preview pane instead.

Android & Kotlin30 sec read

Explain what a Gradle product flavor is and give a free vs pro example

Tests understanding of build-variant dimensions beyond build types. A strong answer defines flavorDimensions, sets free and pro applicationIdSuffix values, and explains variant generation. Red flag: conflating flavors with build types or manual APK renaming.

Android & Kotlin30 sec read

What is the res directory and how do you use orientation qualifiers?

WHAT IT TESTS: Android's declarative resource system and runtime configuration adaptation. ANSWER OUTLINE: res/ holds non-code assets; create layout-port/ and layout-land/ with identical XML filenames for automatic framework selection.

Android & Kotlin30 sec read

What is the difference between project-level and module-level build.gradle?

WHAT IT TESTS: Gradle scope in multi-module Android projects. ANSWER OUTLINE: Project level sets plugin repos and shared versions; module level sets dependencies, build types, and flavors. RED FLAG: Claiming both files do the same thing or misplacing plugins.

Android & Kotlin30 sec read

How would you implement a type-safe Kotlin DSL for a UI Form?

Tests Kotlin DSL scoping with lambda receivers and extensions. Strong answers sketch a Form builder using initTag, explain T.() -> Unit implicit this for child elements, and add DslMarker to block scope leaks. Red flag: describing it as simple method chaining.

Android & Kotlin30 sec read

What is a reified type parameter in Kotlin?

Tests JVM type erasure and inline function mechanics. Strong answer: reified preserves generic types at runtime via inline expansion, enabling is T checks without Class<T> passing. Red flag: claiming reified works without inline or outside functions.

Android & Kotlin30 sec read

Describe coroutine cancellation mechanics and cooperative suspend functions

Tests cooperative cancellation mechanics. cancel() sets a Job to cancelling; suspend functions check this at suspension points and throw CancellationException, yet a tight non-suspending loop never checks and keeps running.

Android & Kotlin30 sec read

Explain Kotlin's declaration-site variance with in and out

WHAT IT TESTS: Understanding declaration-site variance versus wildcards. ANSWER OUTLINE: out T means covariant producer (read), in T means contravariant consumer (write), removing wildcard noise. RED FLAG: Confusing in/out with bounds or claiming immutability.

Android & Kotlin30 sec read

What is a CoroutineDispatcher and when to use Default versus IO?

This tests thread pool selection and the CPU versus IO distinction. A strong answer maps CoroutineDispatcher to the thread pool, Default to CPU work, IO to blocking IO, and Main to the UI thread.

Android & Kotlin30 sec read

Hot vs cold Kotlin Flows and StateFlow use case

Tests grasp of flow lifecycle and collector behavior. A strong answer contrasts cold Flows, which restart per collector, with hot StateFlows broadcasting to all observers. Red flag: using Flow for UI state without citing config changes or initial value.

Android & Kotlin30 sec read

How does Structured Concurrency handle cancellations and exceptions?

This tests scope-bound lifecycle management preventing leaks. Cover scope cancellation cascading to children, exceptions propagating up to cancel siblings, and launch or async requiring a scope. A red flag is treating coroutines as fire-and-forget threads.

Android & Kotlin31 sec read

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.

Android & Kotlin30 sec read

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.

Android & Kotlin30 sec read

Compare Kotlin apply and let scope functions

WHAT IT TESTS: Your grasp of Kotlin scope mechanics. ANSWER OUTLINE: Apply uses this and returns receiver for configuration; let uses it and returns lambda result for null-safe transforms. RED FLAG: Calling them interchangeable or ignoring return values.

Android & Kotlin30 sec read

When would you use a sealed class instead of an enum?

This tests closed hierarchies versus singleton constants. A strong answer contrasts enums with sealed class instances, shows a NetworkResult example with data-bearing branches, and highlights exhaustiveness.

Android & Kotlin30 sec read

Explain higher-order functions and implement filterAndTransform

Tests whether you can define higher-order functions and use lambdas idiomatically in Kotlin. A strong answer defines HOFs as functions that take or return functions, then implements filterAndTransform with filter and map.

Android & Kotlin30 sec read

Explain lateinit var versus val by lazy in Android

Tests deferred initialization and lifecycle coupling. Great answers contrast lateinit var's imperative assignment with lazy's first-access delegation, mapping lateinit to injected Activity fields and lazy to expensive computed objects.

Android & Kotlin30 sec read

What are the primary advantages of using a data class?

Tests Kotlin boilerplate reduction and value semantics. Name three generated functions like equals, hashCode, and copy; explain structural equality; and show copy updating immutable UI state.

Android & Kotlin30 sec read

What is an extension function? Write a hasWhitespace extension for String.

WHAT IT TESTS: Kotlin extensions are static dispatch, not true members. ANSWER OUTLINE: Explain receiverType.functionName adds behavior without inheritance; write hasWhitespace with any { it.isWhitespace() }. RED FLAG: Extensions modify classes or override.