← Visa questions

Open Locks After N Passes

Filed under Visa

There are N doors (locks), initially all closed. You make N passes through the doors. On the i-th pass, you toggle every i-th door. Find how many locks are open after N passes. (This is the classic…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Visa questions

Collected from public candidate posts and coding forums. Updated Nov 2026.