### Am I good enough to be a programmer?

Pages: 123
I was reading this article in the articles section about interview questions and it got me to thinking about this brain teaser that i've seen on the internet and is supposedly to have been used as an interview test question for programmers at microsoft.

It goes something like this, I'm sure most of you have seen it:
4 people are to cross a bridge in the dark, but the bridge can only support 2 people at one time. The bridge is so narrow that they need to use a flashlight in order to cross so they don't fall over the sides. But they only have 1 flashlight. All 4 must cross the bridge in under something like 19 minutes, but each person can cross in a different amount of time. One person takes 10 minutes, another person 5, 1 person can cross in 1 minute and another person can cross in 2 minutes. (I might not be recalling the problem exactly... this is just as close to the original as I can remember without googling....)

Well the thing is when I first saw this problem I was stumped. after spending a long time on it, I finally decided it must be a trick question or a misprint. I actually tried working out a mathematical proof that it was in fact inpossible for them to cross in the amount of time specified. When I finally saw the solution I was amazed, even though I've seen this type of question before I couldn't figure out the answer. Even several times since when I had seen the problem again, I couldn't remember the answer and had to sneak a peak at the solution in order to figure it out.

I have been really frustrated because although I fancy myself an intelligent person, i have begun to doubt whether i'll ever be able to make the grade as a programmer. That and plus I'm still a beginner to c++ and programming in general I'm wondering is it even worth the effort to try to go back to college to get a degree in computer science or should I do something else with my life?
P.S. No need to be shy, I will be bracing myself for the honest, objective truth.
Grey Wolf posted this riddle a while back:

http://cplusplus.com/forum/lounge/23336/#msg122450

It tricked me for sure (as you can see in that thread)

EDIT:

Not being able to solve a brain teaser says nothing about your ability to program well.
Last edited on
I forgot to add: Its not so much that I'm worried about this one particular brain teaser, but given my status as a novice, and the facts of life of how competitive I'm surmising the computer programming industry to be, I wonder if I ever will truly have a chance to suceed. Most recruiters are looking for experienced programmers. But how am I going to get that experience if recruiters are only hiring experienced programmers. Plus because I'm older, 31, people will be even less likely to give me a chance at gaining some experience than someone whose younger and either still in or fresh out of college.
 only hiring experienced programmers

They may invent even uglier autrocity to disorder one's mind
having pleasure doing so. Those making the teasers have no
idea of what is actually going on in a company. They are just
being told to compile something according its bottom line.
The example shows that this one is keen to squeeze anything
out moving,sitting,standing in vicinity.
Questions like that are testing your problem solving skills. Some companies may expect/require you to come up
with the right answer on the spot while others (I suspect the majority) may be satisified without a correct answer
if you talk them through your thought process and demonstrate an ability to reason things out.

If you don't have industry experience, then just floating a vanilla resume on Monster probably won't land you many
opportunities. I would suggest showing initiative by actively seeking out companies yourself, writing a targeted cover
letter, and customizing a resume for that company that shows how your skills align to their objectives even without
industry experience. [So few candidates actually do this, that this alone will make your resume stand out.] Of course
you'll want to mention other things you've done, but you should focus your resume on the programming skills you've
self-taught.

In the programming world, no two jobs are exactly alike in terms of the "optimal background". For that reason,
companies should be looking for someone knowledgeable about C++ (or whatever language) independent of the
job-specific stuff. For example, you don't have to be a gearhead to write code to run on a car's computer that
controls engine parameters, etc. Such a company should expect to have to teach you about engines, etc on the
job.
 I forgot to add: Its not so much that I'm worried about this one particular brain teaser, but given my status as a novice, and the facts of life of how competitive I'm surmising the computer programming industry to be, I wonder if I ever will truly have a chance to succeed. Most recruiters are looking for experienced programmers. But how am I going to get that experience if recruiters are only hiring experienced programmers. Plus because I'm older, 31, people will be even less likely to give me a chance at gaining some experience than someone whose younger and either still in or fresh out of college.

