The dual-output requirement is what made this interesting.
Start by clarifying requirements: event types, scale (events per second), latency targets for real-time metrics, and batch processing needs. Then propose a high-level architecture with distinct paths for real-time and batch, and dive into each component (collection, transport, stream processing, storage) discussing trade-offs and choices. Finally, address scalability, fault tolerance, and data consistency.
Pro tip: Emphasize the importance of a unified event schema and idempotent processing to avoid data duplication or loss, and mention how you would handle late-arriving events in both paths.
Ask about expected event volume, latency requirements for real-time dashboard (e.g., sub-second vs. seconds), batch processing frequency, data retention, and consistency needs. This shapes technology choices.
Propose a scalable ingestion layer (e.g., HTTP endpoints, SDKs) that buffers and forwards events to a durable message queue like Kafka. Discuss partitioning, replication, and backpressure handling.
Use a stream processor (e.g., Flink, Spark Streaming, Kafka Streams) to compute metrics in near real-time, writing to a fast store (e.g., Redis, Druid, ClickHouse) for low-latency dashboard queries.
Persist raw events to a scalable, cost-effective store (e.g., S3, HDFS) in a columnar format (Parquet) for offline batch processing with frameworks like Spark or Hive.
Discuss how to scale each component, handle failures (e.g., Kafka replication, checkpointing in stream processors), and ensure exactly-once or at-least-once semantics with idempotent writes.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.