Question
Design the cross-device 'liked songs' / playlist-membership set for a music service where a user adds and removes tracks from their library on phone, desktop, and car simultaneously, often offline. Two devices can concurrently add the same track and concurrently one adds while another removes it; the merged result must be intuitive (an add concurrent with a remove should keep the track, not silently drop it) and must converge across all devices with no central lock. Scale: 600M users, a power user has 50k liked tracks, devices reconnect after hours offline. Choose the replicated set type, define the add/remove semantics precisely, and explain how you keep metadata (tombstones/tags) from growing without bound.
Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts — data model, bottlenecks, consistency, failure modes — and name the trade-offs you are making.