Help Solving a Logic Puzzle

Associate
Joined
20 Sep 2003
Posts
2,384
Location
Scotland
Hi All,

I am looking for some help with a logic puzzle I was presented with at a recent coding challenge. I was given 10 minutes to read and solve the puzzle and I cannot see how it should work out and relate to the flow chart on the left. Can any fellow programers tell me how you would attach the puzzle and what the answer is?

I cannot understand how any of the suggested answers are possible and how I should relate my answers to the flow diagram provided. I would appreciate any help with it.

https://imgur.com/a/qMQ425z#eNvAESc


Thanks
 
Well this is the thing. I am not sure, I initially thought it meant put the number into the box i.e. divide the existing number in the box by the new number. But I think it means replace the existing number in the box by the new number.

It could mean many things, so thats what I have stuck it out there for other folks opinion as I am totally confused. I failed this part of the challenge but passed the actually coding piece.
 
Following the loop I get to 55 but I guess you're being expected to figure out a short cut

Edit - I was completely replacing the numbers

Anyway you could explain or detail how you got that answer?...... it was more about the thinking of how you get to the answer than the actual answer.

Would appreciate that, thanks :)
 
Thanks for all the answers folks, really appreciate the breakdown of the puzzle. I must admit I still find it hard to get my head around so I will take this away and have a look at it in more detail.

To give this some more context I was applying to a code training academy and my code was legit but they hit with this puzzle at the end. I have literally only started JS programming so I a personally feel this was a little tricky to be given in an interview situation and given 10 minutes to solve.

From your guys experience would you say the puzzle is aimed at a total beginner or an intermediate style programmer?....... I feel hard done by as my actual code was ok but I was rejected based on this puzzle.
 
I was able to identify that the flow chart had an endless loop unless the program was able to move past stage 3. I guess you need to have a logical thinking brain or programming approach to situations. I thought I would be able to learn how to program and then the course would then help me understand how to think like a programmer.

I am able to reapply in 6 months but if I cannot get past this stage then I feel I am not cut out to be a programer. Is this something I can learn or should I give up now?

To give more background to this I have been a Business Analyst for the past 10 years and have unfortunately been out of work for the past 8 months but I thought I would try and transition to a developer. I feel I am more of a geek than a people person with great communication skills which is a key part of being a BA.

Anyway I appreciate your guys input.

I have been working through some coding tutorials and have been messing around with ideas http://cruitme.com/javascript/
 
Back
Top Bottom