One of my common interview question is writing a function which takes a string like “2+2″ and returns an integer result.

I asked to do that for quite big set of rules initially (support several operators, multiple digit numbers etc.). However, it was overwhelming for candidates. As result I scaled it down to several simplistic cases.

I ask to write a method which can calculate “2+2″. And it takes them 30 seconds to do that. I ask them to change a solution to handle “2+2+2″. It takes them 3-4 minutes and next thing I ask to do “12+2+2″ (support of multiple digit numbers) or “2+2-2″ (support of operator minus). And boom… It takes them 30 minutes to do this.

The question is “Why?”

People are wired to always push forward. As result, they take their previous solution and try to hack it into a new one which will support this new requirement. As result, the solution become so messy and complicated by second or third time around that it’s impossible to update it.

However, all they need to do is to step back for one second and think about new problem and new solution (vs trying to hack the old solution).

Once upon a time, software engineers were a rare breed. There are dozen of millions of sw engineers now.

Once upon a time, you had to compete only with local software engineers. You are competing with people in Kuala Lumpur and Tunis now.

Once upon a time, you had to learn two programming language on one operation system and you was set for life. New languages, frameworks and tools pop up each year now.

Once upon a time, the information was a secret passed from masters to apprentices. A 12 year kid has access to the same info which has veteran engineer with 20 years of experience now.

You can be smart, but there will be millions smarter than you. You can be experienced, but there will be millions who are more experienced than you. You can work hard, but there will be millions who will worked harder than you.