Fixed-Capacity Cache with Least-Used Eviction
Asked at Salesforce · Coding Questions · Difficulty: Hard · Last asked Jan 28, 2026
Design a cache with a fixed capacity. When the cache is full and a new key arrives, it discards the key that has been used the fewest times, and among equally used keys the one whose last use is oldest. Both lookups and inserts must stay fast as the cache grows.
Loading the problem…
More Salesforce interview questions
- Campaign Cost Weekly Partition
- Design a Collaborative Spreadsheet (Google Sheets)
- AI / ML Fundamentals Oral Round (AI Engineer)
- Rate Limiter for Expensive API with User-Configurable Monthly Quota
- Hiring Manager + Behavioral Rounds
- Design an Async Job / Task System