Company: Rippling

Difficulty: easy

Problem Statement

Song Play Analytics Problem Description Design a system that tracks song plays on a music streaming service and reports analytics based on the number of unique listeners per song. The system starts empty and processes a sequence of operations: ADD <name> — adds a song with the given name . Songs receive auto-incrementing IDs starting from 1 in the order they are added. Print the ID assigned to this song on its own line. PLAY <song_id> <user_id> — records that user user_id played the song with ID song_id . If no song with that ID exists, print exactly Error: Song ID <song_id> does not exist. (with <song_id> replaced by the ID that was given) and ignore the operation. Otherwise nothing is printed. A user is counted once per song, no matter how many times that user plays it. REPORT — prints one line for every song currently in the system (including songs that have never been played), in the format <song_name> (<count> unique list

More Rippling OA questionsInterview experiences