Skip to content
tezvyn:

All bites

The whole library, newest first. Filter by what you are here for, or pick a topic if you already know.

8668 bites

Page 200

Android & Kotlin2 min read

How do you manage API keys across Gradle build variants securely?

Gitignore a properties file, load it in build.gradle, map secrets to BuildConfig or manifest placeholders by flavor, and commit safe defaults.

Which Android Studio Profiler tool diagnoses high memory usage and leaks?
Android & Kotlin2 min read

Which Android Studio Profiler tool diagnoses high memory usage and leaks?

Heap dump, check retained size for leaked Activities, trace reference chains to root retainer.

What is ADB? Describe two common commands and what they accomplish.
Android & Kotlin2 min 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.

Which Android Studio tool inspects view hierarchy and what does it show?
Android & Kotlin2 min 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.

Explain what a Gradle product flavor is and give a free vs pro example
Android & Kotlin2 min 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.

App crash: debug with Logcat and breakpoints in Android Studio
Android & Kotlin2 min read

App crash: debug with Logcat and breakpoints in Android Studio

This tests systematic debugging and Android Studio fluency. A strong answer reproduces the crash, filters Logcat for the fatal exception, sets a breakpoint on the offending frame, and inspects variables.

What is the res directory and how do you use orientation qualifiers?
Android & Kotlin2 min read

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

Res/ holds non-code assets; create layout-port/ and layout-land/ with identical XML filenames for automatic framework selection.

What is the difference between project-level and module-level build.gradle?
Android & Kotlin2 min read

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

Project level sets plugin repos and shared versions; module level sets dependencies, build types, and flavors.

What is AndroidManifest.xml and what key elements does it declare?
Android & Kotlin2 min read

What is AndroidManifest.xml and what key elements does it declare?

This tests your grasp of the system-app contract. Good answers cover component registration, permissions, and build metadata like package name and target SDK. A red flag is omitting install-time system discovery.

How would you implement a type-safe Kotlin DSL for a UI Form?
Android & Kotlin2 min 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.

What is a reified type parameter in Kotlin?
Android & Kotlin2 min 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.

Describe coroutine cancellation mechanics and cooperative suspend functions
Android & Kotlin2 min 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 & Kotlin2 min read

How do buffer, conflate, and collectLatest manage Kotlin Flow backpressure?

Backpressure is fast emit vs slow collect; buffer() suspends the producer when full, conflate() drops stale values, and collectLatest() cancels active collection to…

Explain Kotlin's declaration-site variance with in and out
Android & Kotlin2 min read

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

Out T means covariant producer (read), in T means contravariant consumer (write), removing wildcard noise.

What is a CoroutineDispatcher and when to use Default versus IO?
Android & Kotlin2 min 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.

Hot vs cold Kotlin Flows and StateFlow use case
Android & Kotlin2 min 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.

How does Structured Concurrency handle cancellations and exceptions?
Android & Kotlin2 min 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.

What is a suspend function in Kotlin and its compiler rules?
Android & Kotlin2 min read

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
Android & Kotlin2 min 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.

What does inline solve for higher-order functions, and what is reified?
Android & Kotlin2 min 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.