HLD prep is optimised for larger screens
Open on a laptop or desktop (1024px+) for the diagram canvas and the section sidebar side-by-side.
Problem Understanding
Restate the problem in your own words.
Design Top-K / Trending (real-time heavy hitters)
Design a 'top-K trending' service: hashtags, queries, products, or videos are ingested at high QPS, and the service returns the top-K by frequency over a sliding window with sub-second latency. The hard parts are accurate counting at scale (Count-Min Sketch + heavy-hitters), windowing that handles late events, and serving a dashboard that updates in near real time. Memory + accuracy are the dominating trade-off — you can’t hold every key in RAM.
- Twitter TrendingTrending hashtags, geo-segmented; updated minute-by-minute with anti-spam filtering.
- YouTube TrendingPer-region top videos; combines view velocity + diversity to avoid one creator dominating.
- Google TrendsSearch-trend dashboard with topic + geo facets; daily + real-time tabs.
- Reddit /r/popularCross-subreddit hot list; the canonical ‘time-decayed score’ ranking.
Your task: read the problem above, then write what the system is, who uses it, the rough scale, and the headline UX expectation — in your own words. Submit for AI review when you're ready.
Click any step in the sidebar to jump around — sections don't have to be done in order. Press ? any time to see all shortcuts.