← Questions
Thread-safe tally counter with bounded memory
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Build a tally service that many threads call at once to count occurrences of keys, and that answers queries for counts. Memory is bounded, so it cannot keep every key forever. Make the updates thread-safe without one global lock becoming the bottleneck, and explain what you give up when memory runs out.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding
