Mobile platform for 150 engineers: builds, releases, flags

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, rel…

Ready45:00
ClarifyEstimateHigh-level designDeep diveTrade-offs and wrap-up
Start the clockReset Practice mode
Part 1 of 5

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

  1. Monday: the release branch is cut automatically; unfinished features are hidden behind flags.
  2. CI builds and tests only the modules each change touched, in under ten minutes.
  3. Tuesday: the release goes to 1% of users; dashboards watch crashes and key flows.
  4. Wednesday: a checkout regression appears at 10%; the team switches its flag off in seconds.
  5. Friday: the release reaches everyone; nobody shipped an emergency build.

Why it is hard

Teams block each other

Shared code and long branches create conflicts and waiting.

Slow builds

40-minute builds kill focus and encourage big risky changes.

Bad releases are slow to fix

App stores take time; a bug can sit on phones for days.

Change across 20 teams

Good architecture fails if teams don’t adopt it.

Think of it like this

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.

01Trunk-based development

Everyone merges small changes to one main branch every day. Long-lived branches are what make releases painful.

02Feature flags

Unfinished or risky work ships switched off and is turned on remotely, for chosen groups of users, without a new app release.

03Release train

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.

04Staged rollout

A new version goes to 1%, then 10%, then everyone, while crash and business metrics are watched. Problems stop the rollout early.

05Modular builds and caching

Splitting the app into modules and caching build outputs means a change rebuilds only what depends on it.

06Platform metrics

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:

Part 2 of 5

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.

Interviewer

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

  1. Clarify~5 minAsk questions, agree on scope and write down assumptions.
  2. Estimate~5 minRough numbers for users, data and traffic, and what they imply.
  3. High-level design~11 minComponents, data flow and the key API on the board.
  4. Deep dive~16 minThe two or three hardest parts, with real mechanisms.
  5. 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.

Your turn: Before drawing anything, list the questions you would ask the interviewer.Reveal model answer
You askInterviewer 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.

Your turn: Write down the numbers that will drive the design.Reveal model answer
MetricEstimateHow
Merge requests per day≈ 250150 engineers
CI minutes today≈ 10,000/day250 × 40 min
Target build time< 10 min p90with remote cache
Release cadence targetweekly trainstaged rollout
Part 3 of 5

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.

Your turn: Sketch the components and arrows, then compare.Reveal model answer
CODEPIPELINEPRODUCTIONFeature modulesowned by teamsCore modulesdesign system · netApp shellwires featuresCIaffected targetsonlyRemote build cacheGradle · BazelTest tiersunit · screenshot ·E2ERelease trainweekly cutStoresstaged · phasedFeature flagsremote configCrash + perfCrashlytics ·SentryRollout gatescrash-free ≥ 99.8%Kill switchesper featurehitsgreensubmitsignalshaltdependsdepends
ClientServiceData storeExternal
Reference design. Boxes show components; arrows show who calls whom.
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.

Your turn: Narrate one request end to end.Reveal model answer
TeamsCIRelease captainStoresMonitoringmerge behind flagsaffected tests greenMonday: branch cutbuild release candidateRC + E2E resultssubmit, 1% rolloutcrash-free 99.9% ✓expand to 10%, 50%regression in checkoutflip kill switchcontinue to 100%
Solid arrows are requests; dashed arrows are responses.
  1. The train never waits; features opt in through flags when they are ready.
  2. Rollout percentage increases only when automatic gates pass.
  3. 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.

Your turn: Sketch the screens, the client layers and every UI state the user can see.Reveal model answer

Screen map

App shellnavigation hostNavigation APIroutes as contractsBooking module:feature:bookingPayments module:feature:paymentsDesign systemtokens · componentsFlag providerremote configScreenshot testsPaparazzi ·snapshotsServer-driven screenscontent onlyroutevia API
ClientServiceData store
Screens and how users move between them.
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

