Mobile System Design
Designing one installed app end to end: offline sync over a local store, paged feeds, media and push pipelines, and releases that cannot be recalled. Senior mobile loops run it as a separate round.
on this pageshowhide
explore
- Interview Playbook9 questions
- Requirements & Scoping5 questions
- Diagram & Deep Dives4 questions
- Client Architecture22 questions
- Layering & Data Flow6 questions
- Feature Modularization5 questions
- Navigation & Entry Points6 questions
- App Lifecycle & Restoration5 questions
- Backend Contract21 questions
- Wire Protocol Choice5 questions
- Supporting Old App Versions5 questions
- Request Pipeline6 questions
- Server-Driven Screens5 questions
- Offline-First & Sync22 questions
- Outbox & Queued Writes5 questions
- Optimistic State & Rollback5 questions
- Write Conflicts6 questions
- Change Tokens & Tombstones6 questions
- Caching & Local Storage21 questions
- Memory & Disk Caches5 questions
- Stale Data & Invalidation5 questions
- Persistent Store Choice6 questions
- On-Device Migrations5 questions
- Infinite Feeds16 questions
- Cached Cursor Paging5 questions
- Refresh, Merge & Gaps5 questions
- Virtualization & Diffing6 questions
- Client Media Pipelines20 questions
- Image Loading & Decode5 questions
- Image Variants & Formats5 questions
- Resumable Uploads5 questions
- Feed Video Preload & Downloads5 questions
- Real-Time & Push21 questions
- Live Transport Choice5 questions
- Connection Lifecycle5 questions
- Notification Delivery5 questions
- Chat Delivery Semantics6 questions
- Device Resource Budgets21 questions
- Radio Energy & Data Cost5 questions
- Background Time Limits5 questions
- Launch Path & Cold Start5 questions
- Frame Time & Memory6 questions
- Release, Flags & Telemetry22 questions
- Store Rollout & Upgrades5 questions
- Kill Switches & Experiments5 questions
- Crash & Hang Reporting6 questions
- Analytics Event Pipeline6 questions
- Client Security & Privacy12 questions
- Secrets on Device6 questions
- Pinning & Attestation6 questions
questions
207 · 11 sectionsIn a mobile system-design round for a food-delivery app, which boxes go on the client block diagram and how does data flow between them?
basics
~20 sDraw UI, state holders, repository, local store, network client, sync engine and push handler. Screens render what state holders expose, state holders read the repository, and network, sync and push all write into the local store the repository serves.
In a mobile system-design round for a city transit app with mobile tickets, what are the functional and non-functional requirements?
basics
~20 sFunctional requirements are what riders do: plan trips, check live departures, buy tickets, show one at the gate. Non-functional ones say how well: the ticket opens fast with no signal, data and battery stay cheap, screens are accessible, old phones are supported.
Designing a food-delivery app's client with 25 minutes left in the round, which two deep dives would you open, and how do you justify them?
basics
~20 sOpen the areas where this app fails worst or differs most: placing an order exactly once, and live order tracking. Justify each from a stated requirement, park the rest out loud, time-box both and let the interviewer redirect.
In a transit app design round, the interviewer adds that tickets are scanned at underground gates with no signal; what does that requirement change across the design?
basics
~20 sSignal-free gates make the phone the home of a bought ticket: a purchase is not done until the ticket is stored, the ticket opens from a cold start with no network or blocking check, and server decisions such as voids arrive late.
In a mobile design round for a food-delivery app, what belongs in the data-model and API sketch, and how deep should it go?
basics
~20 sList the few entities the screens need with their ids, mark which the device keeps, then the handful of calls and messages per screen need. Stop at names and key fields; protocol, paging and retries are deep dives.
In a mobile app's design, what do the presentation, domain and data layers each own, and what crosses the boundaries between them?
basics
~20 sThe presentation layer turns state into screens and taps into calls; an optional domain layer holds rules several screens share; the data layer owns server and disk behind repositories. Only app models cross, never wire formats or table rows.
In a mobile app's design, what do the foreground, background, suspended and terminated states mean, and what can the app rely on in each?
basics
~20 sForeground: visible and interactive, with priority on CPU and memory. Background: off screen, briefly running, expected to save and go quiet. Suspended: in memory but not running, killable without notice. Terminated: no process; only saved UI state and disk remain.
In an offline-capable mobile workout app, how should a repository arbitrate between the server and the local store as the single source of truth?
basics
~20 sMake the local store the source of truth: screens observe the repository, which reads from the store, and server responses are written into the store and reach the screen only through it. Offline, the screen keeps working from what is stored.
In a mobile loan-application form, which state belongs in memory, which in small saved UI state and which on disk, and why?
basics
~20 sMemory holds the loaded screen state; it survives a UI rebuild but not process death. Small saved UI state holds the draft's identifier and step index needed to rebuild. Disk holds the draft and the ID photo, which must survive everything.
In a modularized mobile app, why should one feature depend only on another feature's API module rather than on its implementation module?
basics
~20 sAn API module holds only a small, stable contract; the implementation module holds everything behind it. Depending on the API means implementation edits do not recompile other features, internals stay hidden, and the app module picks the implementation.
In a mobile app's design, what are over-fetching and under-fetching for one screen, and why do both cost more on a slow cellular link?
basics
~20 sOver-fetching downloads fields a screen never shows; under-fetching makes the screen send several requests, often one after another, to build one view. On a slow, high-latency cellular link the first wastes scarce bandwidth and data, the second stacks round trips.
In a mobile app with server-driven screens, what does the server send, and what must the installed build already contain?
basics
~20 sThe server sends data: a tree of typed components with their properties and tap actions. The build must already ship a renderer for each component type and a handler for each action, so the server can recompose only what the build knows.
Why must a mobile app's backend stay compatible with app builds released years ago, when a website's backend usually need not?
basics
~20 sAn installed app build cannot be redeployed: users update late or never, so builds from years ago keep calling the API. The server changes in minutes but adoption takes years, so each change must work for every supported build.
Would you choose REST, GraphQL or gRPC for a travel-booking mobile app used on slow roaming networks, argued from the device?
basics
~20 sArgue from round trips per screen on a slow radio: REST keeps HTTP caching and easy debugging but needs screen-shaped endpoints, GraphQL fetches one screen's fields in one request, and gRPC brings binary messages and codegen but needs HTTP/2 end to end.
In a mobile payments app, how do you make the Send money call safe to retry on a flaky network?
basics
~20 sCreate one idempotency key on the device when the user confirms the transfer, send it in the Idempotency-Key header, and reuse that same key on every retry of that intent, automatic or manual. A new key per attempt can pay twice.
In a household app synced across two offline phones, what must each edit carry so the server can tell it used a stale copy?
basics
~20 sThe revision it was made from: the server-assigned version number or entity tag the phone stored with its copy. The server applies the edit only if that base still matches; otherwise it merges or rejects instead of silently overwriting.
In an offline community-events mobile app, where must an optimistic RSVP live so it still shows, marked pending, after the app is killed and relaunched?
basics
~20 sIn the app's persistent local store, written in the same transaction as the RSVP's queued request, with a pending marker on the record itself. Screens observe the store, so the RSVP and its pending badge reappear after any relaunch.
In an offline field-inspection mobile app, why must a checklist change and its outbox entry be written to disk in one local transaction?
basics
~20 sA backgrounded app can be killed with no shutdown code, so an in-memory queue dies with it. Committing the record change and its outbox entry in one transaction means no kill leaves a change shown but unsent, or queued but not shown.
In a household app where partners edit shared lists offline, which conflict policy fits a checked flag, a note body, item order and a counter?
basics
~20 sChoose per data type by what losing an edit costs: last-write-wins for a checked flag or a title, per-field merge for items, increments for counters, a sort key per item for order, and the user's choice for a note body.
In a mobile mail client that pulls changes by sync token, when should it save the new token, and why then?
basics
~20 sSave the new token only in the same local transaction that commits the changes it covers. Saved earlier, a kill skips those changes for good; saved with them, a kill at worst repeats a pull the client applies idempotently.
In a mobile city-guide app, what are the memory and disk caches each for, and in what order is a venue looked up?
basics
~20 sThe memory tier holds parsed data for the screens in use and dies with the process; the disk tier survives relaunches but the OS may purge it. Lookups try memory, then disk, then network, copying hits upward.
In a mobile sports app, a fan opens a league table cached an hour ago in a crowded stadium: what should the screen show, and when?
basics
~20 sShow the cached table at once and refetch it in the background (stale-while-revalidate). Fresh rows replace old ones in place without moving the scroll; if the refetch fails, the cached table stays, labelled with its age, with a retry.
In a mobile language-learning app, which data deserves the persistent store, and which can live in a disposable cache?
basics
~20 sPersist anything that is the only copy (grades, progress, streaks, settings) or that the user needs offline (downloaded lessons, the course list); cache only what exists for speed and can be re-fetched with nothing lost.
On a 2 GB phone, how would you size a city-guide app's memory and disk caches, and what would each evict first?
basics
~20 sSize each tier from a stated device budget: memory as a share of the app's memory budget, disk as an app-set ceiling cut when storage is low. Bound both in bytes; evict least recently used, and age out untouched entries.
In a mobile sports fixtures-and-results app, how would you set different staleness rules for the fixture list, the league table and a match screen?
basics
~20 sGive each screen its own freshness window and ceiling from how fast its data changes and what a wrong value costs: fixtures hours, tables minutes, a live match seconds. Tighten windows by match state, and revalidate conditionally.
In a mobile recipe feed thousands of items deep, why create views only for rows near the viewport and recycle them?
basics
~20 sA view per item makes memory and creation work grow with the feed, though the screen shows about five cards. Virtualization keeps views only near the viewport, and recycling rebinds scrolled-off views to incoming items, so cost tracks the screen.
In a mobile news app's infinite feed, what load state stops one page being requested twice and keeps a failed load from ending the list?
basics
~20 sKeep one load state per direction outside the view: idle with a cursor, loading, failed or ended. Scroll triggers start a request only from idle, stale responses are dropped, and a failure shows an inline retry row, not the end.
In a mobile news app's infinite feed, how do you size a page and decide how far from the end to request the next one?
basics
~20 sDerive both from the screen and the link: the prefetch distance must cover the rows a reader scrolls during a slow page request, and a page should span several screens so requests stay infrequent. Express both in screens, not fixed rows.
In a mobile recipe feed, why should list updates diff old and new items by stable id rather than by row position?
basics
~20 sPositions shift whenever an item is inserted, removed or moved, so updates by position rebind and animate the wrong rows. Diffing by a stable id finds exactly which items were inserted, deleted, moved or changed, and redraws only those.
In a mobile news app read on commutes, how should fetched feed pages be stored so a relaunch with no signal shows articles at once and paging resumes?
basics
~20 sWrite each page into a local database and render the feed only from it, saving the articles, their server order and the next cursor in one transaction. A relaunch then paints the stored window at once and continues from that cursor.
In a mobile art-museum app, why do small artwork JPEGs in a grid crash older phones with out-of-memory, and what fixes it?
basics
~20 sMemory follows pixels, not file size: a 4000 x 3000 photo decodes to about 48 MB at four bytes a pixel, however small the JPEG. Read the dimensions first; decode downsampled to the cell's pixels, off the UI thread.
In a fashion catalogue app's two-column product grid, how should the app work out which image size to request for each photo?
basics
~20 sMultiply the cell's layout size by the screen's density to get its size in pixels, then request the smallest server-made variant at least that wide. Never fetch the original: it wastes cellular data and decodes far larger than the cell.
Why must a wedding-photography app keep its upload queue on disk, and what should each queued photo or video record?
basics
~20 sBecause the OS may end a backgrounded app at any time, taking its memory with it. Each entry records the file's path, size and content hash, its state (waiting, uploading, committed, failed) and the server's upload address.
In a mobile art-museum app, what path does one artwork image request take from memory cache to network, and where does coalescing happen?
basics
~20 sCheck the memory cache of decoded images by URL and target size; on a miss, read the encoded bytes from disk, else fetch them once, sharing any in-flight request; decode downsampled off the UI thread, then fill both tiers.
For a fashion catalogue app's photos, should the server offer fixed size buckets or any requested width, and how does each affect CDN hit rate?
basics
~20 sOffer a short list of size buckets and have the app round up to the next one. Any-width resizing scatters each photo across many cache keys, so most requests miss, and an open resize endpoint invites abuse.
In a mobile live trivia-show app, when should the client open and close its live socket as the player switches apps, and why?
basics
~20 sOpen the socket when the app reaches the foreground and close it on backgrounding, perhaps after a short grace. The OS will not keep a socket alive for an unused app; push is the background path.
In a dating app's mobile chat, why should the phone generate each message's id when the message is composed, before the first send attempt?
basics
~20 sAn id minted once at compose time lets the client show the message at once, lets the server recognise a retried send as the same message, and lets every acknowledgement or returning copy update one row instead of adding another.
In a parcel-tracking app, why can't a data-only push be trusted to keep the shipments list current, and what does the app do instead?
basics
~20 sA data-only push is best effort on APNs and FCM alike: it may be held while the phone sleeps, throttled, replaced or lost. Treat it as a hint, and fetch the shipments list whenever the app opens or returns to the foreground.
Why can't a mobile auction app keep its bidding-room connection open while backgrounded, and what replaces it?
basics
~20 sTo save battery the OS soon stops a backgrounded app from running or using the network, so its socket dies. Alerts go through the platform push service instead, and on return the app re-fetches the lot before trusting anything.
In a dating app's mobile chat, what moves a message through sending, sent, delivered and read, and what does the sender see while offline?
basics
~20 sSending means only the phone holds it; sent, the server acknowledged it with a sequence number; delivered, the match's device stored it; read, they viewed it. Offline the bubble stays visibly pending, and failure shows with a retry, never a silent drop.
In a personal-budgeting phone app, how should the nightly bank-transaction import be scheduled, and what can the design count on about when it runs?
basics
~20 sSubmit it as deferrable work with constraints (network, ideally charging) and an earliest start, not a 2 a.m. alarm. The OS may run it hours late or not at all, so show data age and refresh on open.
In a phone photo-editing app, how long does each frame have at 60 Hz and 120 Hz, and what happens when the app misses it?
basics
~20 sAbout 16.7 ms at 60 Hz and 8.3 ms at 120 Hz, of which the app's own work gets only part. A missed deadline is not a slightly late frame: the old picture stays a whole refresh longer.
In a phone weather app fetching a 2 KB forecast every 20 seconds, why does the battery drain far more than the bytes suggest?
basics
~20 sEach request wakes the cellular radio, which then lingers in high-power states for seconds after the transfer. A request every 20 seconds keeps it from ever reaching standby, so the energy goes on wake-ups and tails, not bytes.
In a music-streaming phone app, what do cold, warm and hot starts each rebuild, and why budget the cold start?
basics
~20 sA cold start creates the process, builds the app's object graph and draws the first screen; a warm start redoes part of that; a hot start brings a still-resident app forward. Budget the cold start, because it does all the work.
A budgeting phone app requests a 15-minute balance refresh, but field logs show a few runs a day; why, and how should the design cope?
basics
~20 sA periodic interval is a minimum gap, not a timetable; runs also wait for constraints, deep-idle windows, battery-saving modes and usage priority. Design for a few runs a day: refresh on open, show data age, alert from the server.
In a note-taking phone app's release build, crash reports show only hex addresses and renamed frames; what must the release pipeline keep and upload?
basics
~20 sThe symbol and mapping files of the exact build the store shipped, uploaded by the job that built it and matched to each report by the binary's build identifier; without them, the app's own frames stay unreadable.
In a smart-home security app, why can't a bad store release be rolled back like a server deploy, and what does halting it do?
basics
~20 sAn installed app version stays on every phone that received it; no store pushes the previous build back. Halting a staged release only stops more phones getting it, so the fix is a newer version rolled forward.
In a mobile puzzle game fetching remote configuration at launch, what does an offline first launch use, and when do fetched values take effect?
basics
~20 sDefaults compiled into the build cover a first launch with no network; later launches use the last fetched values saved on disk. A new fetch is stored, then activated only at a safe point: the next launch or between levels.
In a casual mobile game, the bundled ads SDK crashes at launch on one OS version; how would you design a kill switch for it?
basics
~20 sGuard the SDK's start with a switch read from stored configuration before the SDK initialises, targeted by OS and app version, and make the game run without ads; add a local crash-loop guard for phones with nothing stored.
Mid staged release, a smart-home security app's update makes door-lock pairing fail for some users; how do you decide to halt and ship the fix?
basics
~20 sHalt on a rule agreed before release: pairing failures by app version on the server, the crash signal, support contacts. Ship the smallest fix as a new version from the release branch, staged again; native code cannot go over the air.
In a law firm's client-portal phone app, why can't the refresh token live in a plain preferences file, and what should the app never store?
basics
~20 sA plain preferences file is cleartext that device backups, file copies and rooted or jailbroken phones expose. Keep the refresh token in the OS-protected credential store; never persist the password, and keep only what offline use needs.
In a law firm's client-portal app with offline case documents, how should they be encrypted at rest, and what does a hardware-backed key defend against?
basics
~20 sEncrypt documents and the database under a data key that a non-exportable, hardware-backed key protects, never stored beside them. That defeats copied files and backups read elsewhere, not code running as the app on an unlocked or compromised phone.
Should a banking app pin its server keys, and for which domains: its own API, an image CDN, an analytics host?
basics
~20 sPin the bank's own API, not hosts it does not control. Pinning defeats a mis-issued or device-added certificate authority, but it costs lockout risk when keys change, breaks inspecting proxies and complicates testing, so it comes with a rotation plan.
A banking app pins its API keys and two-year-old builds are still installed; how do you rotate the server key without locking those builds out?
basics
~20 sNever deploy a key that installed builds do not pin. Each build ships the live key, an offline backup and an expiry on the pin set; a new key goes live only after shipping for one expiry window, so every build pins it or has expired.
In a banking app, how should the cleartext policy handle a partner's plain-HTTP feed and a plain-HTTP test server?
basics
~20 sKeep the app TLS-only, as current platform defaults already are. Move the partner feed to HTTPS or relay it through the bank's own HTTPS API, and give the test server a debug-only exception that the release build never carries.