DailyDispatchOnline

Bringing You the Daily Dispatch

Can you figure it out? Do you approach problems like a software engineer?
Science

Can you figure it out? Do you approach problems like a software engineer?

This puzzle is a common interview question for programming jobs. I hope it challenges you.

The loopy labyrinth

You find yourself confined in a dim subterranean passage. It follows a never-ending circular route, but its length is unknown. The walls of the tunnel have switches spaced evenly and consistently, which can be switched between two states: up or down. Aside from these switches, there are no other objects present in the tunnel. As you walk through it, you are unable to determine the speed at which the path is curving. Luckily, you have a pencil, paper, and a reading light at your disposal, allowing you to record any numbers that may be relevant.

What is the method for determining the amount of switches in the tunnel?

Explanation: You are prohibited from discarding any of your garments or belongings onto the ground.

I will return at 5pm UK time with a solution. Please refrain from sharing spoilers. Instead, let’s talk about our favorite software engineers.

UPDATE: Read the solution here

Thanks to Brian Rabern, Reader in Philosophy at the University of Edinburgh, for suggesting this puzzle, which he uses in his class “Puzzles and Paradoxes.”

The Royal Statistical Society is hosting their 30th anniversary edition of the Christmas Quiz, which is open until Monday, January 29th. Puzzle enthusiasts will be especially intrigued by this challenging quiz. If you are able to score over 30%, you will have the opportunity to donate a portion of the £900 prize to a charity of your choice.

I have been posting a puzzle every other Monday since 2015. I am constantly searching for excellent puzzles. If you have any suggestions, please email me.

Source: theguardian.com