Help Solving a Logic Puzzle

The description of the puzzle states that it's okay not to get the correct answer in the 10 minutes, which implies that they are looking to see how you reached your answer. They want to see if you are able to work out how to approach the puzzle, and also if you can explain your throught process to someone else.

I've just solved the problem by grabbing a pen and drawing the 12 boxes out on a piece of paper and then writing the current values underneath. Then follow the flowchart - as a value get's replaced in a box (or variable), write the new value underneath. The resulting paper looked something like this:

Code:
|  1 |  2 |  3 |  4 |  5 |  6 |  7 |  8 |  9 | 10 | 11 | 12 |
-------------------------------------------------------------
   2    1    4    4    6    5    2   12    5   19    1    0
                  1              4              9   55
                  3              3
                  5              9
                                 8
                                64

...with 55 in box/variable 11.

(I spent far too much time formatting that!)
 
I looked at it like an easier than basic algebra sum, insert number as required and replace existing number in the box with the new value. I wrote it down on the back of a KFC receipt :p and it looks the same as @ZombieFan posted above.
 
I've just solved the problem by grabbing a pen and drawing the 12 boxes out on a piece of paper and then writing the current values underneath.

That's how I did it. It's fairly straightforward if you just write it down and follow the steps properly and I've not done any coding since uni.
 
Why is this a coding thing?

I've never done any coding and got the answer 55 in a couple of minutes, didn't seem difficult :p

It's a logic thing to see if you can follow basic instructions as well as the flow diagram, it's not programming specific but a lot of logic tests are used for recruitment at times.
 
Why is this a coding thing?

I've never done any coding and got the answer 55 in a couple of minutes, didn't seem difficult :p

90% of coding is just working out the logic of what your code needs to do. Translating the logic into actual code is the easy bit.
 
@Op I think you've been overthinking it massively. It's literally follow some very basic arithmetic instructions until you reach on of 4 desired numbers.
 
@OP this is demonstrating a while loop (or do while) by the looks of things :)

After the first loop, assume i is set to 1

WHILE (i != 9)
{
The code that changes the value of box 7 (call it b)

i+=2
}

print b -5

That was my rough take as a learner
 
Back
Top Bottom