bugfree Icon
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course
interview-course

System Design Question

Design an Ad Click Aggregation System

bugfree Icon

Hello, I am bugfree Assistant. Feel free to ask me for any question related to this problem

Functional Requirements:

  • Ingest ad click events in real-time from users.
  • Aggregate click counts for each ad within a configurable time window (e.g., last M minutes).
  • Provide an API to return the number of clicks for a specific ad within a given time range.
  • Provide an API to return the top N most clicked ads within a specified time window.
  • Support filtering of aggregated data by dimensions such as user_id, IP, or country.

Non-Functional Requirements:

  • Scalability: System should handle high throughput (e.g., up to 1 billion clicks per day).
  • Low Latency: Aggregated results should be available within a few minutes of event arrival.
  • Fault Tolerance: System should recover from failures without data loss or duplication.
  • Data Deduplication: Ensure duplicate click events are not double-counted.
  • Monitoring: Track system health, latency, and throughput for operational visibility.

System Design Diagrams

Zoom In and Out via trackpad or posture