I am in the same situation, except I am somewhat older than you. The book I am using to learn C++ is written by Bjarne Stroustrup. He writes about professional opportunities and says that very good coding skill are not enough to work professionally. You have to have a good understanding of the subject about which you are programming. If you are writing programs that are psychology applications, then you have to know psychology as well as C++. Stroustrup remarks that it is common to find programmers will degrees in non-computer fields, such as psychology.

I am hoping he is right. I will never be able to code as well as those who started doing it as teens. However, I have been teaching business for a good while. I hope some firm could use a programmer who understands how to compute the cost of equity using the Capital Asset Pricing Model and can write most of the code to do such a computation. (How many 20-something code monkeys understand that prior sentence?)

The role of computers is human society is still growing. That means programmers knowledgeable in many backgrounds will be in demand for many years.
To sum up...

wtf wrote:
Am I good enough to be a programmer?

Yes.
Good enough to be a programmer? Why, I daresay most people can be become programmers provided they have the endurance to get through learning the syntax and features of the language they wish to program in and the problem solving skills required to write programs to perform certain task (both can be learned). In short, yes. There were other teasers in that forum that stumped some programmers who I have little doubt as to whether or not they're good to excellent.

The worst case scenario is: You're not nearly creative enough, but you can always gain that creativity provided you have no mental handicaps, which you don't seem to.

-Albatross
Hey! Where have you been?
Hunting albatrosses. *irony*

No, actually I've been taking some time off the forums to work on my own projects. It's amazing how much time it takes to write a GCC front-end.

-Albatross
Talking about riddles and solving problems, try cracking this one (I already did):
There are 2 rooms, one contains 3 switches and the other one contains a light bulb. One of these switches is connected to the bulb. The other 2 are irrelevant.. the question is which. You are allowed to walk only once between the two rooms (from the switch room to the bulb room, only). It's impossible to see the status of the light bulb from the first room. (The rooms are placed like this:)

 ``12345678`` `````` _____ _____ | | | YOU | | | (1) |light| | (2) | bulb| | (3) | |_____|_____| ``````

Finally, you're allowed to take as much time in either room as you want and the time it takes on walking between the two rooms is negligible (takes 0 seconds).
Last edited on
Is there a roof? If not I would take a ladder then.
As a matter of coincidence I just happened to recently have been thinking about a very similar problem, the MONTY HALL paradox. This is not a perfect solution, but it does significantly increase your chances of guessing the correct switch that controls the light bulb. First pick a switch. There is a 33% chance that this is the correct switch. Now switch 1 of the other switches to the on position. Then walk to the other room. If the light is on, you know the switch you switched is conected to the light bulb. But if its off, we know From the Monty Hall problem, the switch you guessed initially has a 33% chance, but if you switch switchs you will have a 50% chance.

This is assuming of course that you know the state of the light bulb in the begining, otherwise if you switched a switch then walked to the other room how would you know if the light was on to begin with or not?
 you know the switch you switched

which one? you've switched two

 From the Monty Hall problem, the switch you guessed initially has a 33% chance, but if you switch switchs you will have a 50% chance.

The Monty Hall problem relies on the gameshow host knowing which door the prize is behind, so is inapplicable in this case.
to clarify what wtf meant:

pick a switch. Let's say we pick switch 1

you flip a different switch (let's say switch 2), then go to look at the room.

If the light turned on, you know it's switch 2.
If the light is still off, you know it has a 33% chance of being switch 1, and a 67% chance of it being switch 3.
Flip two switches- let's arbitrarily pick Switch 1 and Switch 3. Wait for about 15 minutes. Turn Switch 3 off. Go into the other room.
If it is is on, then it is Switch 1
If it is off, and cold, it is Switch 2
If it is off, and hot, it is Switch 3
nice
 If the light is still off, you know it has a 33% chance of being switch 1, and a 67% chance of it being switch 3.

This is the bit that relies on the host knowing the location of the prize in the Monte Hall problem. In the light switch case, each switch still has only 50% chance.
 This is the bit that relies on the host knowing the location of the prize in the Monte Hall problem. In the light switch case, each switch still has only 50% chance.

No, that is irrelevant.
Pages: 123