Design a DAU/MAU metrics system
VantaSoftware Engineer · OnsiteLast updated
A Vanta software-engineer system-design interview question: design a scalable pipeline to compute and serve DAU and MAU engagement metrics for a large consumer app. It tests event ingestion, identity and de-duplication, exact vs. approximate distinct counting (HyperLogLog/bitmaps), handling of time zones and late/out-of-order events, streaming-vs-batch correctness, dashboard serving, and monitoring/privacy.
Question
Design a system that computes and serves product engagement metrics — DAU (Daily Active Users) and MAU (Monthly Active Users) — for a large consumer application.
An "active user" is a distinct user who performed at least one qualifying event (e.g., app open, page view, login, session start) within the time window.
Your design should address:
- Metric definitions. DAU is the number of unique active users per calendar day. For MAU, choose and justify one interpretation — calendar-month uniques or a rolling 30-day window — and explain the trade-off with the other.
- Event ingestion and data modeling. Accept activity events from both web and mobile clients. Specify the required event fields.
- De-duplication and identity. Handle duplicate events; define the canonical user key across
user_id,device_id/anonymous_id, and logged-out users. - Accurate DAU/MAU computation. Address time-zone/day boundaries, late-arriving events, out-of-order events, and backfills.
- Storage and compute choices at large scale. Justify your streaming vs. batch and exact vs. approximate counting decisions.
- Serving queries and dashboards. Support near-real-time dashboards for product and leadership teams plus historical queries by date range, platform, country, and app version. Discuss latency, caching, and correctness guarantees.
- Monitoring, data quality, failure handling, and privacy. Cover anomaly detection, reconciliation, fault tolerance, and PII/retention controls.
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.