Top-K Frequent in Large Logs

Asked at Google · Coding Questions · Difficulty: Medium · Last asked Jul 19, 2026

Coding round staple: parse a log/chat stream and return the top-K most-frequent keys (users, IPs, words). The walk-through covers heap vs quickselect vs bucket sort, complexity, and scale-out follow-ups (large file, memory limit, distributed).

Loading the problem…