Are Strings Anagrams?

Anagram = all letters can be reused to create another word. Approaches Approach 1: sorting (nonintuitive to me) An anagram is produced by rearranging the letters. Sort the letters alphabetically for the two strings. The sorted strings should…

Consistent hashing

Before diving into consistent hashing, let's understand the naive approach first. Naive: Distributed hashtable based on modulo Sharding can be achieved via a simple modulo shardNumber = hash(key) % TOTAL_SHARDS The hash function might differ…