Company: Wells Fargo
Difficulty: medium
Amania Secure Key Ring A company named Amania stores a critical key in a secure format. To make sure the key cannot leak from a single machine, the key is broken into pieces and stored on N systems that are wired together in the form of a ring. The systems carry unique IDs numbered 0 to N - 1 , placed around the ring in that order, and moving clockwise from system i leads to system i + 1 (and from system N - 1 back to system 0 ). A hacker infects the network with a virus that hunts for the key. The virus always moves clockwise around the ring and works with a fixed value K : It enters the ring at system 0 . Entering there does not affect system 0 , which is only the point the counting starts from. It then skips the next K - 1 systems that are still connected and affects the system after them, so the first system it affects is the Kth system it reaches, counting clockwise from system 0 . The counting wraps around the ring as many times as needed, so that first system is the one with ID