Skip to content

Instantly share code, notes, and snippets.

@rendon
Created July 4, 2017 03:35
Show Gist options
  • Save rendon/dcde479eb957a7ad1f4b6f330d3091b7 to your computer and use it in GitHub Desktop.
Save rendon/dcde479eb957a7ad1f4b6f330d3091b7 to your computer and use it in GitHub Desktop.
Interview problem
Implement a LRU (Least Recent Used) cache.
Your system queries a database for every request from your clients, you want to
serve your clients as fast as possible, in order to that you will implement a
cache on top of the database, this cache can store up to 100,000 results and
the eviction policy is LRU, that is, when the cache is full, you will remove
the least-recent used record.
You're implementation should be as efficient as possible because this will be a
critical component of our system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment