Logger that reports its top K messages

0
Remix

Build a logger that receives messages over time and can return the k most frequent messages at any point. Choose structures so logging stays fast and the top-K query is efficient, and discuss what changes if only recent messages should count.

GoogleTechnical phone screenLast asked Jan 2026
No answer yet. Write the first one; the best answer gets endorsed.