Mobile System Design
ADVANCED › System Design
Designing an Android feature end-to-end: layers, single source of truth, offline, pagination, and testing.
Mobile system design interviews ask you to architect a feature under time pressure, judging your thought process, trade-off awareness, and communication far more than a perfect, production-ready solution. You are tested on gathering functional and non-functional requirements, choosing layers and a single source of truth, picking an offline/caching strategy, and justifying pagination, API, and testing decisions. Concrete prompts like an offline news reader, chat, photo gallery, or background music player probe how you reason about real-world constraints such as flaky networks, battery, and limited storage.
What this covers
- Layer separation: UI (Compose + ViewModel state holder), an optional Domain layer (use cases), and a Data layer (repositories + single-responsibility data sources), each with clear boundaries.
- Single source of truth and unidirectional data flow: one owner per data type exposing immutable state, state flowing down to the UI and events flowing up to where data is mutated.
- Offline strategy: choosing cache-first (offline-first), network-first, or stale-while-revalidate, with a local database (Room) as the on-device SSOT.
- Pagination and caching: Paging 3 with PagingSource/RemoteMediator backed by Room, and cursor vs offset vs keyset trade-offs for infinite, changing lists.
- Resilient state handling: modeling loading/success/empty/error explicitly, plus retries, exponential backoff, rate limits (429), and auth (401).
- Testing strategy per layer and worked examples (offline news reader, chat, photo gallery, background music player) to anchor the design discussion.
Study this topic
- Mobile System Design explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Mobile System Design interview questions and answers