Someone shared the triangle puzzle below in a Facebook group. It's fairly straightforward but requires attention to detail and some imagination and logic. I thought this puzzle could be a simple test of whether or not someone would enjoy and probably thrive in programming. I think you can tell by asking yourself four simple questions.
1) Does the very idea of figuring out this puzzle appeal to you? Is this something that you would voluntarily do or do you find it bothersome or a waste of time? Do you like mental puzzles?
Programming involves figuring things out - how something can be done, or why something is not working or why it is working. A programmer is usually not just satisfied that something works, they want to know why, partly so that next time they face a similar problem they can fix it easily, but also partly out of sheer curiosity.
2) Are you able to visualise the triangles in your mind, or do you have to draw or mark them? Many times, a programmer has to visualise how a program would work, without actually writing out the program. Or they look at an existing program and imagine what would happen if someone ran it, thus figuring out possible loopholes or errors that might arise. It is often impractical to actually spend time writing possibly lengthy pieces of code, just to find out where the problem is. Sometimes other pieces of the system are not in your control, so you have to simply think about what would happen if you changed something on your end, without changing the other parts that are inaccessible to you.
3) If someone shows you the solution for one level of the triangle, will you be able to see the rest of them? Often when searching for solutions online, you may not find sample code that matches your exact problem. You may get something close, then you will need to apply the principles and the logic to your own program. You need to understand the principles and apply them as needed in your own situation.
4) Can you see the triangles? All of them? A programmer needs to have an eye for detail. Sometimes a missing comma or missing parenthesis may make your program not work as expected or not work at all.
So, how may triangles are there?
Top comments (0)