Problem
Design an ads audience targeting system that allows advertisers to upload large user lists and then target (or exclude) those users when serving ads.
Requirements
-
Advertiser can create
audiences
and upload membership data at large scale (e.g., millions to billions of identifiers).
-
Support common identifiers: email/phone (hashed), mobile ad IDs, internal user IDs.
-
Audience can be attached to ad groups/campaigns as
include
or
exclude
targeting.
-
During ad serving, given a user request, the system must quickly determine which audiences the user belongs to (or whether the user matches an audience) to filter eligible ads.
-
Handle incremental updates (add/remove users), audience expiration, and deletion.
Non-functional requirements
-
Low latency in serving path (typically single-digit milliseconds budget).
-
High throughput for ingestion.
-
Privacy/security: encryption, access control, audit logs, retention.
-
Multi-tenant isolation across advertisers.
Deliverables
Explain:
-
APIs and data flow for upload → processing → storage.
-
Storage/indexing approach for membership lookup at serving time.
-
How you scale ingestion and serving, and how you monitor correctness.
-
Tradeoffs (Bloom filters vs key-value lookup vs inverted index, batch vs streaming).