Design a Word Count for 50 billion docs
hash(term)%r gives random server for term. If I change the hash((ord(term[0])-ord('a'))//3), starting a, b, c terms storing in server 1, def storing server 2. Totally, you needs to have 26//3…
hash(term)%r gives random server for term. If I change the hash((ord(term[0])-ord('a'))//3), starting a, b, c terms storing in server 1, def storing server 2. Totally, you needs to have 26//3…
1. Inverted Index in memorySmall amount of data that you can load all terms and docid in memory21bytes terms on avg and 1000 docids with 4 bytes int. And if…
Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.Implement the LRUCache class: LRUCache(int capacity) Initialize the LRU cache with positive size capacity.int get(int key)…