← Goldman Sachs questions

Return random element from list with equal probability

Filed under Goldman Sachs

Given a list of elements and a random function that returns a float in [0.0, 0.999999], return a random element from the list with uniform probability.

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 Goldman Sachs questions

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