Skip to content
All guides

Android architecture interview questions for senior engineers

By Mike Salari. Staff mobile engineer · 500+ technical interviews from the hiring side.

This page is for senior and staff Android engineers facing an architecture round. You get ten questions about state ownership, boundaries and decisions, with what is scored, the follow-up chain and the weak answer for each. The thread through all of them: architecture is the cost of change, and a rule nobody enforces is a preference.

Who this is for

  • Senior Android engineers who will be asked to defend a design they shipped.
  • Engineers moving toward staff, where the questions shift from one screen to many teams.
  • Leads who review architecture and want sharper questions to ask.

Ten Android architecture questions on layers, UDF, Hilt, modules and navigation are in the Android architecture guide on Mobile Interview Room.

The questions

In an architecture round, boxes on a whiteboard do not read as senior. A boundary becomes credible when you can name the change it contains and the team that can evolve it without negotiating every change.

1. "What rules would you enforce on every ViewModel, whatever pattern the team picks?"

What is scored: invariants over pattern names.

A strong answer covers:

  • Context: MVVM and MVI both meet the platform's real requirement, unidirectional data flow with a state holder. The differences are how formal the inputs are.
  • The shared rules: one immutable UI state object, events reduced to state, and no public mutable types. Android lists exposing uiState as a StateFlow as recommended. (Android: architecture recommendations)
  • Mutation through update, which changes the value atomically and may run your function more than once under contention, so keep the function free of side effects. Two coroutines doing value = value.copy(...) can lose an update. (kotlinx.coroutines: update)
  • Enforcement: a lint or architecture test in CI that fails any ViewModel exposing a Mutable type.
  • Failure mode: a pattern migration of healthy screens "for consistency" with no defect data behind it.
Kotlin
class CartViewModel : ViewModel() {
    private val _state = MutableStateFlow(CartUiState())
    val state: StateFlow<CartUiState> = _state.asStateFlow()

    fun add(item: Item) = _state.update { it.copy(items = it.items + item) }
}

Follow-ups:

  • Two coroutines write _state.value = _state.value.copy(...) at once. What can go wrong?
  • A reducer has grown to 200 lines. Is the pattern failing, or is something missing?

Weak answer: "We use MVI everywhere because it scales." A label with no rule the build can check.

2. "This ViewModel is 800 lines and the roadmap does not pause. How do you refactor it?"

What is scored: method under delivery pressure.

A strong answer covers:

  • Characterisation tests first, to pin current behaviour before touching anything.
  • Carve along responsibility seams into plain state-holder classes and use cases the ViewModel delegates to. One seam at a time, tests green after each.
  • Merge scattered state streams into one UI state as you go.
  • Alternative and why not first: splitting into several ViewModels changes lifecycles, which changes behaviour and breaks the safety net you just built.
  • Result: a thin coordinator, shipped continuously, with no feature freeze.

Follow-ups:

  • There are no tests and the screen has five entry points. Where do the first tests go?
  • A teammate wants a rewrite branch instead. What would make you agree?

Weak answer: "Rewrite it in a new module." A rewrite with no net and no exit plan.

3. "Where does this discount rule live: the Composable, the ViewModel, a use case, or the repository?"

What is scored: a placement test you can apply to any rule.

A strong answer covers:

  • The rewrite test: if the rule would survive a UI rewrite, it does not belong in the ViewModel or the UI.
  • Pricing, eligibility and validation go into plain Kotlin classes tested on the JVM. The ViewModel maps results to screen state. Formatting stays at the edge.
  • Android calls the domain layer optional, for complex logic or logic reused by several ViewModels. Use cases must be main-safe. (Android: domain layer)
  • If the discount decides what the customer pays, the backend owns the final number. The client shows a projection.

Follow-ups:

  • The same rule now appears in two ViewModels. What do you extract, and where?
  • The discount needs data from two repositories. Does that change the answer?

Weak answer: "Business logic goes in the ViewModel because that is MVVM." It fails the first redesign.

4. "After a failed payment, show a message that survives rotation and never shows twice."

What is scored: choosing by delivery guarantee.

A strong answer covers:

  • StateFlow replays its latest value, so a navigation or toast event fires again on every new collector.
  • A SharedFlow with no replay drops events emitted while nobody collects, such as during a configuration change.
  • Android's guidance: ViewModel events should always become a UI state update, and the UI tells the ViewModel when the message was shown. (Android: UI events)
  • The message then survives rotation like any state and clears on an explicit acknowledgement.
Kotlin
data class CheckoutUiState(val userMessage: String? = null)

class CheckoutViewModel : ViewModel() {
    private val _state = MutableStateFlow(CheckoutUiState())
    val state = _state.asStateFlow()

    fun onPaymentFailed() = _state.update { it.copy(userMessage = "Payment failed") }
    fun userMessageShown() = _state.update { it.copy(userMessage = null) }
}

Follow-ups:

  • Two messages arrive before the first is shown. What does your state hold?
  • The event is navigation after success. Same pattern, or different?

Weak answer: "A Channel for events." Android's guide warns these do not guarantee delivery when the producer outlives the UI.

5. "Login state is cached in five places. How do you make logout reliable?"

What is scored: one owner per fact.

A strong answer covers:

  • One session repository owns a StateFlow<Session>. Navigation, feature gates and the network layer observe it.
  • No feature caches "logged in". Two caches of one fact will disagree in front of a user.
  • Logout is one function: clear user-scoped storage, then emit the new state everyone reacts to.
  • The token refresh path reports a dead session into the same repository.
