How do you handle #riddle #questions in an #interview?
Riddle was used as long as in the tale of Oedipus and the Sphinx.
Often there is not any right or wrong answer. It's all about the logic and a test of calmness under pressure.
Here is an excerpt from the book: How Would You Move Mount Fuji, by William Poundstone.
===
"Let's play a game of Russian roulette," begins one interview stunt that is going the rounds at Wall Street investment banks.
"You are tied to your chair and can't get up. Here's a gun. Here's the barrel of the gun, six chambers, all empty. Now watch me as I put two bullets in the gun.
See how I put them in two adjacent chambers? I close the barrel and spin it. I put the gun to your head and pull the trigger.
Click.
You're still alive. Lucky you!
Now, before we discuss your résumé, I'm going to pull the trigger one more time. Which would you prefer, that I spin the barrel first, or that I just pull the trigger?"
There is a logical answer to that ->
...
...
...
...
...
...
The spin-the-barrel option is the simpler of the two to analyze. There are two bullets in six chambers, or, to put it more optimistically, four empty chambers out of six. Spin the barrel, and you've got a four-in-six, or two-in-three, chance of survival.
For the other option, look at it this way.
Empty chambers are all contiguous. One of them just spared your life. For three of these four empty chambers, the "next" chamber in succession will also be empty. The remaining empty chamber is right before one of the two bullets.
That means you have a three-in-four chance of survival when you don't spin.
Three-fourths is better than two-thirds, definitely don't want the barrel spun again.
Pure Mathematics/CS @ ANU, Yale-NUS
1moIf this question is assuming the pieces are contiguous then there is no solution as the only contiguous piece containing 12 would have to be 11,12,1 and 2, since each of the pieces has to add to 1/3rd of the sum of the numbers 1-12, so each piece sums to 26. (You can verify why we can't start at 12 and go forwards). In this case however, starting from 3 and increasing there is no continuous subarray as 3+4+5+6+7=25. If we're assuming the pieces can be arbitrarily broken, then the solution is not unique, for example consider the segmentation [(11,12,1,2),(7,9,10),(3,4,5,6,8)] and [(11,12,3),(7,9,10),(1,2,4,5,6,8)] each are solutions. If we are considering them to be non contiguous but each piece is also of the same size (4 numbers), then a solution is [(11,12,1,2),(3,10,4,9),(5,8,6,7)], this is not unique as we can swap any two pairs of numbers in different pieces that sum to 13 can be swapped e.g. (3,10) and (5,8). There are however a finite number of solutions (clearly follows since there are finitely many permutations of 12 numbers ).