WorldQuant Interview Question

Josephus Problem... You could find it on Wikipedia