Google interview question

Create an algorithm for shuffling a deck of cards.

Interview Answer

Anonymous

10 Apr 2015

I created a solution that simply swapped two cards randomly over and over, thousands of times. While this technically would shuffle it, it was incredibly inefficient, so the interviewer guided me towards a better solution.