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?
If you had to build an image loading library like SDWebImage or Kingfisher yourself, how would you structure the components and the cache layers?
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.
ConcurrencyShort answerAdvanced
Using Swift Concurrency (async/await, actors), design the API of a network client that…
#deduplication #cancellation
CS fundamentals and algorithmsShort answerAdvanced
You need to write an in-memory image cache with LRU eviction yourself. Which data…
#image-cache #lru
PersistenceShort answerBasics
NSCache exists, so why do image libraries write their own LRU cache?
#image-cache #lru
NetworkingShort answerAdvanced
In a coding interview you're asked to build, in 30 minutes, an ImageManager that fetches…
#image-cache #cancellation