Design a System for Tracking Daily Active Users (DAU)

System Design
Medium
Meta
38.7K views

Design a high-volume system to accurately count unique Daily Active Users (DAU) across various product surfaces. Discuss using probabilistic data structures like HyperLogLog.

Why Interviewers Ask This

Interviewers at Meta ask this to evaluate your ability to balance accuracy with massive scale. They specifically want to see if you understand the trade-offs between exact counting and probabilistic algorithms like HyperLogLog when handling billions of events daily. It tests your grasp of distributed systems, data consistency, and resource optimization under strict latency constraints.

How to Answer This Question

1. Clarify Requirements: Define DAU precisely (unique user per day) and estimate scale (billions of requests). Ask about acceptable error rates since exact counts are impossible at this volume. 2. High-Level Architecture: Propose a flow where user events hit an ingestion layer like Kafka, then move to a processing cluster. 3. Core Algorithm Selection: Introduce HyperLogLog as the primary solution. Explain that it uses constant memory to estimate unique values with minimal error, unlike sets which would consume too much RAM. 4. Aggregation Strategy: Detail how to merge HLL sketches from multiple nodes using bitwise OR operations to get a global count without moving raw data. 5. Edge Cases & Validation: Discuss handling time zones for 'daily' definitions and validating results against sampled exact counts to ensure accuracy remains within bounds.

Key Points to Cover

  • Explicitly choosing HyperLogLog over exact sets due to memory constraints
  • Explaining the merge mechanism using bitwise OR operations for distributed aggregation
  • Defining clear requirements regarding error tolerance and time zone handling
  • Demonstrating knowledge of streaming architectures like Kafka and Flink
  • Proposing a validation strategy to compare probabilistic estimates against exact samples

Sample Answer

To design a system for tracking Daily Active Users at Meta's scale, we first need to define our constraints. We are likely dealing with tens of billions of daily events across Facebook, Instagram, and WhatsApp. Storing e…

Common Mistakes to Avoid

  • Suggesting simple database counters or Redis sets which will fail under massive scale due to memory limits
  • Ignoring the distributed nature of the problem and proposing a single-node solution
  • Failing to explain how to aggregate results from multiple nodes to get a global count
  • Overlooking the definition of 'Daily' regarding time zones and daylight saving adjustments

Sound confident on this question in 5 minutes

Answer once and get a 30-second AI critique of your structure, content, and delivery. First attempt is free — no signup needed.

Try it free

Related Interview Questions

Browse all 165 System Design questionsBrowse all 71 Meta questions