1. Design Spotify
Design the Spotify service focusing on system architecture and functionality.
2. Implement Song Shuffler
Implement a Song Shuffler. Given an input list of songs and a cooldown period, ensure that when shuffle() is called, it returns a song. The cooldown period means that if shuffle() returned a song, that song cannot be returned again until the cooldown has passed. For example, with songs = [1,2,3,4,5] and cooldown = 1, the shuffle() calls might return 1, then 2, then 3, then 1 again. The follow-up question is how you would modify the code if the cooldown is 2 or greater.
3. Design a Web Crawler
Design a Web Crawler with the following constraints: each domain can only be crawled once per second, and different domains have different priorities. How would you ensure that higher priority domains are processed first?