Mock interview on designing a scalable Facebook-like newsfeed app with offline support and efficient pagination.
Key Takeaways
- Designing scalable social media feeds requires careful handling of pagination, offline mode, and real-time updates.
- Cursor-based pagination is preferred for consistent and efficient feed loading.
- Offline support with optimistic writes and synchronization is critical for user experience in mobile apps.
- Layered architecture and separation of concerns improve maintainability and scalability of the client app.
- REST APIs with JSON are practical for backend communication, with potential extensions for real-time features.
Summary
- The video is a mock system design interview focused on building a Facebook newsfeed app with two main screens: a feed list and a detailed post view.
- Functional requirements include displaying posts with text, images, videos, likes, comments, infinite scrolling, and offline mode support.
- Nonfunctional requirements emphasize scalability to 100 million users, low latency, data efficiency, and synchronization for offline interactions.
- The backend communication is designed using REST APIs with JSON, supporting cursor-based pagination and potential real-time updates via WebSockets or server-sent events.
- The interview discusses API design, including pagination tokens, request types, and user interactions like likes and comments.
- Client-side architecture is layered, leveraging repositories, local data stores, and reactive programming to handle offline capabilities and data synchronization.
- Optimistic writes are used for offline user actions, with retry mechanisms and user notifications for failed operations.
- Navigation and UI state management are handled with a router and backstack entries, supporting smooth transitions between feed and detail screens.
- The discussion includes architectural best practices such as repository pattern, dependency injection, and separation of concerns across presentation, domain, and data layers.
- The interview concludes with feedback on the candidate’s technical proficiency and architectural decisions.
Chapters
- 00:00Introduction and Problem Overview
- 02:08Clarifying Functional Requirements
- 04:04Content Types and Global Audience
- 06:10Nonfunctional Requirements and Scalability
- 11:17Backend Communication and API Design
- 13:38Pagination Strategy and Cursor Design
- 16:07Client-side Architecture and Data Handling
- 25:58Offline Support and Optimistic Writes
- 31:16Navigation and UI State Management
- 39:03Architectural Patterns and Interview Feedback











