Daily iOS
iOS system design

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.

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

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.

Share a question