Basics
Start with the product and the ideas it depends on. If these are clear, the design that follows will feel obvious rather than memorised.
1.1Product in plain words
Who uses it, what a normal day looks like, and why it is harder than it seems.
Not a feature but the machine that ships every feature: how 150 engineers in 20 teams change one Android app and one iOS app safely every week, instead of monthly releases that break.
Who uses it
- Feature teams: want to ship without waiting for others.
- Release captain: owns the weekly train.
- Users: should never notice a release except new features.
A day in the life
- Monday: the release branch is cut automatically; unfinished features are hidden behind flags.
- CI builds and tests only the modules each change touched, in under ten minutes.
- Tuesday: the release goes to 1% of users; dashboards watch crashes and key flows.
- Wednesday: a checkout regression appears at 10%; the team switches its flag off in seconds.
- Friday: the release reaches everyone; nobody shipped an emergency build.
Why it is hard
Shared code and long branches create conflicts and waiting.
40-minute builds kill focus and encourage big risky changes.
App stores take time; a bug can sit on phones for days.
Good architecture fails if teams don’t adopt it.
Like a train timetable: the train leaves every Monday whether your carriage is ready or not, so nobody holds up the train, and unfinished carriages travel locked.
1.2Key concepts
The building blocks this design uses. Each one appears again in the answer.
Everyone merges small changes to one main branch every day. Long-lived branches are what make releases painful.
Unfinished or risky work ships switched off and is turned on remotely, for chosen groups of users, without a new app release.
The app ships on a fixed schedule, for example weekly. A feature that is not ready waits for the next train instead of delaying everyone.
A new version goes to 1%, then 10%, then everyone, while crash and business metrics are watched. Problems stop the rollout early.
Splitting the app into modules and caching build outputs means a change rebuilds only what depends on it.
Build time, CI wait, release frequency and crash-free sessions show whether the platform is actually helping teams.
Learn them properly in the deep dives:
Question
Now read the question closely. Agree on what you are building, ask what is unclear, and work out the numbers before you draw anything.
2.1Brief and scope
The question exactly as the interviewer asks it, and what they want to learn from your answer.
You join as principal engineer. The company has one Android and one iOS app built by 150 engineers in 20 teams. Builds take 40 minutes, releases go out monthly and break often, and teams block each other. Design the mobile platform and release process for the next year.
What it tests: Organisational architecture: code ownership, build systems, CI, release trains, flags, observability and driving change across teams.
The answer in one sentence. Feature modules with owners, affected-only CI with a remote cache, a weekly train with staged rollouts, and flags with kill switches.
How to spend the 45 minutes
- Clarify~5 minAsk questions, agree on scope and write down assumptions.
- Estimate~5 minRough numbers for users, data and traffic, and what they imply.
- High-level design~11 minComponents, data flow and the key API on the board.
- Deep dive~16 minThe two or three hardest parts, with real mechanisms.
- Trade-offs and wrap-up~9 minDecisions, failure modes, and what you would do next.
2.2Clarify the problem
The first five minutes. Each answer removes a guess from your design.
| You ask | Interviewer answers |
|---|---|
| Native or cross-platform? | Native Kotlin and Swift, with some React Native screens. |
| What breaks most often? | Merge conflicts, flaky UI tests and crashes found after release. |
| Can the server change UI? | Some screens are config-driven already. |
| Release approval process? | QA signs off manually before each release. |
2.3Estimate the scale
Say the arithmetic out loud. What matters is the order of magnitude and what it forces you to do.
| Metric | Estimate | How |
|---|---|---|
| Merge requests per day | ≈ 250 | 150 engineers |
| CI minutes today | ≈ 10,000/day | 250 × 40 min |
| Target build time | < 10 min p90 | with remote cache |
| Release cadence target | weekly train | staged rollout |
Detailed answer
The design itself, from the big picture down to the code: components first, then one request end to end, then the parts interviewers push hardest on.
3.1Architecture
The platform has three layers: code ownership through modules, fast and trustworthy CI, and a release system where risky changes ship dark behind flags.
- Modules with owners
- Each team owns feature modules behind API modules, so teams depend on interfaces, not implementations. A CODEOWNERS file makes review routing automatic.
- Affected-only CI
- The build graph tells CI which modules a change touches. Only those build and test, with a remote cache for everything else.
- Test tiers
- Fast unit and screenshot tests on every change; a small, quarantined set of end-to-end tests on the release branch. Flaky tests are auto-quarantined and owned.
- Weekly release train
- The branch is cut on a fixed day whether a feature is ready or not. Unfinished work ships dark behind flags, so nobody blocks the train.
- Staged rollout with gates
- Play staged rollout and App Store phased release, with automatic halts when crash-free sessions or key metrics drop.
3.2Key flow, step by step
One week of the release train.
- The train never waits; features opt in through flags when they are ready.
- Rollout percentage increases only when automatic gates pass.
- Turning a flag off fixes most regressions, with no emergency release.
3.3Front end
In a platform round, the front end is the architecture of the app itself: how screens are split into modules, how they navigate without depending on each other, how a design system keeps 20 teams consistent, and how UI regressions are caught before users see them.
Screen map
- App shell
- Owns the navigation host, dependency injection graph and app-wide concerns; contains almost no UI.
- Navigation API
- Each feature publishes routes in its :api module. Other features navigate by route, never by importing screens.
- Design system
- Tokens (colour, type, spacing), components and accessibility rules in one module, with its own screenshot tests and a gallery app.
- Screenshot tests
- Every component and key screen renders in light, dark, large-font and right-to-left variants in CI; image diffs fail the build.
Client layers
| Layer | Technology | Responsibility |
|---|---|---|
| Navigation | Compose Navigation type-safe routes / SwiftUI NavigationStack with route enums | Decouple features |
| Design system | Compose components / SwiftUI views + tokens | Consistency and accessibility by default |
| Feature flags | Firebase Remote Config, LaunchDarkly, in-house | Ship dark, roll out, kill |
| UI testing | Paparazzi or Roborazzi / swift-snapshot-testing; Maestro for flows | Catch visual and flow regressions |
| Performance | Baseline Profiles, Macrobenchmark / XCTest metrics | Startup and scroll budgets per release |
Every state the user can see
| State | What the user sees | How it works |
|---|---|---|
| Flag off | Old screen; new code present but unreachable | Flag evaluated at navigation time |
| Flag on for cohort | New screen for 5% of users | Server-side targeting |
| Killed | Instantly back to the old path | Kill switch overrides targeting |
| Forced upgrade | Blocking screen with store link | Minimum version from config |
Code
Feature navigation through an API module (Compose, type-safe routes)
1// :feature:booking:api2@Serializable data class BookingRoute(val practitionerId: String)3 4// :feature:booking:impl5fun NavGraphBuilder.bookingGraph(nav: NavController) {6 composable<BookingRoute> { entry -> BookingScreen(entry.toRoute<BookingRoute>().practitionerId) }7}8 9// :feature:search:impl — depends only on :feature:booking:api10Button(onClick = { nav.navigate(BookingRoute(practitioner.id)) }) { Text("Book") }Screenshot test for a design-system component (Paparazzi)
1class SlotChipTest {2 @get:Rule val paparazzi = Paparazzi(deviceConfig = DeviceConfig.PIXEL_5)3 4 @Test fun states() = paparazzi.snapshot {5 AppTheme {6 Column {7 SlotChip("10:30", SlotState.Available)8 SlotChip("11:00", SlotState.Held(secondsLeft = 272))9 SlotChip("11:30", SlotState.Taken)10 }11 }12 }13}3.4Data model and APIs
The tables and contracts that make the design concrete.
Module boundaries (Gradle)
1// :feature:booking:api — interfaces, models2// :feature:booking:impl — screens, view models (internal)3dependencies {4 implementation(project(":feature:booking:api"))5 implementation(project(":core:designsystem"))6 // never: implementation(project(":feature:payments:impl"))7}Flag check with kill switch
1if (flags.isEnabled("new_checkout", user) && !flags.isKilled("new_checkout")) {2 NewCheckoutScreen()3} else {4 LegacyCheckoutScreen()5}3.5Tested code, explained
The core of this design as working code, with what each part does and why.
Deciding whether a rollout continues
This would have stopped version 8.2 at 1%. It compares like with like, and waits for enough data.
1data class Health(val sessions: Int, val crashFree: Double, val outboxP90: Int)2 3enum class Rollout { CONTINUE, WAIT, HALT }4 5/** Compare new with old on the same devices over the same hours. */6fun judge(new: Health, old: Health, minSessions: Int = 20_000): Rollout {7 if (new.sessions < minSessions) return Rollout.WAIT // too little data to judge8 val moreCrashes = new.crashFree < old.crashFree - 0.0029 val syncStalled = new.outboxP90 > old.outboxP90 * 2 // a stall shows no crash at all10 return if (moreCrashes || syncStalled) Rollout.HALT else Rollout.CONTINUE11}12 13private val STAGES = listOf(1, 10, 50, 100)14 15fun nextStage(percent: Int): Int = STAGES.firstOrNull { it > percent } ?: 100new.sessions < minSessions- Too little data proves nothing. Wait, rather than react to noise.
old.crashFree - 0.002- A small allowance, so normal variation doesn't halt every release.
new.outboxP90 > old.outboxP90 * 2- Catches a sync stall, which shows up in no crash report. Domain health needs its own signal.
Compiled and tested by npm run test:mobile.
Telemetry that survives being offline
It's an outbox for measurements, so a crash in a basement still gets reported.
1data class Event(val id: String, val name: String, val critical: Boolean)2 3/** An outbox for measurements. It keeps crashes when full, and drops routine events first. */4class TelemetryBuffer(private val maxEvents: Int = 500) {5 private val queue = ArrayDeque<Event>()6 val size: Int get() = queue.size7 8 fun record(e: Event) {9 if (queue.size >= maxEvents) {10 val victim = queue.firstOrNull { !it.critical } ?: queue.first()11 queue.remove(victim)12 }13 queue.addLast(e)14 }15 16 /** Removes a batch only after [upload] succeeds, so a failed upload loses nothing. */17 suspend fun flush(batch: Int = 50, upload: suspend (List<Event>) -> Boolean): Int {18 val events = queue.take(batch)19 if (events.isEmpty() || !upload(events)) return 020 repeat(events.size) { queue.removeFirst() }21 return events.size22 }23}24 25/** Server side. A resend must not inflate the crash rate. */26class EventIntake {27 private val seen = HashSet<String>()28 fun accept(batch: List<Event>): List<Event> = batch.filter { seen.add(it.id) }29}queue.firstOrNull { !it.critical }- When full, routine events go first. Crash reports are the last to be dropped.
if (events.isEmpty() || !upload(events))- Events leave the queue only after a successful upload.
class EventIntake- The server removes repeats, so a resend can't inflate the crash rate.
Compiled and tested by npm run test:mobile.
Stable variant assignment
The same user must get the same variant on any device, offline, with no server call.
1data class Variant(val name: String, val weight: Int)2 3data class Experiment(4 val key: String,5 val salt: String,6 val variants: List<Variant>,7 val rolloutPercent: Int = 100,8 val killed: Boolean = false,9)10 11/** Pure assignment: the same user and experiment always get the same variant, on any device. */12class FlagEvaluator(private val onExposure: (experiment: String, variant: String) -> Unit) {13 private val logged = HashSet<String>()14 15 fun variantFor(userId: String, exp: Experiment, default: String = "control"): String {16 if (exp.killed) return default // kill switch beats everything17 val bucket = bucketOf("${exp.salt}:$userId")18 if (bucket >= exp.rolloutPercent * 100) return default19 val total = exp.variants.sumOf { it.weight }20 var point = bucketOf("${exp.salt}:variant:$userId") % total21 val chosen = exp.variants.first { v -> (point < v.weight).also { if (!it) point -= v.weight } }.name22 // Log once per session, and only when the user actually reaches the feature.23 if (logged.add(exp.key)) onExposure(exp.key, chosen)24 return chosen25 }26}27 28/** FNV-1a into 0..9999: stable across platforms, unlike hashCode() between languages. */29fun bucketOf(s: String): Int {30 var h = 0x811C9DC5.toInt()31 for (b in s.encodeToByteArray()) {32 h = h xor (b.toInt() and 0xFF)33 h *= 1677761934 }35 return ((h.toLong() and 0xFFFFFFFFL) % 10_000).toInt()36}if (exp.killed) return default- The kill switch wins over everything.
bucketOf("${exp.salt}:$userId")- A new salt gives each experiment an independent split.
logged.add(exp.key)- Logs exposure once, when the feature is reached, so unexposed users don't dilute results.
FNV-1a- hashCode differs between languages. A hash written out by hand gives Android and iOS the same answer.
Compiled and tested by npm run test:mobile.
A startup budget that fails the build
Every team adds a little to startup. Only an automatic check stops it creeping up.
1data class Phase(val name: String, val ms: Long)2 3/** Fails CI, and names the phases to look at first. */4class StartupBudget(private val totalMs: Long) {5 fun check(phases: List<Phase>): List<String> {6 if (phases.sumOf { it.ms } <= totalMs) return emptyList()7 return phases.sortedByDescending { it.ms }.take(2).map { "${it.name} took ${it.ms} ms" }8 }9}phases.sumOf { it.ms } <= totalMs- Within budget: nothing to report.
sortedByDescending { it.ms }.take(2)- When over budget, it names the two slowest phases, so the failure tells you where to look.
Compiled and tested by npm run test:mobile.
3.6Hard parts, in depth
Where interviewers spend the second half of the round.
Driving the change, not just designing it
Start with measurements everyone sees: build time, flaky test rate, crash-free sessions and release lead time on one dashboard. Pick the worst one, fix it with one or two teams, and publish the result.
Write an RFC for module boundaries, review it with every team lead, and migrate incrementally: new code goes into modules from day one, old code moves when touched.
Build speed
Rebuilding unchanged code wastes most build time. A remote cache shared by CI and laptops, configuration caching, and API/implementation module splits cut rebuilds dramatically. Very large codebases move to Bazel or Buck2 for fully hermetic builds.
Keeping React Native screens healthy
Treat RN as one more module with an owner. Pin its version, run its tests in the same pipeline, and use EAS Update or a similar tool only for JS fixes within the native version’s compatibility range.
Q&A
The questions that come after the design, with model answers. Answer each one out loud before opening it.
4.1Follow-up questions
What the interviewer asks once the main design is on the board.
How do you measure success after a year?
What about server-driven UI?
How do you handle a team that resists?
4.2Front-end follow-ups
Questions aimed at the client: rendering, state and devices.
How do 20 teams avoid breaking each other’s screens?
When would you use server-driven UI?
4.3Incidents, probes and traps
Realistic production incidents and pointed probes, grouped by topic.
The product 1
ProbeWhy a weekly train rather than shipping whenever a feature is ready?
Requirements 1
TrapWhat do you ask before proposing anything as a new principal?
Scale 1
ProbeHow do you justify the cost of a remote build cache?
Architecture 2
IncidentA flag mistake turned on an unfinished payments flow for 100% of users.
ProbeHow do you stop teams importing each other’s internals?
The key flow 1
IncidentAt 50% rollout, crashes spike only on one Samsung Android 10 model.
Front end 2
IncidentAfter a design-system update, dark-mode screens became unreadable.
ProbeHow do you migrate 20 teams to a new design system?
Data and APIs 1
TrapWhy put navigation routes in api modules?
The hard parts 2
IncidentFlaky end-to-end tests block releases and teams start ignoring red builds.
ProbeWhen would you move from Gradle to Bazel?
Trade-offs 1
ProbeWhy not long-lived feature branches for big features?
Failures 2
IncidentApp Store review rejects the release on Thursday and blocks the train.
IncidentRemoving a field from an API broke 2% of users on old app versions.
Extra depth
What turns a good answer into a strong one: the decisions you rejected, how the system fails, and the signals of seniority.
5.1Trade-offs and decisions
Every choice has a cost. Naming it is what interviewers listen for.
Show detailsHide details
| Decision | Chosen | Rejected | Why |
|---|---|---|---|
| Cadence | Weekly train | Release when ready | Predictable, smaller diffs, easier rollback. |
| Unfinished work | Flags, ship dark | Long-lived branches | Merge conflicts and integration bugs drop sharply. |
| Build system | Gradle with remote cache first | Immediate Bazel migration | Most of the win for a fraction of the migration cost; revisit at larger scale. |
| UI tests | Screenshot tests + small E2E set | Large E2E suite | Fast, stable, and catches most visual regressions. |
5.2Failure modes
What breaks in production, and how the design keeps working when it does.
Show detailsHide details
| What breaks | How the design copes |
|---|---|
| Flag debt piles up | Every flag has an owner and an expiry date; CI fails on expired flags. |
| Bad release reaches 50% | Automatic halt plus kill switch; hotfix train only for crashes that flags can’t cover. |
| Teams bypass module rules | Dependency rules enforced by a build check, not by code review. |
| Old app versions linger | Minimum supported version, soft then forced upgrade prompts. |
5.3Performance and accessibility
The client-side details that separate a demo from a product.
Performance
- Startup and scroll benchmarks run on real devices for every release candidate; regressions block the train.
- Baseline Profiles ship with each build to speed up cold start on Android.
- Modules keep incremental builds small, which keeps engineers fast.
Accessibility and localisation
- Accessibility checks live in the design system: contrast, touch targets, content descriptions.
- Screenshot tests include large font and right-to-left variants.
5.4Senior versus principal
The same design, answered at two levels. Use the rubric to score yourself.
A senior answer adds CI, tests and feature flags.
A principal answer ties architecture to team ownership, sets measurable targets, sequences the migration, designs rollout gates and kill switches, and explains how they would win adoption across 20 teams.
Score yourself
5.5Whiteboard
Draw the design here, in this order. It stays in this browser.
- Module graph: app shell → feature API → core
- CI using an affected-target graph and remote cache
- Weekly train with rollout percentages
- Monitoring gates feeding back into the rollout
- Flags and kill switches in production