โ† Amazon questions

Play all songs once with random selector

Filed under Amazon

Given an array of n songs and helper functions play_song(song_id) and get_random(n), design an algorithm to play all songs exactly once using unbiased random selection.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.