Search
⌘K

Song Shuffler

Design an algorithm to shuffle a playlist of songs such that each song is played once in a random order. The algorithm should ensure that the shuffle is unbiased and each permutation of the playlist is equally likely.

Asked at:

Amazon

Amazon

Google

Google


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early February, 2026

Amazon

Amazon

Senior

Write code to create song playlist with functions to add and remove songs from playlist

Early January, 2025

Google

Google

Junior

Play songs in order: Given n people with specific song orders, find if a valid order exists that satisfies all preferences (topological ordering problem).

Late December, 2024

Google

Google

Mid-level

Song Shuffler

Comments

Your account is free and you can post anonymously if you choose.