System Design: User Behavior Monitoring System
You are asked to design a monitoring/analytics system that collects user behavior events from clients (e.g., app install, user clicks, etc.). The system must support:
Functional requirements
-
Real-time monitoring
: show near-real-time metrics on dashboards (e.g., installs per minute, click-through rate).
-
Raw event retention
: store
raw events
for large
offline/batch jobs
(e.g., daily/weekly aggregation, deeper analysis).
-
Metric discovery/confirmation
: you should clarify with the interviewer which exact product metrics are needed (assume multiple counters/ratios, grouped by dimensions like platform/app version/country).
Non-functional requirements (assume typical expectations)
-
Handle
high write throughput
(many clients emitting events).
-
Low-latency
updates for dashboards (seconds-level is acceptable unless otherwise specified).
-
Scalable
storage and compute.
-
Reasonable correctness
for aggregates (be explicit about tradeoffs: at-least-once vs exactly-once, late events).
Out of scope
-
System/infra observability metrics like host reliability/latency are
not required
unless you want to briefly mention them.
Design the architecture, key components, data flow, storage choices, and how you compute/serve real-time metrics vs offline analytics.