2dbi
Home/HashiCorp/Word Count / Log Aggregation
HHashiCorp·DSAEngineerTechnical Phone Screen

Word Count / Log Aggregation

Problem

Given a stream of lines, count word frequencies and return the top-k.

Example

lines -> top 3 words by count

Constraints

  • Stream may be large

Approach

Map of counts + heap. Discuss memory bounds for very large input.

added 6 days ago
LeadersAccount