View counting seems simple but gets complex at scale. What counts as a view? YouTube: + seconds watched. Challenges: bot detection, duplicate counting, real-time vs batch.
Architecture: client sends heartbeats every s. Stream processor aggregates. Approximate counting (HyperLogLog) for unique viewers. Batch jobs reconcile final counts. Display slightly delayed counts to prevent gaming.