Jane Street Interview Question
You have 100 light bulbs, labeled from 1 to 100. Initially, all of them are off. You perform 100 rounds of toggling: On round 1, toggle every bulb (they all turn on). On round 2, toggle every 2nd bulb (bulbs 2, 4, 6, …). On round 3, toggle every 3rd bulb (bulbs 3, 6, 9, …). ... On round 100, toggle bulb 100. Toggling a bulb means: if it's on, turn it off; if it's off, turn it on. Question: After all 100 rounds, which bulbs are on?
Unlock the Full Solution
Enter your email to get instant access to the complete solution, explanation, and similar practice problems.