Download manager
Design a shared download manager for the app. Requirements: tasks can run serially or in parallel with a cap on concurrency, and it must not be coupled to the calling modules.
Design a shared download manager for the app. Requirements: tasks can run serially or in parallel with a cap on concurrency, and it must not be coupled to the calling modules.
A DownloadManager actor schedules with a priority queue and a concurrency counter, and the actual transfer is done by URLSession downloadTask (background configuration where needed). Results are exposed through a Downloadable protocol and AsyncStream progress to decouple callers, and the disk cache evicts by LRU/LFU using SQLite metadata.
CS fundamentals and algorithmsShort answerAdvanced
You need to write an in-memory image cache with LRU eviction yourself. Which data…
#cache #lru
CS fundamentals and algorithmsShort answerAdvanced
You've implemented an LRU cache and the interviewer follows up: "Now make each entry…
#cache #lru
PersistenceMultiple choiceBasics
You picked LRU for an image cache. Select all the correct statements about LRU.
#cache #lru
PersistenceMultiple choiceAdvanced
Someone proposes moving the image cache from LRU to LFU. Select all the correct…
#cache #lru