I can write programs but can't solve problems. What is going on?

3 points by ExtremisAndy ↗ HN
Here's the deal: I've been programming off and on for most of my life (currently in my 40s). While I've created a few basic web sites for money, it has mainly been a hobby for me, and one I greatly enjoy. I've written simple 2D video games (C++), simple chatbots (Python), quiz-generating systems(JS-PHP-MySQL), etc., so I'm not totally clueless about this stuff. However, there seems to be a very real, and quite frankly disappointing limit to what my brain is able to do. For example, I have recently joined HackerRank, and have been working on several of the problems. I don't know what it is, but for some reason even some of the problems marked easy are incredibly hard for me to figure out. While I've successfully answered the majority of the problems I've attempted there, there are some that, based on the number of successful submissions and the rank of easy MUST be simple and yet I've spent sometimes 2 hours on those and cannot produce a program that passes all the tests. That's very discouraging because I want to become a better programmer but I feel I may have reached the limit of what my brain can do. Has anyone experienced anything like this? If so, were you able to figure it out and improve your problem-solving skill set? Thanks for any advice you could offer!

6 comments

[ 3.3 ms ] story [ 17.6 ms ] thread
I feel that problem solving isn't a skill, problem recognition is. You have issues with how you categorize your information.
Perhaps try to categorize the types of problems that are giving you trouble and really narrow down the core concepts that are the issue; you either might have never learned the appropriate prerequisites, or simply just learned it from a different angle, if you will.

That said, some peoples brains are just wired differently. You might find other difficult things easy, that others who completed the easy ones struggle on.

Many programming puzzles are simply formulations of classic problems that have well-understood solutions, which students in any Computer Science degree program are taught.

I'm guessing you do not have a CS degree?

I don't think you need to get a CS degree, but you should get a bunch of syllabi from various CS programs, and get all of the material and study it.

I think this is basically the whole story. I think the fact that I have learned several programming languages (not expert level, but certainly to the point I can use them to make projects that benefit my life and the lives of others) has fooled me into thinking I should know a lot more about programming than I do. But if I'm honest, what I have essentially done is taken a bunch of 100 level programming courses, just in a variety of languages. I need to spend time studying the more difficult concepts that can be applied to all languages. Thanks for the advice! :)
Language mastery is only a small part of the overall process.

You can be fluent in Spanish, but until you've read a lot of Spanish literature and written a lot of questionable quality Spanish prose yourself, you won't be writing any great literary works. Studying the writing of others--particularly the great masters--is one short path to developing that.

How much code do you read on a daily basis? A lot of programmers spend time writing a lot of code, but not many spend time reading code: especially really well-written code, or code that solves a problem really elegantly.

But, yeah, I think you get the idea...

Read either CTCI or Elements of Programming Interviews. The key is knowing that the problems you’ll be presented with aren’t as novel or random as they might seem. The same general topics and problem classes come up over and over, and once you can recognize them you can learn to solve them. It’s really hard, but it’s a matter of effort, not intellect (or at least not solely intellect).