Mobile System Design Interview

Course Content

Mobile System Design Interview

11 sections · 23 lessons

Cheat sheet: the framework, decision tables and constraint checklist


Everything from Section 2 (A Framework for Mobile System Design), compressed to what fits on a single sheet, followed by the four decisions that come up in almost every design and the six constraints you must cover before you finish. Read it the evening before an interview, not for the first time.

Each part is a lookup, not an explanation. If a row does not make sense on its own, that is the signal to go back to the lesson it came from.

The seven steps and their budget

#StepMinThe one thing to produce
1Clarify requirements and scope5In-scope list, out-of-scope list, stated assumptions
2The API contract5Two or three endpoints with real field names
3High-level client architecture10The layer diagram, with the repository named
4Data flow and persistence10What is stored, where, and how it is invalidated
5Deep dive10Data structures, algorithm, failure cases, numbers
6Constraints3Six sentences, one per constraint
7Edge cases and close2Two or three specific cases, then what you would build first

The clarifying questions, in priority order

  1. Which platforms, and what minimum OS version?
  2. Which parts work offline? (Press for a per-feature answer.)
  3. What network conditions are we designing for?
  4. Are low-end devices in scope?
  5. Is there an existing backend, or am I designing the API too?
  6. How large is the data — typical and worst case?
  7. How stale can this data be before it is wrong?

The sentences worth memorising

  • The boundary: "I'll specify the API contract I want, and assume the server works unless you'd like me to design it."
  • The architecture: "The user interface reads from local storage and never from the network. The network's only job is to write into local storage."
  • The platform limit: "A backgrounded app is suspended, not slowed, so nothing time-critical can depend on background work."
  • The retry rule: "I won't retry a write without a client-generated idempotency key."
  • The close: "If I had one week I'd build X first, and I'd measure Y."
1. Requirementswhich platforms and versionsonline, offline, or bothscale: users, items, update rateexplicitly out of scope2. Client architectureUI / domain / repositorywho owns statewhat is testable without a network3. API designpagination style: cursor, not offsetpayload size and field selectionerror shape and retry semantics4. Data and persistencelocal schema and migrationscache policy and evictionwhat must survive process death5. Sync and offlinechange tokenoutbox for local writesconflict policy, stated explicitly6. Performance and batteryframe budget on scrollimage decode off the main threadwake-ups, radio use, background workSix headings. If you can produce these from memory, you can structure any mobile design question you have not seen before.
The framework is a checklist against forgetting, not a script — the order can change, the coverage should not.

Decision tables

Four decisions come up in almost every mobile design. Each one has a small number of options and a single requirement that decides between them.

Choosing a transport from the requirementClientpullsSecondsPoorServersendsSub-secondGoodBoth waysSub-secondFairOS deliversBest effortBestDirectionLatencyBatteryPollingSSEWebSocketPushSame shape applies to persistence, pagination style, and conflict policy.
Each row is chosen by one requirement, so name the requirement and the row picks itself.

Transport: how data reaches the client

If the requirement is…ChooseBecause
Updates every few minutes, tolerant of delayPollingSimplest thing that works; nothing else earns its complexity
Server-to-client only, near real timeServer-sent eventsReal-time without owning a socket's reconnect story
Two-way, sub-second, client also sendsWebSocketThe only option that is genuinely bidirectional and cheap per message
Must reach the app when it is not runningPush notificationThe only one that does — and it is best-effort
Very high frequency (many per second)WebSocket plus coalescingThe transport is the easy half; see Throttling and coalescing updates

The mobile-specific rule underneath all of it: four of the five stop working when the app is backgrounded. Real designs use two transports and hand off between them.

Persistence: where data lives on the device

DataStoreCeiling
Preferences, sync tokens, flagsKey-valueKilobytes — it is read before the first screen draws
Anything queried, sorted, or observedRelational databaseMegabytes to a few hundred megabytes
Images, video, documents, downloadsFiles, with a row pointing at themBudgeted and evictable
Tokens, encryption keysSecure store (hardware-backed)Credentials only
Pending user actionsDatabase (outbox table)Never evicted

The last row is the one people get wrong. Everything else is a cache and can be rebuilt from the server; the outbox cannot.

Pagination style

If…ChooseBecause
The list changes while the user reads itCursorOffset shows duplicates on insert and skips on delete
The list is static and you need "page 7 of 40"OffsetRandom access is the one thing cursors cannot do
A total count must be shown, positions are stableOffset with placeholdersAccurate scrollbar; incompatible with cursors
Paging in both directions (chat history)Cursor, with prev and next keysDesign it in from the start; adding it later is a breaking change

Default to cursor. The exceptions are narrow and you will know when you are in one.

Conflict resolution

If losing the local change costs…ChooseExample
NothingLast-write-winsRead state, a theme preference
Nothing, and the server derives itServer-winsComputed counts, entitlements
Something, but the fields are independentField-level mergeA rename on one device, a move on another
Real user workConflict copy — keep bothA document, a photo edit, a note
Real work, and duplicates are unacceptablePrompt the userRare; use sparingly, batch them

Say the reasoning, not just the choice. "Last-write-wins, because losing a read flag costs nothing" scores; "last-write-wins" alone does not.

The constraint checklist

Six things to address in every answer. Ninety seconds, one sentence each, and omitting one is noticed.

The six to say in every answerNetwork —assume it dropsBattery —radio wakeupsMemory —decoded imagesStorage — boundedLifecycle —then killedScreen —size, rotationtopbottomNinety seconds total, one sentence each, delivered as a deliberate pass.
Omitting one is noticed, so the checklist is worth saying aloud even where a constraint is not binding.

The six, with the sentence to say

1. Network. Unreliable, variable from 20 ms to several seconds, and often absent.

"Reads come from the local store, so the screen renders with no network. Writes go into a persisted outbox that drains on reconnect."

2. Battery. Radio wake-ups cost more than payload size, and the tail keeps the radio energised for seconds after each transmission.

"We batch requests rather than sending them individually, and drop from a socket to push when the app is backgrounded."

3. Memory. A hard ceiling enforced by process termination, and images are the usual cause.

"Images are decoded downsampled to the display size — a full-resolution photo is about 48 MB in memory — and lists recycle their views."

4. Storage. Shared with everything else on the device and finite.

"The cache has a stated ceiling, evicted least-recently-used, with the outbox and pinned content exempt, and the user can see and clear it."

5. Background execution limits. A backgrounded app is suspended, then killed.

"Sync is a deferred job that may not run for hours, so nothing the user is waiting on depends on it; long transfers go to the platform's transfer service."

6. Process death. Routine, not exceptional.

"The screen position, any draft the user has typed, and the outbox are all persisted, so a relaunch restores where they were."

How to deliver it

Do not deliver it as a list at the end if you can avoid it. The stronger pattern is to attach each constraint to the decision it caused, as you make that decision — "I'm batching these because of the radio tail" — and then use the final ninety seconds to cover whichever of the six have not yet come up.

If time is short, the list at the end still scores. Silence does not.

The four you can add for extra credit

Not required, and each is a strong signal when it fits:

  • Thermal. Sustained load throttles the processor, so a design that is fast for thirty seconds may not be fast for ten minutes.
  • Metered data. Not the device's cost but the user's, which makes it a product decision. Central in Sections 6, 9, and 10 (trading, Drive, and video).
  • Permissions. Notifications, storage, location, and camera can all be declined, and the feature must still function.
  • App size. Download size affects install conversion, and it is a real constraint on which libraries you can afford.