LayerTechnologyResponsibility
NavigationCompose Navigation type-safe routes / SwiftUI NavigationStack with route enumsDecouple features
Design systemCompose components / SwiftUI views + tokensConsistency and accessibility by default
Feature flagsFirebase Remote Config, LaunchDarkly, in-houseShip dark, roll out, kill
UI testingPaparazzi or Roborazzi / swift-snapshot-testing; Maestro for flowsCatch visual and flow regressions
PerformanceBaseline Profiles, Macrobenchmark / XCTest metricsStartup and scroll budgets per release

Every state the user can see

StateWhat the user seesHow it works
Flag offOld screen; new code present but unreachableFlag evaluated at navigation time
Flag on for cohortNew screen for 5% of usersServer-side targeting
KilledInstantly back to the old pathKill switch overrides targeting
Forced upgradeBlocking screen with store linkMinimum version from config

Code

Feature navigation through an API module (Compose, type-safe routes)

feature-navigation-through.ktKotlinCopy
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") }
10 linesUTF-8Kotlin

Screenshot test for a design-system component (Paparazzi)

screenshot-test-designsystem.ktKotlinCopy
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}
13 linesUTF-8Kotlin

3.4Data model and APIs

The tables and contracts that make the design concrete.

Your turn: Write the schema or contract you would put on the board.Reveal model answer

Module boundaries (Gradle)

module-boundaries-gradle.ktKotlinCopy
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}
7 linesUTF-8Kotlin

Flag check with kill switch

flag-check-kill.ktKotlinCopy
1if (flags.isEnabled("new_checkout", user) && !flags.isKilled("new_checkout")) {2  NewCheckoutScreen()3} else {4  LegacyCheckoutScreen()5}
5 linesUTF-8Kotlin

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.

ReleaseGate.ktKotlinCopy
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 } ?: 100
15 linesUTF-8Kotlin
new.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.

ReleaseGate.ktKotlinCopy
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}
29 linesUTF-8Kotlin
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.

FlagEvaluator.ktKotlinCopy
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}
36 linesUTF-8Kotlin
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.

FeedCache.ktKotlinCopy
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}
9 linesUTF-8Kotlin
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.

Your turn: Pick two areas the interviewer will push on and explain them.Reveal model answer

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.

Part 4 of 5

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?
Build p90 under 10 minutes, weekly releases with no missed trains, crash-free above 99.8%, and lead time from merge to users under two weeks.
What about server-driven UI?
Use it for content-heavy, frequently changing screens. Keep it out of flows where offline behaviour or performance matter.
How do you handle a team that resists?
Pair with them, show their own numbers before and after, and make the paved road the easiest road.

4.2Front-end follow-ups

Questions aimed at the client: rendering, state and devices.

How do 20 teams avoid breaking each other’s screens?
Feature modules depend only on other features’ API modules, navigation goes through routes, and a dependency rule check fails the build on violations.
When would you use server-driven UI?
For content-heavy, frequently changing screens such as promotions, not for core flows that must work offline or perform under load.

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?
Store review and slow user updates make every release costly. A fixed train keeps diffs small and predictable, and flags decouple shipping code from launching features.
I can answer this

Requirements 1

TrapWhat do you ask before proposing anything as a new principal?
What is measured today: build times, flaky test rate, crash-free sessions, release lead time and where teams wait. Redesigning before measuring loses credibility fast.
I can answer this

Scale 1

ProbeHow do you justify the cost of a remote build cache?
Saved CI minutes plus engineer waiting time. If 150 engineers each wait 30 minutes less per day, that is 75 engineer-hours a day, far more than cache infrastructure costs.
I can answer this

Architecture 2

IncidentA flag mistake turned on an unfinished payments flow for 100% of users.
A targeting rule was wrong and there was no staged flag rollout. Require review for flag changes, roll flags out by percentage with metric checks, separate release flags from ops kill switches, and keep an audit log.
I can answer this
ProbeHow do you stop teams importing each other’s internals?
Split features into api and impl modules and enforce dependency rules with a build check that fails CI, rather than relying on code review.
I can answer this

