WorldQuant interview question

Josephus Problem... You could find it on Wikipedia