← LinkedIn Interview Insights

LinkedIn·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Apr 2026

Summary

LinkedIn system design round for a software engineer role. The whole thing was one big question about trending topics, and it went deeper than I expected. Left feeling like I covered maybe 70% of what they wanted.

Questions Asked (1)

Q1

Design a system that continuously tracks the Top K most frequent items (tweets, search queries, clicks, etc.) over a sliding time window such as the last minute, hour, or day, at massive scale.

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

I started with the functional requirements which felt okay, multiple window sizes, per-region vs global aggregation, query latency targets.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements: what K, window sizes, and scale (QPS, cardinality). Then propose a distributed architecture that shards the stream, uses approximate counting (e.g., Count-Min Sketch) per shard, and merges results to get top K. Discuss trade-offs between accuracy, latency, and resource usage.

Pro tip: Emphasize that exact top-K over sliding windows at scale is impractical; instead, use approximate algorithms with bounded error and explain how to handle out-of-order events and window expiration.

1. Clarify Requirements and Constraints

Ask about K, window sizes, data volume, latency requirements, and accuracy tolerance. This scopes the problem and shows you avoid over-engineering.

2. High-Level Architecture

Propose a distributed pipeline: ingest (Kafka), process (stream processors like Flink/Spark Streaming), and serve (query layer). Shard by item key to parallelize counting.

3. Counting and Top-K Algorithm

Use approximate counting per shard (e.g., Count-Min Sketch) and a heap or Space-Saving algorithm to maintain local top-K. Merge shard results to get global top-K.

4. Sliding Window Handling

Implement windowing via bucketing (e.g., per-minute buckets) and aggregate over buckets. Use event-time processing with watermarks to handle out-of-order data.

5. Trade-offs and Optimizations

Discuss accuracy vs. memory, latency vs. freshness, and strategies like heavy-hitter detection, caching, and pre-aggregation to reduce load.

Key Points to Mention

  • Approximate algorithms: Count-Min Sketch, Space-Saving, Lossy Counting
  • Distributed sharding and merging of top-K results
  • Sliding window implementation via bucketing and event-time processing
  • Trade-offs: accuracy, memory, latency, and cost
  • Handling out-of-order events and late data
  • Scalability: partitioning, parallelism, and backpressure

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.