The key flow 1

IncidentAt 50% rollout, crashes spike only on one Samsung Android 10 model.
Halt the rollout, turn off the related flag, and reproduce on a device lab or cloud device. Add that device class to pre-release testing and consider staged rollout by device segment.
I can answer this

Front end 2

IncidentAfter a design-system update, dark-mode screens became unreadable.
There were no screenshot tests for dark variants. Add light, dark, large-font and right-to-left snapshots for every component and key screen.
I can answer this
ProbeHow do you migrate 20 teams to a new design system?
Ship adapters so old screens work, lint against deprecated components, migrate screen by screen when touched, and publish adoption metrics per team.
I can answer this

Data and APIs 1

TrapWhy put navigation routes in api modules?
Features navigate to each other through stable contracts without depending on implementations, so teams can change internals without breaking others.
I can answer this

The hard parts 2

IncidentFlaky end-to-end tests block releases and teams start ignoring red builds.
Auto-quarantine flaky tests with owners and deadlines, track flake rate, cut the end-to-end suite to critical flows and move coverage to screenshot and unit tests with hermetic data.
I can answer this
ProbeWhen would you move from Gradle to Bazel?
When modularisation and remote caching stop improving build times, or in a multi-language monorepo. It is a large migration, so prove the remaining gain first.
I can answer this

Trade-offs 1

ProbeWhy not long-lived feature branches for big features?
Integration pain grows with branch age, conflicts multiply and releases become risky. Trunk-based development with flags integrates daily.
I can answer this

Failures 2

IncidentApp Store review rejects the release on Thursday and blocks the train.
Fix the metadata or policy issue, request expedited review, and keep the previous build live. Flags let you remove the offending feature without rebuilding risky code.
I can answer this
IncidentRemoving a field from an API broke 2% of users on old app versions.
Version APIs, run contract tests against supported app versions, keep fields until telemetry shows no use, and enforce a minimum supported version with upgrade prompts.
I can answer this
Part 5 of 5

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.

Your turn: State each decision, the alternative you rejected and why.Reveal model answer
Show detailsHide details
DecisionChosenRejectedWhy
CadenceWeekly trainRelease when readyPredictable, smaller diffs, easier rollback.
Unfinished workFlags, ship darkLong-lived branchesMerge conflicts and integration bugs drop sharply.
Build systemGradle with remote cache firstImmediate Bazel migrationMost of the win for a fraction of the migration cost; revisit at larger scale.
UI testsScreenshot tests + small E2E setLarge E2E suiteFast, stable, and catches most visual regressions.

5.2Failure modes

What breaks in production, and how the design keeps working when it does.

Your turn: List what breaks and how the system degrades.Reveal model answer
Show detailsHide details
What breaksHow the design copes
Flag debt piles upEvery 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 rulesDependency rules enforced by a build check, not by code review.
Old app versions lingerMinimum 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.

Senior answer

A senior answer adds CI, tests and feature flags.

Principal answer

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

Requirements Asked clarifying questions and stated assumptions. Numbers Estimated scale and used it to make a decision. Architecture Clear components with responsibilities and data flow. Depth Went deep on the hardest part with real mechanisms. Trade-offs Named alternatives and why they lost. Operations Covered failures, monitoring and rollout. Leadership Explained how the team would build and evolve it.

5.5Whiteboard

Draw the design here, in this order. It stays in this browser.

  1. Module graph: app shell → feature API → core
  2. CI using an affected-target graph and remote cache
  3. Weekly train with rollout percentages
  4. Monitoring gates feeding back into the rollout
  5. Flags and kill switches in production
PenBoxArrowTextEraserUndoClear
Tip: draw boxes first, then arrows, then label them with Text.