Image Loading (Coil & Glide)
DATA › Networking
Loading, caching, and decoding images asynchronously in Compose and RecyclerView lists.
Image loading is a staple Android interview topic because nearly every app shows remote images, and naive bitmap handling causes OOM crashes and janky scrolling. Interviewers test whether you understand asynchronous loading, the two-tier memory/disk cache, request cancellation on recycled views, and the trade-offs between Coil (Compose-first, Kotlin/coroutines) and Glide (legacy, View-based). Expect questions on downsampling, lifecycle awareness, and avoiding wrong-image bugs in lists.
What this covers
- Coil vs Glide: Compose-first coroutines library vs mature View/RecyclerView library
- Two-tier caching: in-memory bitmap cache plus on-disk byte cache, and cache keys
- Async loading in lists without leaks: request cancellation on recycled/detached views
- Downsampling and resizing bitmaps to the target size to avoid OutOfMemoryError
- Compose APIs: AsyncImage, rememberAsyncImagePainter, SubcomposeAsyncImage
- Placeholder, error, crossfade, and transformations (CircleCrop, RoundedCorners)
Study this topic
- Image Loading (Coil & Glide) explained: the guided lesson
- 14 practice quiz questions
- 9 revision flashcards
- Image Loading (Coil & Glide) interview questions and answers