MyFamilyTracker
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
Senior Android interview questions test deep understanding, not syntax recall. Here are 15 hard questions covering architecture, concurrency, performance, and testing — with the answers that demonstrate senior-level thinking.
On this page
Junior interviews test if you know the APIs. Senior interviews test if you understand the tradeoffs. Here are the questions that separate prepared candidates from the rest.
Q: What's the difference between StateFlowSharedFlow
StateFlowSharedFlowThe key distinction: if a new subscriber should see the latest state, use
StateFlowSharedFlowreplay = 0Q: How does Hilt handle scope and what are the different component scopes?
Hilt components have a hierarchy:
SingletonComponentActivityRetainedComponentActivityComponentViewModelComponentFragmentComponentViewComponentServiceComponentA dependency in
SingletonComponentActivityComponentQ: Explain the Clean Architecture layers and what shouldn't cross between them.
Domain layer contains business rules (use cases, domain models, repository interfaces). It has zero Android or framework imports — pure Kotlin.
Data layer implements repository interfaces. It knows about Room, Retrofit, and how to map between network/database types and domain models.
Presentation layer (ViewModel + UI) depends on use cases from Domain, not on Data implementations directly.
What shouldn't cross:
Q: What happens when you launch a coroutine with GlobalScope
GlobalScopeSolution: use
viewModelScopelifecycleScopeQ: What's the difference between launchasyncawait
launchJobasyncDeferred<T>.await()When you need two concurrent operations and both results:
val aDeferred = async { fetchUserProfile() }
val bDeferred = async { fetchUserTasks() }
val profile = aDeferred.await()
val tasks = bDeferred.await()If you used
launchasyncawaitQ: How do you identify and fix recomposition performance problems in Compose?
First, identify: use the Layout Inspector's Recomposition Counts view or add
SideEffect { println("recomposing") }Common causes:
List<T>ImmutableListkotlinx.collections.immutableremember { lambda }viewModel::methodLazyColumnThe fix is often: make parameters stable, move state reads lower, and add keys to lists.
Q: How do you test a ViewModel that depends on a Flow from a repository?
Three approaches, depending on complexity:
Fake repository with a FakeFlow: inject a
FakeTaskRepositoryMutableStateFlowTurbine for Flow testing:
viewModel.uiState.test {
assertEquals(Loading, awaitItem())
fakeRepository.emitTasks(testTasks)
assertEquals(Success(testTasks), awaitItem())
cancelAndIgnoreRemainingEvents()
}Dispatchers.MainUnconfinedTestDispatcherMainDispatcherRuleAll three are needed together for deterministic ViewModel tests.
Q: What's the difference between testing with Robolectric vs on an emulator?
Robolectric runs Android SDK classes on the JVM without an emulator. Tests run fast (seconds vs minutes). Good for: ViewModel tests, DAO tests, anything that doesn't need hardware or actual rendering.
Instrumentation tests run on a real device or emulator. They test against the real Android framework, real rendering, real GPU. Required for: UI tests (Espresso/Compose testing), anything touching hardware, tests where Android behavior differs from Robolectric emulation.
Robolectric occasionally has discrepancies from real Android behavior. Critical flows should be tested on-device, not just in Robolectric.
At the end of every Android interview, ask:
These questions reveal the team's technical maturity more than the interview questions do.
GlobalScopeSudarshan Chaudhari
AI Systems Builder / Product Engineer
Bangkok, Thailand
Solo Android developer with 13+ years in QA, building Android apps, AI automation systems, and developer tools at SudarshanTechLabs.
Related Posts
Related Apps
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
Building something? Available for Android dev and QA consulting.
Work with meComments — powered by Giscus
Real-time family location sharing — Firebase Realtime DB for sub-second propagation, WorkManager + ForegroundService for OS-compliant background collection, geofencing via Google Maps API.
ReadPrivate dream journal — structured entry capture, pattern tagging, and optional Claude-powered insight generation. All data stays on-device by default.
ReadWorkout tracker — exercise logging with set/rep/weight history, goal progression, and local Room DB persistence. No account, no cloud sync required.
Read