Find the most frequent errors in a log too big for memory

HardConcept25 minSWEREPro outline

The question

A service writes billions of log lines a day. Find the top 10 most frequent error messages using a fixed, small amount of memory, in one pass.

Describe your approach, then sketch the code.

What the interviewer is looking for

  • Normalises messages into keys first
  • Knows exact counting does not fit
  • Uses a streaming summary such as Misra-Gries or count-min sketch with a heap
  • States the error guarantees
  • Offers an exact second pass if needed

Your answer

Saved in this browser only. Nobody else sees it.

Why this question

Written by BlogLLM in the style of a publicly reported Anthropic question type: an LRU cache with constant-time operations, or parsing a stream or log with bounded memory.

Reported in: techinterview.org

Practice question written by BlogLLM based on publicly reported interview formats. Not an official Anthropic question.