Build a Count-Min Sketch
min across hashed counter rows
Challenge 3 of Probabilistic StructuresIntermediate~45 min
Count frequencies in a stream using a fraction of the memory a hash map would need. Build the sketch grid, add and query with the min-across-rows trick, prove it never under-counts, and merge two sketches, the probabilistic counter behind heavy-hitter and traffic-analytics systems.