Senior Android interview questions
68 questions from the Senior lessons. Open a question to see the junior, mid and senior answers. Each one links to the lesson that explains it.
Mobile system design
Walk me through how you would approach a mobile system design interview.
- Junior
- I would first ask what the app does and who uses it. Then I would draw a simple diagram with a UI layer, a network layer, and a local database. After that I would pick one or two parts to go deeper, like how images are cached or how the app works offline.
- Mid
- I follow a five-phase structure: clarify requirements, draw the client component diagram, design the API contract, detail the data layer, and do two or three deep dives. I time-box each phase so I finish in thirty minutes. In the data layer I make Room the source of truth and use RemoteMediator to pull cursor-paged data from the server.
- Senior
- The structure is fixed, but the depth is not. I clarify first, then draw the diagram, then lock the API contract (cursor pagination, idempotency keys, error codes). In the data layer I specify the outbox state machine and how WorkManager drains it on reconnect. In deep dives I pick the two areas with the highest risk for the given problem—for a chat app that is WebSocket backoff and message ordering; for a feed it is paging with RemoteMediator and image loading. I verify my choices against the non-functional constraints I wrote in Phase 1.
How do you decide between REST, GraphQL, and WebSocket for a mobile app?
- Junior
- REST is the default for most CRUD screens. GraphQL is useful when the client needs to pick exactly the fields it wants. WebSocket is for real-time features like chat or live scores where the server pushes data to the client.
- Mid
- REST works when the client makes discrete requests and the server response shape is stable. GraphQL helps when multiple screens need overlapping subsets of the same entity, reducing over-fetching. WebSocket (or SSE for one-way push) is the right choice when latency must be under a second and the server initiates messages. The pitfall is using WebSocket for everything; it holds a connection open and drains battery, so you fall back to FCM push when the socket is idle.
- Senior
- The decision is a trade-off between coupling, battery, and latency. REST keeps the server contract simple but forces the client to over-fetch or make multiple calls. GraphQL reduces round-trips but adds a query layer the mobile team must maintain. WebSocket gives sub-second push but costs a persistent TCP connection and battery; you mitigate with exponential backoff on reconnect and FCM as a wake-up signal. For a feature where updates are rare, a push message that tells the app to fetch, or plain polling when the screen opens, is cheaper than holding a socket open.
What does 'local database as source of truth' mean in practice?
- Junior
- It means the app stores data in Room and the UI reads from Room, not from the network. When the app is offline, the user still sees the last fetched data. When the network is back, a background job updates Room.
- Mid
- Room is the single read path. The UI observes a Flow from a Room DAO. RemoteMediator fetches the next cursor page and upserts into Room. The outbox table holds pending mutations. The pitfall is having two read paths—one from Room, one from a cached network response—which causes the UI to show inconsistent data when the two disagree.
- Senior
- In a real codebase I verify this by checking that every ViewModel exposes a StateFlow sourced from a Room DAO, not from a Retrofit call. RemoteMediator is the only writer that pulls from the network; the outbox is the only writer that pushes. I add a SyncState enum (IDLE, SYNCING, FAILED, UP_TO_DATE) that the UI observes to show a stale-data chip. I also check that Room migrations handle schema changes without data loss, because a dropped column silently breaks the source-of-truth guarantee.
How do you handle the trade-off between battery and real-time updates?
- Junior
- For real-time features like chat, I use a WebSocket so the server can push messages instantly. For less urgent features like a news feed, I use a periodic background job with WorkManager so the app does not hold a network connection open all the time.
- Mid
- The trade-off is connection lifetime versus freshness. A persistent WebSocket drains battery and holds a TCP socket. I mitigate by using exponential backoff on reconnect and falling back to FCM push to wake the app when the socket is closed. For the feed, I refresh when the screen opens and use a PeriodicWorkRequest (minimum interval 15 minutes) with a network constraint for background refresh, so the OS can batch it. The pitfall is using a foreground service for a task that runs once a day; on Android 15 dataSync foreground services are limited to 6 hours per 24 hours and starting them from the background is mostly blocked since Android 12.
- Senior
- I frame it as a cost function: battery cost per user-hour versus staleness tolerance. For chat, the user expects sub-second delivery, so WebSocket is justified, but I cap the connection to the active session and use FCM to re-wake. For a feed, staleness of minutes is fine: refresh on open, pull-to-refresh, and periodic WorkManager work with network and battery constraints, or a push that tells the client new content exists. I verify with Battery Historian on a test device and the Android vitals battery metrics in Play Console. If any work does need a foreground service, I declare its foregroundServiceType in the manifest, because apps targeting Android 14+ crash with MissingForegroundServiceTypeException without it.
How would you implement an infinite scroll feature in an Android app?
- Junior
- I would use a RecyclerView and detect when the user reaches the bottom of the list to trigger a new API call for more data.
- Mid
- I would use the Jetpack Paging 3 library with a RemoteMediator. This allows me to fetch data from the network and save it into a Room database, which then serves as the single source of truth for the UI.
- Senior
- I would design a system using Paging 3 and Room to ensure offline availability and data consistency. I'd use cursor-based pagination to prevent duplicates and implement a prefetch strategy to ensure the user doesn't see loading spinners during normal scrolling.
What is the difference between offset-based and cursor-based pagination?
- Junior
- Offset uses a number to skip rows, while cursor uses a specific ID to find the next set of data.
- Mid
- Offset-based pagination is prone to issues when data changes, like seeing duplicate items if a new row is inserted. Cursor-based pagination uses a pointer to a specific record, making it stable even if the underlying data changes.
- Senior
- On the client, a cursor is stable under inserts and deletes, and it is opaque, so the server can change what it encodes (an id, a score plus id for a ranked feed) without an app update. I store it in a remote-keys table in the same transaction as the page. On the server side, offset paging also gets slower deep into a list because the database must skip rows, while a cursor maps to an indexed seek. The cost is that you cannot jump to page 37, which a feed never needs.
How do you handle network errors during a pagination fetch?
- Junior
- I would show a Toast message to the user saying the connection failed.
- Mid
- I would catch the exception in the repository and use the Paging 3 LoadState to show a retry button at the bottom of the list.
- Senior
- RemoteMediator returns MediatorResult.Error for IOException and HttpException only, so cancellation still propagates. The cached feed stays on screen because Room is the source of truth; a failed refresh shows a small banner, a failed append shows a retry row at the end, and both call retry(). I would not auto-retry in a loop: the user scrolling or pulling to refresh is the natural retry, and a background refresh can use WorkManager's backoff.
How do you ensure the app doesn't crash from memory issues when scrolling a long feed?
- Junior
- I would make sure I am not loading too many high-resolution images at once.
- Mid
- I would use the Paging library which manages the lifecycle of the data and only keeps a small window of items in memory.
- Senior
- I keep items in Room, not a ViewModel list, and set PagingConfig.maxSize so Paging drops pages far from the viewport. Images usually dominate memory, so Coil or Glide loads them downsampled to the card size with a memory cache sized from the device's memory class, and cancels requests for cards that leave the screen. I check the result with the memory profiler during a long scroll on a low-RAM device.
How do you keep messages in the correct order on the client?
- Junior
- Each message gets a timestamp from the server, and the client sorts the list by that timestamp. If two messages have the same timestamp, you break the tie with a secondary field like a message ID.
- Mid
- The server assigns a monotonically increasing serverSeq to every message. The client sorts by serverSeq, not by local System.currentTimeMillis(), because device clocks drift. After a reconnect, the client requests GET /messages?afterSeq=<lastSeq> to fill any gaps before rendering.
- Senior
- I ask for a per-conversation serverSeq that increases by one, because then the client can detect gaps: if it has 41 and receives 44, it fetches afterSeq=41 before marking the conversation up to date. Pending messages have no serverSeq yet, so the Room query orders acknowledged messages by serverSeq and puts pending ones last in creation order; when the ack arrives, the row gets its seq and moves into place. Duplicates from retries or from both socket and push are dropped by a unique index on the server message id. I test it with a fake socket that delivers messages shuffled, duplicated and with gaps.
What happens when the WebSocket drops and the user sends a message?
- Junior
- The message is stored in a local database and sent again when the connection comes back. The user sees a 'sending' indicator until the server confirms.
- Mid
- The message is written to Room with state SENDING before the WebSocket send. When the socket reconnects, the connection manager resends pending rows in order. If the app is closed first, unique WorkManager work with a network constraint sends them over REST. The localId (UUID) acts as an idempotency key so the server ignores duplicate sends. The UI shows a clock icon that turns into a single check on server ack.
- Senior
- The outbox lives in Room so it survives process death, and the UI collects a Flow from that table, so bubble states update by themselves. In the foreground, retries are the connection manager's job, because they should happen within seconds of reconnecting. WorkManager is the backstop: enqueueUniqueWork with APPEND_OR_REPLACE, a network constraint and setBackoffCriteria(BackoffPolicy.EXPONENTIAL, ...); the worker checks runAttemptCount and marks rows FAILED after a cap, and the user can tap to resend. A permanent error such as 400 marks the row FAILED at once instead of retrying.
How does the client receive messages when the app is in the background?
- Junior
- The app uses push notifications. When a new message arrives, the server sends a push, and the app shows a notification to the user.
- Mid
- A background socket is not reliable: Doze blocks network access and the system can freeze or kill the process. So the app closes the socket when it goes to the background and the server sends an FCM data message. onMessageReceived stores the message or fetches everything after the last serverSeq, then posts a notification. Data messages are used instead of notification messages because a notification message to a backgrounded app is shown by the system without running app code, so the local database would be stale.
- Senior
- FCM is best-effort: messages can be delayed by Doze or app standby, collapsed, or dropped, and high priority is only for messages that show a notification, otherwise FCM may deprioritize the app. So the push is a hint and the sync after it is the truth: the client fetches after its last serverSeq, and on app open it syncs again before marking conversations up to date. onMessageReceived should finish quickly; longer work goes to WorkManager. I send the token to the server from onNewToken and on login, and I measure push-to-notification latency and missed-message rates so I know how the hint performs in practice.
How do you design the API for fetching chat history?
- Junior
- You use a REST endpoint like GET /messages?conversationId=123&page=1&size=50. The client requests the next page when the user scrolls to the bottom.
- Mid
- Offset paging breaks when messages are deleted between requests. Use cursor-based pagination: GET /messages?conversationId=123&cursor=<opaque>&limit=50, where the cursor encodes the oldest serverSeq the client has. On the client, Paging 3 with a RemoteMediator writes each page into Room, and Room's PagingSource shows it. The mediator stores the cursor in a remote-keys table so scrolling back in history resumes correctly after process death.
- Senior
- Chat needs two directions: older history is paged on demand with a beforeSeq cursor, while new messages arrive live and are written straight to Room, so the list updates without paging. In the RemoteMediator, the newest end is kept current by the socket and gap fill, and the 'load older' direction is the one that calls the API; which LoadType that is depends on how the query is sorted and whether the list uses reverseLayout. I keep the newest messages cached for instant open and let Paging's prefetchDistance load older pages before the user reaches the top. I check that a failed load returns MediatorResult.Error without touching the stored cursor.
How do you structure the data layer for an offline-first notes app?
- Junior
- I use Room for local storage and a Repository that reads from Room. The UI observes a Flow from Room so it updates when the database changes.
- Mid
- Room is the source of truth. Writes go to Room and an outbox table in one transaction, then the repository enqueues unique WorkManager work with a network constraint. The worker pushes outbox entries with idempotency keys and pulls remote changes into Room. The repository exposes a Flow from Room, and the ViewModel turns it into a StateFlow for the UI.
- Senior
- Same structure, with the server owning versions: each note stores the version it was based on, pushes send it, and stale writes come back as 409 to be merged. Pulls use a server change token instead of a client timestamp, and they never overwrite a note with pending edits. Deletes are tombstones until confirmed. Sync uses APPEND_OR_REPLACE so an edit during a running sync is never missed. I expose pending state per note from the outbox table, track outbox depth and sync delay in production, and test the worker with TestListenableWorkerBuilder and a fake API that times out after saving.
How do you handle conflicts when two devices edit the same note?
- Junior
- I compare timestamps and keep the newer version. That is last-write-wins, which works for a single-user notes app.
- Mid
- Each note carries the server version it was based on. If the server has a newer version it returns 409, the client fetches the current copy, merges, and pushes again with the new version. The merge can be field-level: a field changed on one side only takes that side's value. Idempotency keys are a separate concern; they make retries safe but do not resolve conflicts.
- Senior
- Even with one user, two devices can conflict, so I never rely on device clocks. I do a three-way merge against the base: title and body merge independently, and if the same field changed on both sides I keep the server copy and save the local text as a conflict copy the user can review, because silently losing typed text is the worst outcome for notes. True real-time co-editing of the same text is a different problem that needs CRDTs or operational transforms. I test with two simulated devices editing offline and check the result after both sync.
How do you schedule and trigger background sync on Android?
- Junior
- I use WorkManager with a OneTimeWorkRequest and set it to require network connectivity.
- Mid
- After every write I call enqueueUniqueWork with APPEND_OR_REPLACE, a NetworkType.CONNECTED constraint and setBackoffCriteria with exponential backoff. WorkManager waits for the network itself, so I do not need a connectivity listener. I also sync when the app comes to the foreground and add a periodic request (minimum 15 minutes) as a safety net.
- Senior
- The worker drains the outbox in batches until it is empty and separates transient failures (IOException, 5xx, 429: retry) from permanent ones (4xx: mark the note failed). I would not add setRequiresBatteryNotLow to user edits, because users expect them to sync. Expedited work is only for short syncs the user is waiting for, since it has a quota and supports only network and storage constraints. A foreground service is not a fix for OEM battery managers: it cannot be started from the background on Android 12+ in most cases. Instead I sync on app open and show pending badges, and the server can send an FCM message to prompt a pull.
How do you keep the UI consistent during and after a sync?
- Junior
- The UI reads from Room via Flow, so it updates automatically when the database changes after a sync completes.
- Mid
- The ViewModel combines the notes Flow from Room with the sync state from WorkManager's getWorkInfosForUniqueWorkFlow and exposes one StateFlow. Room's Flow re-emits by itself when the worker writes, so there is nothing to invalidate by hand. Notes with pending outbox rows show a small 'not synced' badge.
- Senior
- I keep sync metadata (pending rows, conflicts) separate from note content and join them in the query, so the editor never jumps when a sync finishes. A pull never overwrites a note the user is editing or has pending edits for; that note goes through the merge path instead. Lazy lists use stable keys so updates animate in place. I verify by killing the app mid-sync and checking that the outbox rows are still there and are sent on the next run.
How would you prevent an OutOfMemoryError when loading many images?
- Junior
- I would make sure I am not loading images that are too large and I would use a cache so I don't load them twice.
- Mid
- I would implement an LruCache for memory and use BitmapFactory.Options.inSampleSize to downsample the image to the target dimensions before it enters the heap.
- Senior
- Decode at view size (inJustDecodeBounds then inSampleSize, or ImageDecoder with a target size), use RGB_565 or hardware bitmaps where quality and usage allow, and keep a byte-sized LRU memory cache from the device's memory class, trimmed in onTrimMemory. Since Android 8.0 bitmap pixels live in native memory, so I watch total memory in the profiler, not just the Java heap. Requests are cancelled when views detach, so leaked screens do not keep bitmaps alive. In a real app I would configure Coil or Glide this way rather than write my own.
What happens if a user scrolls very fast through a list of images?
- Junior
- Loads for rows that scrolled off screen should be cancelled, so they do not waste bandwidth or show up in the wrong row.
- Mid
- We need to cancel the image loading tasks for the views that have been recycled so we don't waste resources on images no longer visible.
- Senior
- Cancel requests tied to recycled views, but let a download that is almost done finish into the disk cache, since the user may scroll back. Deduplicate in-flight requests by key, and limit concurrent network and decode work so on-screen images are not stuck behind ones that already scrolled away. Prefetch the next few rows at their real size, and use placeholders with a fixed size so the layout does not jump.
How do you decide the size of your memory cache?
- Junior
- Not as a fixed number of megabytes, because devices have very different memory. I would use a fraction of the memory the app is allowed to use.
- Mid
- I would use a percentage of the available memory provided by the system, like a fraction of the max heap size.
- Senior
- I size it in bytes as a fraction of ActivityManager.getMemoryClass() (the per-app heap budget in MB), with a smaller fraction on low-RAM devices; Coil and Glide both size their defaults from the device's memory. The disk cache is sized separately from free storage. I trim the memory cache in onTrimMemory and measure hit rate and memory in the profiler on a low-end device, instead of guessing.
How would you handle a situation where the same image URL is requested multiple times at once?
- Junior
- The second request should wait for the first one to finish instead of downloading the same image again.
- Mid
- That would be inefficient. I would check if a request for that URL is already in progress and if so, wait for that one to finish.
- Senior
- Keep a map from cache key to the in-flight Deferred, guarded so only one load starts per key, and let later callers await it. Cancellation needs reference counting: one caller leaving should not cancel the load for the others, but the load is cancelled when nobody waits any more. Network bytes can be shared by URL even when decode sizes differ, so the disk layer deduplicates by URL and the memory layer by URL plus size.
How do you make a file upload survive a process kill?
- Junior
- Run it in WorkManager instead of an Activity or a plain coroutine. WorkManager saves the request and its input data, so if the process dies it runs the worker again later. The input holds the file path and the upload id.
- Mid
- WorkManager reruns the worker with the same input after process death or a retry, so the worker must find out where to continue. With a resumable protocol like tus, it asks the server for the current offset with a HEAD request and streams the file from there. I add a network constraint, exponential backoff, and unique work per file with KEEP so a second tap does not start a second upload.
- Senior
- The server is the source of truth for progress, because a chunk can arrive even when its response is lost; setProgress is not carried to the next attempt anyway. The upload row lives in Room (file copy in app storage, session URL, state), and the worker handles the edge cases: file deleted means failure, session expired means create a new one, 4xx means stop, IOException, 5xx and 429 mean retry, with a cap on runAttemptCount. I test it with TestListenableWorkerBuilder and a fake server that drops the connection, and on a device by killing the process mid-upload with adb shell am kill and checking it continues from the server's offset.
What are the Android 14 and 15 foreground service rules for a long upload?
- Junior
- On Android 14 a foreground service needs a type. For uploads the type is dataSync, and the app needs the FOREGROUND_SERVICE_DATA_SYNC permission as well as FOREGROUND_SERVICE.
- Mid
- With WorkManager I call setForeground with a ForegroundInfo that names FOREGROUND_SERVICE_TYPE_DATA_SYNC, and declare android:foregroundServiceType="dataSync" on WorkManager's SystemForegroundService in the manifest with tools:node="merge". Without the type, apps targeting 34 get a MissingForegroundServiceTypeException. Since Android 12, apps mostly cannot start foreground services from the background, so the best moment is right after the user starts the upload.
- Senior
- On Android 15, dataSync is limited to 6 hours in a 24-hour period, after which the system calls onTimeout and the work must stop, so a large upload has to be resumable. Google Play also asks you to declare and justify each foreground service type. For transfers the user explicitly starts, Android 14 added user-initiated data transfer jobs, which are meant for exactly this. I would test on Android 14 and 15 with the app backgrounded and with notifications denied, since on Android 13+ the work still runs but the notification is hidden from the drawer.
How do you report upload progress to the user?
- Junior
- Show a notification with NotificationCompat.Builder.setProgress(max, current, false) and update it as chunks finish. The screen can show the same progress.
- Mid
- The worker calls setProgress with a percentage, and the screen observes it through WorkManager's WorkInfo flow. For the notification, the worker calls setForeground again with an updated ForegroundInfo. The channel uses IMPORTANCE_LOW and the builder uses setOnlyAlertOnce(true), so updates do not make a sound, and there is a cancel action from createCancelPendingIntent.
- Senior
- I update only when the whole percentage changes, because the system rate-limits notification updates and frequent updates cost battery. If the total size is unknown I use an indeterminate bar with setProgress(0, 0, true). After success or failure I post a separate notification with the result, since the foreground notification goes away with the work. Progress in the UI is display only; the next attempt asks the server for the real offset.
When do you use a single multipart POST versus a chunked resumable upload?
- Junior
- For small files a single multipart POST is simpler. For large files, a resumable upload means a network drop does not force starting over.
- Mid
- It depends on file size and network. A single POST must be resent completely after any failure, which is fine for a small photo but painful for a large video on a mobile network. A resumable upload adds a create call, offset checks, and a finish step, but each failure costs at most one chunk, and progress comes naturally.
- Senior
- It is a trade-off between server complexity and client resilience. I look at the real distribution of upload sizes and failure rates in analytics before choosing a threshold, and prefer an existing protocol (tus, the storage provider's resumable or multipart API) over a custom one. Chunk size has its own trade-off: bigger chunks mean fewer requests, smaller chunks mean less lost work per failure, and providers set limits, such as S3's 5 MiB minimum part size or GCS's 256 KiB multiples. Uploading straight to storage with a pre-signed URL keeps large files off the API servers.
Large codebases
What is the difference between the build cache and the configuration cache?
- Junior
- The build cache stores task results so they do not have to run again. The configuration cache lets Gradle skip the configuration phase.
- Mid
- The build cache stores task outputs, like compiled classes, keyed by a hash of the task inputs, and can share them across branches and machines. The configuration cache stores the task graph produced by the configuration phase, so an unchanged build skips running build scripts and plugins.
- Senior
- They save different phases. The build cache saves execution time and only works for cacheable tasks with correctly declared inputs and outputs; a remote cache fed by CI multiplies the benefit across the team. The configuration cache saves configuration time, which matters most in builds with many modules, and it requires build logic that does not touch the live Project model at execution time and declares the files and environment it reads at configuration time. I turn both on, then use Build Scans to find cache misses and configuration cache problems.
How do you optimize a slow Android build?
- Junior
- I would enable the Gradle build cache and use KSP instead of kapt.
- Mid
- I would measure first with the Build Analyzer or a Build Scan, then enable the build cache, the configuration cache and parallel execution, and migrate annotation processors from kapt to KSP.
- Senior
- I split the problem by phase. For configuration time I look for eager task creation, IO in build scripts and plugins that are not configuration-cache compatible. For execution time I look at the critical path and the cache hit rate: uncacheable tasks, volatile inputs, absolute paths, and kapt. Then structural fixes: convention plugins in build-logic, implementation instead of api, non-transitive R classes and a wider module graph so parallel execution helps. I compare scans before and after each change instead of trusting a single number.
What is task configuration avoidance?
- Junior
- It is a way to make Gradle faster by not creating tasks until they are needed.
- Mid
- It means using lazy APIs such as tasks.register and tasks.named instead of tasks.create and tasks.getByName, so a task is only created and configured when it is actually needed.
- Senior
- Gradle registers tasks as providers and only realizes them when something needs them, such as the task graph or another task's dependency. In a large build that saves time and memory in every invocation. The lazy approach only works if all build logic stays lazy: one eager call such as tasks.all or tasks.getByName in a convention plugin can realize every task. Build Scans show how many tasks were created versus executed.
Why is kapt slower than KSP?
- Junior
- KSP is a newer tool designed specifically for Kotlin.
- Mid
- kapt has to generate Java stubs for Kotlin classes so Java annotation processors can read them, and that stub generation is expensive.
- Senior
- kapt reuses the Java annotation processing API, so it first runs part of the Kotlin compiler to generate Java stubs, then runs javac processors on them. KSP gives processors a Kotlin symbol API directly, so there is no stub step, and it understands Kotlin features like nullability. The migration is per processor: switch Room, Hilt and Moshi to their KSP artifacts, and once no kapt processors remain, remove the kapt plugin so the stub task disappears.
Why should a large Android project use build-logic instead of buildSrc for convention plugins?
- Junior
- build-logic is an included build that Gradle builds like a normal project. Gradle recommends it for convention plugins, and Now in Android uses it.
- Mid
- Gradle's docs say any change in buildSrc makes the entire build out of date. With an included build, a change only affects projects that use the changed build-logic subproject. It is also a full build you can open on its own, split into subprojects and test.
- Senior
- Both approaches put compiled plugins on the build script classpath, so in a small build the difference is small. In a large build the invalidation scope matters: editing one convention plugin should not invalidate every module. I keep the plugins small, register them with gradlePlugin, compile against AGP and KGP as compileOnly, and let the root build own plugin versions through the catalog. I check the effect with Build Scans after a build-logic change.
How does the version catalog work, and what are its four sections?
- Junior
- It is a TOML file at gradle/libs.versions.toml with versions, libraries, bundles and plugins sections. Build files reference entries through libs, for example libs.androidx.core.ktx.
- Mid
- [versions] holds named versions. [libraries] maps an alias to group and name plus a version or version.ref. [bundles] groups library aliases so you add them in one line. [plugins] holds plugin IDs and versions for alias(...) in the plugins block. Dashes in aliases become dots in the generated accessors.
- Senior
- The catalog only declares coordinates; it does not force versions on transitive dependencies. For alignment I add BOMs as platform dependencies and let Gradle's conflict resolution pick the highest version, checking it with ./gradlew :module:dependencies or dependencyInsight. Convention plugins read the catalog with VersionCatalogsExtension because generated accessors only exist for build scripts. The included build gets the same TOML through versionCatalogs in its settings file. Tools like Renovate or Dependabot can update the TOML in one pull request.
What goes into a convention plugin, and what stays in the module's build file?
- Junior
- Shared setup like compileSdk, minSdk, the JVM target and common dependencies goes into the plugin. The module keeps its namespace and its own dependencies.
- Mid
- I make one plugin per kind of module: application, library, Compose, Hilt, feature. A feature module applies the feature plugin, which can apply the library, Compose and Hilt plugins. The module file keeps its namespace and the dependencies only that module needs.
- Senior
- Convention plugins encode team decisions: SDK levels, Java and Kotlin targets, lint and test setup, and the standard dependencies of a feature module. I keep them composable and avoid hidden heavy work like applying kapt or Compose everywhere, because that costs build time in modules that do not need it. Changes to a plugin affect many modules, so they get the same review as shared library code, and I test them on a sample module or with Gradle TestKit.
How do you keep transitive dependency versions aligned across 50 modules?
- Junior
- Every module uses the version catalog instead of writing version strings, so changing a version in the TOML file updates all modules.
- Mid
- The catalog covers direct dependencies. For groups like Compose or OkHttp I add the BOM with platform(...) so all artifacts in the group share one version. I check the result with ./gradlew :app:dependencies.
- Senior
- Gradle resolves one version per module per configuration, choosing the highest requested by default. I use BOMs for groups that publish one, and dependency constraints in a convention plugin for others. I avoid resolutionStrategy.force because it silently downgrades. In CI I can use dependency locking or diff the resolved release classpath, so an unexpected version change shows up in review instead of in a crash.
How do you keep a Kotlin module's public API small?
- Junior
- Mark implementation classes internal and expose only interfaces, data classes or factory functions.
- Mid
- I enable explicit API mode with kotlin { explicitApi() }, so every public declaration must be marked public on purpose. I keep implementations internal and bind them with DI inside the module, and I use implementation instead of api for dependencies that do not appear in public signatures.
- Senior
- I combine design and tooling. For big boundaries I split an api module with interfaces and models from an impl module that only the app module depends on. Inside modules I use explicit API mode and keep the ABI dump in the repo with binary-compatibility-validator or Kotlin's built-in ABI validation, so every public change is a reviewable diff. Breaking changes go through deprecation with ReplaceWith instead of a single removal.
What is the difference between api and implementation dependencies in Gradle?
- Junior
- api exposes the dependency to modules that depend on yours; implementation hides it. Use implementation by default.
- Mid
- api puts the dependency on consumers' compile classpath, so they can use its types. implementation keeps it only on their runtime classpath. Use api only when your public signatures use that dependency's types.
- Senior
- Both are packaged in the APK, so the choice is about compile-time coupling and build speed. With implementation, a change in the dependency does not force consumers to recompile, and consumers cannot start depending on it by accident. Overusing api makes the compile classpath of every module large. I audit it with the releaseCompileClasspath dependencies report, and for every api entry I check that a public signature actually uses that library.
How does Kotlin's internal visibility work at the JVM level?
- Junior
- internal means visible only inside the same Gradle module. Other modules cannot use it.
- Mid
- The JVM has no module-level visibility, so the Kotlin compiler enforces internal itself. In bytecode internal declarations are public, and internal functions and properties get mangled names so they are hard to call from Java by accident.
- Senior
- Because internal is public in bytecode, Java code and reflection can still call it, so it is a compile-time boundary, not a security one. Test source sets in the same module can see internal declarations, which is why tests rarely need a class to be public. If Java code really needs a member, I make it public on purpose rather than relying on mangled names, which are an implementation detail.
How do you make a breaking change to a module that many teams use?
- Junior
- Tell the other teams and update all callers in the same pull request.
- Mid
- Add the new API next to the old one, mark the old one @Deprecated with a message and ReplaceWith, migrate callers in separate pull requests, then remove the old API.
- Senior
- I make the change additive first and deprecate the old API with ReplaceWith so the IDE can fix most call sites. I raise the deprecation level from WARNING to ERROR once callers are migrated, then delete it. The ABI dump shows exactly what changed in review. For behaviour changes, not just signature changes, I put the new path behind a feature flag so it can be rolled back. The tech-debt lesson covers running this across a whole codebase.
How would you migrate 200 XML screens to Jetpack Compose without stopping feature work?
- Junior
- Convert one screen at a time, starting with simple ones, and put each new screen behind a feature flag so it can be rolled back.
- Mid
- Use the strangler pattern: put each screen behind a seam, build the Compose version, host it in a ComposeView or a new navigation destination, and switch with a remote flag. Build shared design-system components first, and require new screens to be written in Compose.
- Senior
- I start with the design system and a rule that new screens are Compose only, enforced by a Lint check in migrated modules. Then I migrate by feature area, prioritising screens that change often or cause bugs, because that is where the debt costs most. Each screen ships behind a remote flag with crash and performance metrics compared between old and new. Progress is a visible count of remaining XML screens, and old layouts, Fragments and flags are deleted once a screen has been stable at 100 percent.
How do you stop code from going back to a deprecated API?
- Junior
- Mark the old API with @Deprecated so the IDE shows a warning.
- Mid
- Use @Deprecated with a message and ReplaceWith so every call site gets a quick fix, then raise the level to ERROR once callers are migrated. For APIs we do not own, write a custom Lint check.
- Senior
- Three layers. @Deprecated with ReplaceWith on our own APIs, raised to ERROR and then removed. Custom Lint detectors with Severity.ERROR for third-party or platform APIs, scoped to migrated modules, with a lint baseline so the rule applies to new code from day one. Lint runs on every pull request in CI, and the baseline is only allowed to shrink. I check the setup by adding a banned call on a branch and confirming CI fails.
What is the strangler pattern, and when would you not use it?
- Junior
- You replace old code gradually: wrap it behind an interface, add new code behind the same interface and switch with a flag.
- Mid
- You put a seam in front of the legacy code, grow the new implementation behind it and move traffic over with a flag, then delete the old code. The risk is leaving both paths alive too long.
- Senior
- It needs a seam where old and new can be swapped, such as a repository interface, a screen entry point or a navigation route. If no seam exists, the first step is creating one, often with characterisation tests around the old behaviour. I would not use flags and dual paths for purely mechanical changes like a package rename or a library upgrade with a migration tool; a codemod in one reviewed change is simpler. And for a small, well-tested module, rewriting it in one go can be cheaper than running two paths.
How do you decide which tech debt to pay down first?
- Junior
- Fix the debt that causes the most bugs or complaints from the team.
- Mid
- I look at where debt slows us down: code that changes often and causes bugs, slow builds, or flaky tests. I estimate the cost and pick items with the best payoff, and I keep debt in the same backlog as features.
- Senior
- I make debt visible with data: change frequency and bug counts per module, build-time reports, flaky test rates and how long common changes take. Debt in code that rarely changes can wait; debt in hot paths gets priority. I tie each item to a product or team outcome, reserve a steady share of capacity rather than waiting for a cleanup quarter, and track a measurable end state, such as zero remaining usages, so the work actually finishes.
Observability
How do you handle logging in a production Android app?
- Junior
- I use Timber instead of Log directly. In debug builds I plant DebugTree so logs go to Logcat, and in release I do not log personal data. Crashes go to Crashlytics.
- Mid
- I plant DebugTree only in debug. In release I plant a custom Timber Tree that drops DEBUG and VERBOSE and forwards INFO and above to Crashlytics logs, and records exceptions at ERROR as non-fatals. Events use a fixed name plus keys, and I add context with setCustomKey, such as the current screen. No PII goes into any of it.
- Senior
- I treat logs as one part of observability. Logs give context for a specific failure, metrics drive alerts per app version, and traces explain latency. Logging is non-blocking and sampled for noisy events, the release tree scrubs as a safety net, and collection respects user consent. I also make sure log volume and cardinality are budgeted, because an unbounded logger costs battery, data and money, and nobody reads the noise.
What is the difference between a log, a metric and a trace?
- Junior
- A log is a message about one event, a metric is a number like an error count, and a trace shows how long an operation took.
- Mid
- Logs are discrete events with context, used to debug a specific case. Metrics are numbers aggregated over many events, used for dashboards and alerts. Traces measure the duration of one operation and can be split into spans, so you can see which step took the time.
- Senior
- Logs answer what happened in one case, metrics answer how often and how much across the user base, and traces answer where time went. In practice I alert on a metric, such as crash-free users or P95 load time for a release, then use traces and logs from affected sessions to explain it. To follow a request into the backend I propagate a trace ID in a header, for example with OpenTelemetry and the W3C traceparent header, so client and server spans join into one trace.
Users say the app is slow for some of them. How do you investigate?
- Junior
- I try to reproduce it on a device and look at Logcat and the profiler for slow work.
- Mid
- I check Android vitals for ANRs and slow rendering on that release, and Firebase Performance for the app start trace, screen traces and network latency. Then I compare the slow segment, such as a device model, Android version or country, with the rest.
- Senior
- First I find the segment, because 'some users' is the key word: release, device tier, OS version, network type. Then I check whether the time is in the network, on the main thread or in background work by splitting the flow into custom traces. Percentiles matter more than averages here. Once I have a hypothesis I reproduce it locally with a Perfetto trace or a Macrobenchmark on a low-end device, fix it, and confirm with the production traces of the next release.
Why must you keep PII out of mobile logs and telemetry?
- Junior
- It is bad for user privacy and can be a security risk if someone reads the logs.
- Mid
- Privacy laws such as GDPR restrict collecting personal data without a purpose and consent, and logs are often readable by many people and kept for a long time. A leaked token can also be used to take over an account.
- Senior
- Log pipelines are usually treated less carefully than databases: wide access, long retention, third-party processors and copies in exports. Once PII lands there you inherit deletion requests and breach exposure across all of it. So I prevent it at the source with typed event APIs that only accept safe fields, a scrubber in the release tree as a backstop, tests that push known secrets through it, and consent checks before collection starts.
How do you know whether a new release performs worse in production?
- Junior
- I check Android vitals in Play Console for crash and ANR rates of the new version, and Crashlytics for new crashes.
- Mid
- During a staged rollout I compare the new version with the previous one: user-perceived crash and ANR rates in Android vitals, and in Firebase Performance the app start trace, key screen traces and network latency. I look at percentiles, not averages, and at device segments.
- Senior
- I define the few metrics that matter per release before shipping: crash-free users, ANR rate, P95 TTID and TTFD, P95 of the main flows, janky frame share on key screens. Each has a baseline from the previous version and an alert on a relative regression once there is enough data. I segment by device tier and OS, because regressions often hit only low-RAM devices. A regression stops the rollout from increasing, and ApplicationExitInfo, ANR traces and custom traces explain it.
What is the difference between a crash and an ANR?
- Junior
- A crash is when the app closes because of an error. An ANR is when the app freezes and Android shows the 'app isn't responding' dialog.
- Mid
- A crash is an uncaught exception or native signal that ends the process. An ANR happens when the main thread cannot respond in time, for example to an input event within 5 seconds, or when a broadcast receiver or service takes too long.
- Senior
- They need different evidence. A crash has a stack trace of the throwing thread. An ANR needs the state of all threads at the moment of the dump, because the main thread is often waiting on a lock, binder call or I/O held elsewhere. Android vitals reports both per daily active user against separate thresholds, and on Android 11+ ApplicationExitInfo gives REASON_ANR records with the ANR trace on the next launch.
Why monitor P95 latency instead of the average?
- Junior
- Because the average can hide users who have a very slow experience.
- Mid
- A few very slow sessions and many fast ones give an average that describes nobody. P95 means 95% of measurements are at or below that value, so it shows the slow tail directly.
- Senior
- Mobile performance has a long tail: slow networks, cold caches, old devices. A release can improve the median and make the tail worse at the same time, and the average may barely move. I track P50 for the typical user and P95 or P90 for the tail per release, I make sure there are enough samples before trusting a high percentile, and I segment by device tier so a regression on cheap phones is not averaged away.
How would you investigate a rise in memory-related exits?
- Junior
- I would look in Crashlytics for OutOfMemoryError crashes and check what changed in that release.
- Mid
- OutOfMemoryError in the heap is a crash with a stack trace. Low-memory kills by the system are not crashes, so I read ApplicationExitInfo for REASON_LOW_MEMORY records on the next launch and report them. Then I check recent changes in bitmaps, caches and lists.
- Senior
- I separate the two signals. OutOfMemoryError crashes point to heap use inside the app; I check for leaks with LeakCanary and heap dumps, and for bitmap sizes. Low-memory kills depend on the device and on our footprint in the background, and REASON_LOW_MEMORY is only reported where isLowMemoryKillReportSupported() is true. I also watch the memory core vitals in Play Console per version and device RAM tier, then reproduce on a low-RAM device with the memory profiler.
How do you decide whether to halt a staged rollout?
- Junior
- I compare the new version's crash and ANR rates with the previous version. If the new one is clearly worse, I halt the rollout and investigate.
- Mid
- I compare rates, not counts, for the new version against the previous one in Crashlytics and Android vitals, once there are enough sessions. Crashlytics velocity alerts catch a single issue spreading fast. If the crash or ANR rate regresses beyond the margin we agreed, or nears our SLO ceilings, we halt and ship a fix with a higher versionCode.
- Senior
- The decision is encoded before the release: which metrics (crash-free sessions, ANR rate, key performance traces, core vitals), the minimum sample, the allowed relative regression and the absolute SLO ceilings. A scheduled job evaluates the gate at each step and halts through the Play Developer Publishing API, then pages on-call, so reaction time does not depend on someone watching. 'Not enough data' means hold, not continue. I also keep feature flags for risky features, because halting does not help users who already updated.
What is ApplicationExitInfo and when would you use it?
- Junior
- It is an Android 11+ API that tells you why the app's process ended last time, for example a crash, an ANR or a low-memory kill.
- Mid
- You call ActivityManager.getHistoricalProcessExitReasons(packageName, 0, maxNum) on the next launch, off the main thread. Each record has a reason, timestamp, importance, description, and for ANRs a trace via getTraceInputStream(). It covers exits that never produce a crash report, such as low-memory kills.
- Senior
- I read it at startup in the background, keep the newest timestamp already reported so records are not sent twice, and upload reasons per version to our backend. That gives a per-release breakdown of crash, native crash, ANR and low-memory exits next to Crashlytics. A rise in REASON_LOW_MEMORY for a version points to a bigger memory footprint even with no crash spike. I note that low-memory kill reporting depends on isLowMemoryKillReportSupported().
How do you set up alerting for a new release?
- Junior
- I turn on Crashlytics alerts and check the Crashlytics and Play Console dashboards after each release.
- Mid
- I enable Crashlytics alerts for new fatal issues, regressed issues and velocity, sent to Slack or PagerDuty. I build a dashboard per version with crash-free sessions, ANR rate and key performance traces, and I check Android vitals for the core vitals during the staged rollout.
- Senior
- I set SLOs per release, for example crash-free sessions and ANR-free sessions over 7 days, and alert on error-budget burn rate in a short and a long window, so we page early without alert fatigue. Velocity alerts catch single issues. The rollout gate compares the version's rates with the previous version and halts automatically. Weekly I review Android vitals for core vitals such as excessive partial wake locks, which never show up as crashes. I test the whole chain with a deliberately broken build on an internal track.
What is the difference between a crash-rate alert and a Crashlytics velocity alert?
- Junior
- A crash-rate alert looks at all crashes together. A velocity alert fires when one specific crash suddenly affects a lot of users.
- Mid
- A crash-rate alert watches the overall crash-free rate of a version, which catches broad degradation. A velocity alert is per issue: it fires when one crash or ANR type affects more than a set share of a version's sessions, plus a minimum number of users, within 30 minutes.
- Senior
- They answer different questions, so I run both. Velocity alerts are fast and specific: one new issue spreading in the current version, even when the overall rate still looks acceptable. The version-level rate, compared with the previous release and the SLO, catches many small issues adding up and feeds the rollout gate. I tune the velocity percentage and minimum users to our traffic so small rollouts do not page on two crashes, and I add burn-rate alerts on the SLO for slower regressions.
Leadership
How do you structure a code review for an Android/Kotlin PR?
- Junior
- I read the diff top to bottom, check for obvious bugs, and leave comments. I try to be kind and suggest fixes instead of just saying something is wrong.
- Mid
- I separate blocking issues from nits with tags like blocking: and nit:. I run ktlint and detekt locally first so I do not waste time on style. I explain the why behind each blocking comment so the author learns the rule.
- Senior
- I start with the PR description and ask whether the change is small and focused enough to review well; if not, I ask for a split before reading line by line. Then I review design first (does this belong in the ViewModel or the repository?), then correctness: remember keys, LaunchedEffect vs DisposableEffect, lifecycle-aware collection, cancellation not swallowed. I leave style to CI. Following Google's guide, I approve once the change improves the code health of the codebase even if it is not how I would have written it, and I add a praise comment for patterns I want the team to copy.
What do you do when a reviewer and an author disagree on a design choice?
- Junior
- I try to explain my point of view and listen to theirs. If we still disagree, I ask a third person to look.
- Mid
- I restate the trade-off: what we gain, what we lose, and how reversible the choice is. If it is a small, reversible change, I let the author decide. If it is a large, hard-to-reverse change, I escalate to a short design discussion.
- Senior
- I frame it as a reversible vs. irreversible decision. For reversible choices (a naming convention, a small UI tweak) I defer to the author. For irreversible ones (a new Repository contract, a migration path) I ask for a short ADR or a pairing session. I also check whether the disagreement is really about the code or about an unspoken assumption, and I surface that assumption explicitly.
How do you make code reviews faster without lowering quality?
- Junior
- I try to review PRs the same day they are opened so they do not sit. I also ask the author to add a short description of what changed and why.
- Mid
- I push style checks to CI with ktlint and detekt so I do not comment on formatting. I ask authors to keep PRs small and focused. I use a PR checklist so the author answers common questions before I open the diff.
- Senior
- I look at where reviews actually stall. If the same nits keep repeating, I turn them into a detekt or ktlint rule or a short convention doc. If PRs wait days for a first response, we agree a team norm for first-response time. For a complex change I ask for a short design note or pair on the first draft, so the review is a confirmation, not a request to rewrite. I watch these trends loosely; turning comment counts into a target just makes people stop commenting.
Give an example of a review comment that teaches versus one that does not.
- Junior
- A teaching comment says 'use viewModelScope here' with a reason. A non-teaching comment just says 'change this.'
- Mid
- A teaching comment explains the mechanism: 'use viewModelScope because it cancels with the ViewModel lifecycle, so the coroutine stops when the screen is destroyed.' A non-teaching comment is 'use viewModelScope' with no context. The author of the second comment has to guess the reason.
- Senior
- I also link to the team's convention doc or the relevant Jetpack documentation so the author can find the rule themselves next time. I tag the comment blocking: or nit: so the author knows the priority. In a real codebase I verify the fix by searching for other call sites with the same pattern, so the teaching extends beyond one line.
How do you document architectural decisions in a team?
- Junior
- I write a short document in the repo describing what we decided and why, including the problem we were solving and the alternatives we looked at, so other developers can find it later.
- Mid
- I use Architecture Decision Records in Michael Nygard's format: Title, Status, Context, Decision and Consequences, one numbered Markdown file per decision in docs/adr. I link each ADR from the PR that implements it. When a decision changes, I write a new ADR and mark the old one Superseded instead of rewriting it.
- Senior
- I match the format to the decision. Local, reversible choices get a short ADR, often opened as a Proposed ADR in a PR so the discussion happens in review. Large or hard-to-reverse changes, like moving the app from Fragments to Navigation Compose, get a design doc first, and the outcome is recorded in ADRs. I keep the bar low enough that people actually write them: a PR template line for a related ADR, the ADR folder in onboarding, and Consequences that say when to revisit the decision.
What is the difference between a design doc and an ADR?
- Junior
- A design doc is longer and covers a big feature before it is built. An ADR is short and records one decision. Both explain what we chose and why.
- Mid
- A design doc covers a large or multi-module change, such as migrating the app from XML to Compose. It includes goals, non-goals, the design, alternatives, rollout and testing. An ADR is one or two pages, records one decision with its context and consequences, and is kept forever, even after it is superseded.
- Senior
- They serve different moments. A design doc is a tool for getting feedback before committing to something expensive, so it explores alternatives and risks in depth. An ADR is the durable record of what was decided and why, which future engineers read. Blast radius and reversibility decide how much writing a decision deserves: a one-way-door change across modules deserves a design doc, while a two-way door inside one module needs only an ADR or a good PR description. One design doc often produces several ADRs.
How do you handle a disagreement about a technical choice, like Compose versus Views for a new feature?
- Junior
- I try to understand both sides, write down the pros and cons, and ask the tech lead to make the final call. Then I record the decision so we do not argue about it again.
- Mid
- I write a Proposed ADR that lays out the context and the options with their trade-offs, then we discuss it in the PR. Seeing the trade-offs written down keeps the discussion concrete. If the choice is easy to reverse, I note how we would undo it, which lowers the stakes.
- Senior
- I separate the decision from the people. The Proposed ADR states the context neutrally, which often reveals that the disagreement is about an unstated constraint such as team experience, build time or a release deadline. For a reversible choice I propose a time-boxed trial on one screen with a clear exit criterion. For an irreversible one I involve the people who will live with it and make sure the Consequences section names the costs we accept. Once accepted, the ADR is the reference until new information justifies a superseding one.
How do you keep design docs and ADRs from becoming stale?
- Junior
- I check whether the related ADR is still true when I change the code, and I tell the team if it is not.
- Mid
- ADRs are records of a decision at a point in time, so they do not need updating; when a decision changes, I write a new ADR and mark the old one Superseded. That keeps the index accurate. Design docs are different: once the work ships, I mark them as implemented or archived so nobody treats an old proposal as current.
- Senior
- I make staleness visible rather than trying to prevent it. Every ADR's status is current (Accepted, Deprecated or Superseded with a link), and Consequences include a 'revisit if' condition, for example 'revisit if Navigation Compose cannot handle partner deep links.' PR authors are asked whether a change contradicts an existing ADR, which is when a superseding ADR gets written. I also keep the index short and readable, because a folder no one can scan is as good as no folder.
How do you estimate a task you have never done before in an Android project?
- Junior
- I break the task into smaller pieces I do understand, estimate each piece, and tell my lead the estimate is rough. I update it after the first piece is done.
- Mid
- I break the task into sub-tasks of a day or two, give each an optimistic, likely and pessimistic value, and add up the expected values. I list what I do not know and turn the biggest unknown into a time-boxed spike. For a Room migration that renames a column, I would spike the backfill on a copy of a large database before committing to a number.
- Senior
- Beyond the breakdown, I make the uncertainty useful to the people planning around it. I give a range, name the sub-task that drives most of the spread, and offer options: a spike to narrow it, or a smaller scope that removes the risky part. I re-estimate as soon as the spike lands and tell the PM early if the range moves. Over time I compare estimates with actuals per type of work, because teams usually underestimate the same things, such as migrations, deep links and release testing.
Walk me through how you decide between two technical options for an Android app.
- Junior
- I list the pros and cons of each option and ask a teammate for a second opinion before choosing.
- Mid
- I build a small trade-off table with at least two options, their pros, cons and whether they are easy to reverse. A cheap-to-reverse choice, like a library used in one screen, I decide quickly. An expensive one, like the database or navigation approach, I take to the team and document. If a short spike would change the answer, I run it first.
- Senior
- I start by asking what being wrong would cost and whether the decision can wait. If it is a two-way door, I pick the option that unblocks work and move on. If it is a one-way door, I write the context and options down, involve the people who will maintain the result, and look for ways to make it more reversible, such as keeping screens independent of the navigation library or putting a repository in front of a new data source. I record the decision with the conditions under which we would revisit it.
Tell me about a time your estimate was wrong. What did you do?
- Junior
- I underestimated a feature because I did not include testing time. I told my lead as soon as I noticed and we moved one smaller task out of the sprint. Now I add testing as its own item.
- Mid
- I estimated a Compose migration from simple screens, but two screens had custom Views that were hard to host with AndroidView. I raised it as soon as I hit the problem, ran a one-day spike, and re-estimated the remaining screens one by one with ranges.
- Senior
- The real mistake was giving one number without naming the unknowns, so the PM planned a release around it. I raised the slip early, explained the cause and offered two options: keep the scope with a new range, or ship the simple screens first and move the custom-view screens to the next release. Afterwards I changed how I estimate: ranges, an explicit risk list, and a spike for anything we have not done before. I also shared what happened with the team so the next migration estimate started from it.
How do you make a technical decision when you do not have all the information?
- Junior
- I make the best choice I can, note what I am unsure about, and ask a senior engineer to check my reasoning.
- Mid
- I separate what I know from what I do not. If a short spike can answer the key question, I run it. If the decision is cheap to reverse, I decide now and revisit after the spike. If it is expensive to reverse, I wait for the spike before committing. I write down the context and options either way.
- Senior
- I weigh the cost of waiting against the cost of being wrong. For a reversible choice I decide now, state the assumption and set a check point. For an irreversible one I find the smallest experiment that would change my mind and run it first, and I tell stakeholders what we are waiting for and when. I frame the decision as a bet with explicit assumptions, record it in an ADR, and revisit it when an assumption turns out false rather than when someone simply dislikes it.
How do you onboard a new Android developer to your codebase?
- Junior
- I help them get the project building, walk them through the module structure and the README, and make sure they know they can ask me anything.
- Mid
- I pair with them for the first week on a small bug fix so they learn the build system, the Compose preview workflow, and the Hilt DI graph by doing, not reading. I set a 30-day check-in with a concrete milestone like owning one feature end-to-end.
- Senior
- I agree a 90-day plan with them and their manager, with named modules and check-ins at roughly 14, 30, 60 and 90 days. The first task is a small fix with an early check-in; the second is a feature with a short design review before coding; the third is ownership of a module, including a small ADR. I make 'stuck for two hours, ask someone' an explicit team norm and model it myself. I judge progress by what they can do alone: are they asking sharper questions, reviewing others' PRs, and needing fewer review rounds over the 90 days?
Tell me about a time you mentored someone who was struggling with a technical concept.
- Junior
- I explained the concept again in a different way, with a small example from our code, and checked whether it made sense to them.
- Mid
- I paired with them on a real task that used the concept, so they learned by doing. For example, if they struggled with Flow in a ViewModel, I paired on a feature that collected a Flow and emitted state to a Compose screen. I asked them to explain each step back to me.
- Senior
- I first checked whether the struggle was the concept or the confidence. If it was confidence, I paired on a small task and let them drive. If it was the concept, I found the smallest real example in our codebase and walked through it together. I then set a 30-day milestone: they present the concept to the team in a 15-minute talk. I also made sure the team knew they were learning, so no one would judge them for asking questions. I verified progress by watching their PRs: were they asking 'why' in comments, or just accepting the code?
How do you balance shipping features with growing your team?
- Junior
- I try to answer teammates' questions quickly and explain my code in PR descriptions, so people learn from the work we are already doing.
- Mid
- I make mentoring visible in planning: pairing sessions and review time are part of the estimate, not squeezed in afterwards. I use estimation with ranges so the team does not overcommit and drop the mentoring time first.
- Senior
- I treat growing people as part of delivery. I plan explicit time for pairing with each junior and say so in planning, and I pick tasks for them on the critical path only when there is slack to absorb a slower first attempt. Growth plans make the payoff concrete: if a junior owns a module by day 60, I stop being the bottleneck for it. The trade-off is a slower first feature for faster later ones and less dependence on me, and I check it by watching whether work in that area still waits on me a quarter later.
A junior developer disagrees with your technical approach. What do you do?
- Junior
- I listen to their reasoning, explain mine, and if we still disagree we ask a more senior engineer to weigh in.
- Mid
- I ask them to explain their reasoning first. If they have a valid point, I adjust. If not, I explain the trade-off: 'I chose StateFlow over SharedFlow here because the screen always needs the current state, and StateFlow gives every new collector the latest value.' I make sure they understand the 'why,' not just the 'what.'
- Senior
- I treat the disagreement as a teaching moment, not a conflict. I ask them to write a short ADR with two options and the trade-offs, then we review it together. This builds their decision-making skill and gives the team a record. If the disagreement is about a reversible choice, I let them try their approach in a small PR and we compare. If it is irreversible, I explain the risk and make the call, but I document why. I also check whether the disagreement is about the approach or about respect: if it is the latter, I move it to a 1:1 and protect psychological safety.