Skip to content
Preptima

Android Architecture interview questions

Kotlin coroutines, Compose, and background processing.

5 questions in Mobile Engineering.

medium4

mediumConceptScenario

What does structured concurrency actually give you in Kotlin coroutines, and how does a coroutine scope leak happen despite it?

Structured concurrency ties a coroutine's lifetime to a CoroutineScope so cancellation propagates automatically, but a leak still happens when a coroutine is launched in a scope that outlives the component that should own it, such as GlobalScope or a manually retained scope nobody cancels. Use this KOTLIN answer to show the decision, trade-off, and evidence rather than a memorised definition.

4 minmid, senior

hard1

hardScenarioDesignConcept

An Android app queues actions while offline. After the process is killed and restarted, some actions sync twice and the user sees duplicate orders. How do you design the fix?

The queue records that work was sent but cannot know whether the server received it, so any crash between sending and recording the acknowledgement replays the action. At-least-once delivery is the only thing a mobile client can guarantee, so the fix is to make the operation idempotent with a client-generated key persisted alongside the queued action, not to try harder to deliver exactly once.

4 minmid, senior, staff