I jumped straight into talking about Kafka and streaming before realizing they said hourly, not real-time.
Start by clarifying requirements (scale, latency, data sources, dashboard refresh) and then propose a high-level architecture with ingestion, processing, storage, and serving layers. Focus on how to compute top-K frequent requests per country in a scalable, cost-effective way, and discuss trade-offs between batch and stream processing.
Pro tip: Emphasize that the dashboard only needs approximate top-K results, so you can use probabilistic data structures like Count-Min Sketch to reduce memory and cost, and mention that you'd validate accuracy against exact counts periodically.
Ask about data volume, number of countries, latency tolerance, and whether the dashboard needs exact or approximate counts. Also confirm the definition of 'frequent' (e.g., top 10 per country).
Propose ingesting raw Alexa request logs from a scalable source like Kinesis or Kafka, ensuring partitioning by country for parallel processing. Mention handling late data and duplicates.
Decide between batch (e.g., hourly Spark job) and stream (e.g., Flink with tumbling windows) processing. For hourly refresh, a micro-batch approach with windowing is suitable; discuss trade-offs.
Use a distributed aggregation to count requests per country and request type, then select top-K. Consider using Count-Min Sketch for memory efficiency or exact counts if scale permits.
Write aggregated top-K results to a low-latency store like DynamoDB or Redis, and expose via an API for the dashboard. Ensure the dashboard can query the latest snapshot.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.