educative.io

Educative

Question about sliding window with counters?

Could you please elaborate on this point ???

" We can store our counters in a Redis Hash since it offers incredibly efficient storage for fewer than 100 keys. When each request increments a counter in the hash, it also sets the hash to expire an hour later. We will normalize each ‘time’ to a minute."

I just don’t understand how eviction for timestamp happening in the nested hashtable? I am referring to the image in the design

Good question though…I guess that must be something like :
Map<String, TreeMap<Time, Integer>>