Design a real-time ad impression aggregator
MetaSoftware Engineer · Technical ScreenLast updated
This question evaluates a candidate's ability in scalable real-time system design, covering competencies such as stream processing, event aggregation, time-windowed metrics, handling late and out-of-order events, and designing for very high write throughput.
Design an ads impression aggregator service with the following requirements:
- The system ingests a high-volume stream of impression events (each event at least contains
ad_idand event timestamp; you may add fields like request_id/device_id for dedup). - The system must provide near real-time updates within 30 seconds.
- It must expose per-ad impression counts aggregated by hour (e.g., counts for
ad_id=123for2026-02-23 10:00-10:59). - Discuss how you would store/serve these aggregates and handle late/out-of-order events.
Follow-up: How do you handle very high write throughput to the database/storage layer?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.