Voleon·Software Engineer·Technical Phone Screen
- Given a Kac ring model (balls moving clockwise around a ring, flipping color when passing a marked point), implement a function that advances the simulation by exactly k steps in O(1) time, without calling the single-step function k times. The color query function must also remain O(1) after any mix of single-step and multi-step calls.
“The core insight is that after N steps every ball is back where it started, so the net color state only depends on k mod N and how many marked points each ball crosses in that span.”