Pergunta de entrevista da empresa Microsoft

Write code that would shuffle a deck of cards. Explain why your solution is optimal and how you would test it.