Daily iOS
iOS system design

Image loader and cache library

If you had to build an image loading library like SDWebImage or Kingfisher yourself, how would you structure the components and the cache layers?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Look up by URL key, memory → disk → network: decoded bitmaps in the memory cache (LRU by bytes), raw data in the disk cache (bounded by size and age). Handle cell reuse with Task cancellation and decode by downsampling to the display size.

Share a question