Guest User

Untitled

a guest
May 20th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment