Lesson 8 of 16 advanced

System Design Interview for Mobile Devs

Ace system design rounds by thinking like a mobile-first architect

Open interactive version (quiz + challenge)

Real-world analogy

System design interviews are like being an architect asked to design a building live. The interviewer doesn't want a finished blueprint — they want to see how you think about trade-offs. Should we use steel or wood? How many floors? What about earthquake resistance? For mobile devs, you're designing the building AND the elevator system that connects floors (client-server communication).

What is it?

System design interviews evaluate your ability to design large-scale software systems. For mobile developers, this means designing not just the backend infrastructure, but the entire client-server architecture including offline support, caching strategies, and real-time communication. The interviewer assesses your ability to make and justify technical trade-offs at scale.

Real-world relevance

A mobile developer at a fintech company was asked to design a payment system in their interview. While backend candidates focused only on server architecture, she included: offline payment queuing, optimistic UI updates, retry logic with idempotency keys, local transaction history cache, and push notification for payment confirmations. She got the offer because her design was the most complete — it covered the full user experience, not just the server side.

Key points

Code example

# System Design Template & Checklist
# ====================================

# STEP 1: REQUIREMENTS (5 minutes)
\`\`\`
FUNCTIONAL REQUIREMENTS:
- [ ] Core features (list 3-5)
- [ ] User actions (what can users do?)
- [ ] Data flows (what data moves where?)

NON-FUNCTIONAL REQUIREMENTS:
- [ ] Scale: _____ users, _____ DAU
- [ ] Availability: 99.9% uptime? (3 nines = 8.7 hr downtime/year)
- [ ] Latency: < _____ ms for reads, < _____ ms for writes
- [ ] Consistency: Strong or eventual?
- [ ] Storage: _____ GB/TB estimated

MOBILE-SPECIFIC:
- [ ] Offline support needed?
- [ ] Real-time updates needed?
- [ ] Push notifications?
- [ ] Battery/data optimization?
- [ ] Multi-platform (iOS + Android)?
\`\`\`

# STEP 2: HIGH-LEVEL DESIGN (5 minutes)
\`\`\`
┌──────────┐     ┌───────────┐     ┌──────────────┐
│  Mobile  │────▸│    API    │────▸│   Backend    │
│   App    │◂────│  Gateway  │◂────│   Services   │
└──────────┘     └───────────┘     └──────────────┘
     │                │                    │
     │           ┌────┴─────┐         ┌────┴─────┐
     │           │   CDN    │         │   Cache   │
     │           │ (images) │         │  (Redis)  │
     │           └──────────┘         └──────────┘
     │                                     │
┌────┴─────┐                         ┌─────┴──────┐
│  Local   │                         │  Database  │
│   DB     │                         │ (Postgres) │
│ (SQLite) │                         └────────────┘
└──────────┘
\`\`\`

# STEP 3: DEEP DIVE AREAS
\`\`\`
API DESIGN:
  POST /api/v1/posts        → Create post
  GET  /api/v1/feed?page=1  → Get feed (paginated)
  PUT  /api/v1/posts/:id    → Update post
  WS   /ws/notifications    → Real-time updates

DATA MODEL:
  Users:    id, name, email, avatar_url, created_at
  Posts:    id, user_id, content, media_url, created_at
  Feed:     fan-out-on-write for < 10K followers
            fan-out-on-read for celebrities

CACHING STRATEGY:
  Layer 1 — Device:  SQLite for feed, disk cache for images
  Layer 2 — CDN:     All static assets + image thumbnails
  Layer 3 — Redis:   User sessions, feed cache, counters

OFFLINE SYNC:
  - Queue writes locally when offline
  - Sync on reconnection with conflict resolution
  - Last-write-wins for simple fields
  - CRDT for collaborative data (if needed)
\`\`\`

# STEP 4: SCALE & TRADE-OFFS
\`\`\`
BACK-OF-ENVELOPE:
  10M users × 20% DAU = 2M DAU
  2M DAU × 10 reads/day = 20M reads/day ≈ 230 QPS
  2M DAU × 2 writes/day = 4M writes/day ≈ 46 QPS
  Read-heavy → Cache aggressively

TRADE-OFFS DISCUSSED:
  ✓ SQL vs NoSQL → SQL for ACID on payments, NoSQL for feed
  ✓ Push vs Pull → Push for < 10K followers, Pull for celebs
  ✓ Strong vs Eventual consistency → Eventual for feed, Strong for payments
  ✓ WebSocket vs Polling → WS for active, fallback to polling

WHAT I'D IMPROVE WITH MORE TIME:
  - Add monitoring (Prometheus + Grafana)
  - Implement circuit breaker for external services
  - Add A/B testing infrastructure
  - Geographic distribution (multi-region)
\`\`\`

Line-by-line walkthrough

  1. 1. Step 1 uses checkboxes — in a real interview, write these on the whiteboard as you discuss them with the interviewer
  2. 2. The mobile-specific requirements section is your differentiator — most candidates forget offline support and battery optimization
  3. 3. The high-level diagram shows data flow with arrows — label each connection type (REST, WebSocket, etc.)
  4. 4. Local DB (SQLite) on the mobile side shows you think about the full stack, not just the server
  5. 5. API design uses REST conventions with versioning (/v1/) — mention this shows you think about API evolution
  6. 6. The fan-out strategy split (write for normal, read for celebrities) is a classic trade-off interviewers love
  7. 7. Three-layer caching (device → CDN → Redis) shows depth of understanding about latency optimization
  8. 8. Back-of-envelope calculations prove you can reason about scale — practice these until they're automatic
  9. 9. The 'What I'd improve' section shows maturity — no design is perfect, and acknowledging that impresses interviewers

Spot the bug

# System Design: Chat App Architecture
Components:
- Mobile App connects directly to PostgreSQL database
- All messages stored in single database table
- Images stored in database as BLOBs
- No caching layer
- HTTP polling every 500ms for new messages
- Single server handling all traffic
Need a hint?
There are 6 major architectural problems with this design. Think about security, scalability, performance, storage, real-time communication, and reliability.
Show answer
(1) Mobile app should NEVER connect directly to a database — needs an API gateway/backend for security and abstraction. (2) Single database table won't scale — need partitioning/sharding by conversation ID. (3) Images as BLOBs in DB is terrible — use object storage (S3) and store URLs in DB. (4) No caching means every read hits the database — add Redis for recent messages and device cache. (5) HTTP polling every 500ms wastes battery and bandwidth — use WebSockets for real-time with push notifications as fallback. (6) Single server is a single point of failure — need load balancer with multiple server instances.

Explain like I'm 5

Imagine you're building the biggest treehouse ever — one that thousands of kids can play in at the same time. You need to think about: How do kids get up there? (API) What if too many kids climb at once? (load balancing) What if it rains and they can't climb? (offline mode) Where do they store their toys? (database) How do they talk to each other between rooms? (real-time messaging) System design is planning all of this before building!

Fun fact

The system design interview was popularized by Google in the mid-2000s when they realized coding interviews alone couldn't predict whether a developer could architect large systems. Today, system design rounds are used by 95% of companies hiring for senior roles. For mobile developers, companies like Meta and Uber have mobile-specific system design rounds that focus on client architecture, offline support, and performance optimization.

Hands-on challenge

Design Instagram's mobile app architecture using the 4-step framework. Set a 35-minute timer. Write out: (1) Requirements — 5 functional, 5 non-functional. (2) High-level architecture diagram with all components. (3) Deep dive into the feed algorithm and image upload pipeline. (4) Back-of-envelope calculations for 1 billion users, discuss trade-offs for SQL vs NoSQL, caching strategy, and offline support. Bonus: How would you handle the 'stories' feature with 24-hour expiration?

More resources

Open interactive version (quiz + challenge) ← Back to course: Career Launchpad