Kotlin
class SessionRepository(private val store: SessionStore) {
    private val _session = MutableStateFlow<Session>(Session.SignedOut)
    val session: StateFlow<Session> = _session.asStateFlow()

    suspend fun logout() {
        store.clearUserData()
        _session.value = Session.SignedOut
    }
}

Follow-ups:

  • A request is in flight when the user logs out. What happens to its result?
  • A second account is added. What changes in the model?

Weak answer: "Each screen checks a shared preference." Five readers, no owner, and stale state after logout.

6. "Payments needs to open login, and another team owns login. How do the modules talk?"

What is scored: cooperation without direct imports.

A strong answer covers:

  • Feature modules should not reference each other. Android shows a mediator, usually the app module that owns the navigation graph. (Android: modularization patterns)
  • Pass simple IDs instead of objects, so each feature loads from the data layer and the single source of truth holds.
  • Shared route types live in a tiny navigation module that holds routes only.
  • An API and implementation split lets others compile against a small contract, and implementation changes do not recompile them.

Follow-ups:

  • CI just found a cycle between payments and login. How do you break it?
  • Login must return a result to payments. Where does that contract live?

Weak answer: "Payments depends on the login module." It works until login depends on payments.

7. "A small feature change touches ten modules. What went wrong?"

What is scored: reading the graph for coupling.

A strong answer covers:

  • This is a distributed monolith on the device: many modules that must change, test and release together.
  • Usual causes: modules split per screen or per layer, shared models that change weekly, and a common module everyone imports.
  • Android notes every module adds configuration overhead, and parts that rarely interact should probably be separate. (Android: modularization patterns)
  • The test: does the unit have an owner, a stable contract and a meaningful change radius? If merging it with a neighbour cuts coordination without weakening a boundary, merge it.
  • Evidence: change coupling from history, which modules change together.

Follow-ups:

  • The common module has 40 dependents. What do you move out first?
  • Teams route around graph rules with a global event bus. Why is that worse?

Weak answer: "We need more modules." More boxes over the same knot.

8. "Should we add an interface and a use case here?"

What is scored: treating abstraction as a cost.

A strong answer covers:

  • An abstraction is a loan: new concepts, mappings, files, test doubles, and fewer people who can change it with confidence.
  • Four questions decide it. Volatility: do the two sides change for different reasons? Consequence: how bad is a leak? Multiplicity: are there real second implementations? Coordination: do different teams own the sides?
  • Order: concrete first, a seam where pressure shows, an abstraction when two real demands exist.
  • Failure modes: an interface per class, a generic CRUD repository, a use case that only forwards one call.

Follow-ups:

  • The code wraps a volatile payment SDK used across the app. Does the answer change?
  • You inherited a strange mapper. How do you find out if it is safe to delete?

Weak answer: "Always code to an interface." That is a habit. Nobody made a decision.

9. "How do you record an architecture decision so the next team does not re-argue it?"

What is scored: decisions with conditions attached.

A strong answer covers:

  • An ADR holds context, the decision, real alternatives, trade-offs, scope, an owner and revisit triggers.
  • Revisit triggers name facts that would change the answer. "When the team feels like it" is not one.
  • Match the paperwork to the blast radius: local and reversible needs code review only; persisted schema or a shared SDK needs a written plan.
  • Rejected options are kept, so the next engineer sees why the obvious path lost.

Follow-ups:

  • A trigger fires during a busy quarter. Who reopens the decision?
  • An old ADR is wrong today. Do you edit it or supersede it?

Weak answer: "We document decisions in Confluence." Where it lives matters less than what it contains.

10. "How do you stop a feature module importing another feature's implementation?"

What is scored: rules the build enforces.

A strong answer covers:

  • Graph rules that hold at any team size: features never depend on other features' implementations, and core never depends on features.
  • Enforce them with dependency tests or architecture checks in CI, so the rule fails a build instead of starting a review debate.
  • Exceptions get an owner and an expiry date. Rules with no escape valve get ignored.
  • The same idea scales to "no public mutable state" and "no Android imports in domain code".

Follow-ups:

  • An urgent fix needs the forbidden import today. What do you allow?
  • How would you know the rules are still being followed a year after you leave?

Weak answer: "We catch it in code review." Reviews miss things; the build does not get tired.

What changed in 2024 to 2026

  • Android's architecture recommendations, updated 5 October 2026, strongly recommend Navigation 3 for apps with more than one screen, and rememberViewModelStoreOwner() for scoping a ViewModel to a composable. (Recommendations for Android architecture)
  • Performance is now in the same list: R8 full mode, Baseline and Startup Profiles, and Macrobenchmark are all strongly recommended. (Recommendations for Android architecture)
  • From 31 August 2026, new apps and updates on Google Play must target Android 16 (API level 36), with extensions available to 1 November 2026 and lower targets for Wear OS, Automotive, TV and XR. (Target API level requirements)
  • SavedStateHandle.getMutableStateFlow() arrived in Lifecycle 2.9.0, so saved state can be written through a flow. (Saved state module for ViewModel)

How the rounds run

Formats vary by company and level. Some loops run architecture as a discussion of your past system, some as a whiteboard design, some as a code review. No official careers page publishes an Android-specific architecture round, so none is described here. Ask the recruiter what each round scores and whether you will design from scratch or defend existing work.

For the language under these designs, see the Kotlin interview guide. For offline sync and conflicts, see mobile app architecture interview questions.

Sources

These questions are a sample. The Senior Signal has the full architecture, modularisation and dependency injection chapters with the follow-ups interviewers use. Interview Runtime Android lets you practise defending a boundary while the constraint changes.