Pergunta de entrevista da empresa Vrbo

Design a card, a deck of card in OOP and write shuffle method assuming you have a random function. Write the code

Resposta da entrevista

Sigiloso

16 de nov. de 2010

Shuffle method is tricky if you don't know the answer. Randomly select a card from 0 to i with i initialized to 51, swap that card with the the card at i-th index. Decrement i and continue until i == 0

1