CodingStatistics

Given a function roll() that uniformly returns a double between 0 and 1 and a array/list of numbers of length N (no duplicates), create a function shuffle() that returns a permutation of equal probability

Did you come across this question in an interview?

Interview question asked to Data Scientists interviewing at Transferwise, Deliveroo, Squarespace and others: Given a function roll() that uniformly returns a double between 0 and 1 and a array/list of numbers of length N (no duplicates), create a function shuffle() that returns a permutation of equal probability.