System design interview question
Design a Real-time Analytics Pipeline for User Activity Events (like Amplitude or Mixpanel)
Design a distributed system that ingests, processes, and queries user activity events at scale. The system must handle 500K events/second from 100M active users across 5 continents, with sub-second ingestion latency and ability to run complex aggregation queries (e.g., retention cohorts, funnel analysis) on data that's hours old. Events include: user ID, event type, timestamp, properties (JSON), session ID, and device metadata. The system must support multi-tenant isolation, real-time dashboards with 100+ concurrent users per tenant, and 90-day data retention with queryable historical access. Design for high availability (99.99% uptime), eventual consistency where appropriate, and cost efficiency at this scale.
Practice this question step by step with an AI interviewer that reviews your requirements, your architecture and your trade-offs, and scores the design.