NVIDIA Interview Question

How would you solve the Josephus problem.