Fixed-Capacity In-Memory Image Cache

Asked at Mobile · Mobile Engineering (Android/iOS) · Difficulty: Medium

Design a fixed-capacity cache that keeps recently used items in memory and drops the least-recently-used one when it is full. An image-loading library uses exactly this kind of cache for decoded bitmaps.

Loading the problem…