Paging 3
ARCHITECTURE › Components
Loading large lists incrementally with PagingSource, Pager, RemoteMediator, and Compose.
Paging 3 is a common system-design and architecture question for list-heavy Android apps, testing how you stream paginated data from network and database without loading everything into memory. Interviewers probe your grasp of the PagingSource/Pager/PagingData flow, cachedIn, RemoteMediator for offline caching, and LoadState-driven loading and error UI. They want to see you wire repository to ViewModel to Compose correctly and handle retry, refresh, and placeholders.
What this covers
- Implementing PagingSource: load() by key, LoadParams, LoadResult.Page/Error/Invalid, and getRefreshKey()
- Configuring Pager with PagingConfig (pageSize, prefetchDistance, initialLoadSize, enablePlaceholders) and exposing Flow<PagingData>
- Why cachedIn(viewModelScope) is required to share and survive config changes
- RemoteMediator for network+DB paging: LoadType REFRESH/APPEND/PREPEND, MediatorResult, endOfPaginationReached
- Driving UI from LoadState/CombinedLoadStates and handling retry(), refresh(), and errors
- Compose: collectAsLazyPagingItems, itemCount, itemKey, placeholders, and insertSeparators/headers
Study this topic
- Paging 3 explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Paging 3 interview questions and answers