You now understand frontend data layer design.
Core concepts:
- REST vs GraphQL: Choose based on data needs
- Fetching: On mount, on interaction, prefetching
- Caching: In-memory, browser, IndexedDB with invalidation strategy
- Pagination: Cursor for feeds, offset for search
- Real-time: Polling, WebSockets, SSE based on requirements
- Error handling: Retry, fallback, user communication
Interview approach:
Define API endpoints
Choose caching strategy
Handle loading and error states
Discuss optimistic updates where applicable