Pergunta de entrevista da empresa NVIDIA

How would you solve the Josephus problem.