You have two system design prompts.
1) Design an ads click aggregation system
Design a service that ingests ad click events at very high QPS and supports aggregated analytics.
Functional requirements
-
Ingest click/impression events (at least clicks; optionally impressions) from multiple frontends.
-
Provide near-real-time aggregates such as:
-
clicks per
ad_id
/
campaign_id
/
advertiser_id
-
breakdown by time window (e.g., per minute, per hour, per day)
-
optionally by country/device
-
Support querying these aggregates via an API (and/or dashboard).
Non-functional requirements
-
High write throughput; scalable horizontally.
-
Handle duplicates and retries (idempotency).
-
Handle late/out-of-order events.
-
Clearly define consistency/latency targets (e.g., “within 1–5 minutes”).
2) Design a file storage + sync service (Dropbox-like)
Design a cloud file sync product where users can upload files, keep folders in sync across devices, and share files.
Functional requirements
-
Upload/download files and list folders.
-
Sync changes across multiple devices (near real-time).
-
Versioning (recover older versions) and deletion/restore.
-
Sharing via link and/or ACL-based sharing.
Non-functional requirements
-
Large files support (chunking/resumable upload).
-
Efficient storage (dedup/content-addressing acceptable).
-
Security (authn/authz, encryption).
-
High availability and scalability.
For both prompts, explain APIs, data model, major components, scaling strategy, and key trade-offs.