daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest May 20th, 2018 106 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Implement a cache class that stores given item. The cache is limited to a given `size` and will discard the
  2. // least recently used item if it needs the space.
  3. //
  4. // Clearly document design choices, algorithm and possible optimizations.
  5. // While we require you to implement one memory allocation algorithm,
  6. // also document future looking design considerations.
  7. //
  8. // Implementation Notes:
  9. // * While the interface below is written in Python, feel free to implement the Cache in the language of your choosing.
  10. // * Do not use standard library data structures - write your own. (like Python's `collections` module etc.)
  11. //
  12. // *** Requirements ***
  13. // 1. Working code (obviously).
  14. // 2. Unit tests (using a unit testing library of your choosing)
  15. // 3. Documentation (as describe in the 2nd paragraph above)
  16. //
  17.  
  18. class Cache(object):
  19.   def __init__(self, size):
  20.     pass
  21.  
  22.   def get(self, key):
  23.     pass
  24.  
  25.   def set(self, key, value):
  26.     pass
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top