Software Developers Interview Questions

96,234 software developers interview questions shared by candidates

They asked me puzzles which i think is the most unexpected and toughest part for me.(But somehow i managed to answer the puzzles) THE PUZZLE IS->> Over at your local high school, the main hallway has a bank of 100 lockers. All of these lockers, labeled 1 through 100, start with their doors closed. The resident class clown decides to open every locker door. He then returns to the front of the row and toggles (opens/closes) every 2nd locker door (2,4,6,8...) in the hallway. That is, he goes to every 2nd locker, if it's open, he closes it, if it's closed, he opens it. The class clown repeats this for every 3rd locker (3,6,9...), then every 4th locker (4,8,12...), then every 5th (5,10,15...), etc. until he finally repeats for every 100th locker. After the class clown is done, which locker numbers will end up closed, which will end up open?
avatar

Software Developer

Interviewed at Lam Research

4.1
Jul 19, 2013

They asked me puzzles which i think is the most unexpected and toughest part for me.(But somehow i managed to answer the puzzles) THE PUZZLE IS->> Over at your local high school, the main hallway has a bank of 100 lockers. All of these lockers, labeled 1 through 100, start with their doors closed. The resident class clown decides to open every locker door. He then returns to the front of the row and toggles (opens/closes) every 2nd locker door (2,4,6,8...) in the hallway. That is, he goes to every 2nd locker, if it's open, he closes it, if it's closed, he opens it. The class clown repeats this for every 3rd locker (3,6,9...), then every 4th locker (4,8,12...), then every 5th (5,10,15...), etc. until he finally repeats for every 100th locker. After the class clown is done, which locker numbers will end up closed, which will end up open?

Viewing 1201 - 1210 interview questions

Glassdoor has 96,234 interview questions and reports from Software developers interviews. Prepare for your interview. Get hired. Love your job.