Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

At the moment, the only times I try solving programming puzzles are:

  • When I'm bored
  • When I happened to find an interesting puzzle, while not actually searching for such (e.g. someone asked about such a thing at SO)

I would probably get better effects (become better at them) if I solved them routinely. Do you solve puzzles routinely (e.g. one problem at Project Euler or somewhere else per day) and/or would you recommend others to do so? What is your "programming puzzle solving routine"?

share|improve this question

closed as not constructive by MichaelT, Martijn Pieters, Glenn Nelson, ChrisF Feb 23 '13 at 22:54

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. If this question can be reworded to fit the rules in the help center, please edit the question.

I don't go out looking for programming puzzles, but I find surprisingly many just asking "how could that work?". The trick is limiting the scope enough that you can solve it in less than a day. –  dan_waterworth Jan 9 '12 at 8:29

6 Answers 6

up vote 19 down vote accepted

I'm just learning to program and regularly complete puzzles and have found it to vastly improve my programming. I plan to continue working on puzzles in order to stay sharp. Sometimes I'll use a puzzle from a puzzle site or I'll come up with my own problem to solve programmatically.

I came up with two lists of several resources where you can find programming puzzles to solve:

C programming exercises

Language agnostic programming puzzles

The latter has a lot of puzzles for other programming languages if C isn't your thing.

There is also a StackExchange site just for the purpose of solving programming puzzles: http://codegolf.stackexchange.com/

share|improve this answer

I have found that programming puzzles tend to be just that. Puzzles. They're fun sometimes and can keep your mind sharp if you having nothing else providing that edge for you, but in the course of having an actual job you should have plenty of puzzles to solve on a regular basis. If you don't, then it might be a good time to start looking for a job that does challenge you. If you're happy where you are financially/career-wise, then maybe puzzles are just the sort of thing to keep you creative and sharp without giving up the comfort of the immediate.

Personally, I've found rarely do the puzzles presented online actually solve, help solve, or teach me how to solve the problems I deal with from day to day. Most of the time, the solution to the puzzle is some clever programming trick that doesn't have any real practical application or a practical application applied in an extremely clever way.

To sum up, I'd say puzzles as a diversion are an excellent way to keep your mind limber and refreshed in the face of grinding, every-day work, but should not be necessary on a regular basis. If you're not challenged at work (or have no work to be challenged by), then puzzles are probably the best way to create "work" that forces you to think beyond what you know today.

share|improve this answer
Joel is right. Puzzles are inquisitive and may even shook the best minds but they don't really help solve real-world problems at large since they are more constraint-based rather than model-based and most of these puzzles have a single or few answers. –  Ubermensch Jan 9 '12 at 6:46
I think they help with solving algorithmic problems, but not with solving architectural problems. –  CodesInChaos Dec 28 '12 at 9:21

Do you solve such routinely (e.g. one problem at Project Euler or somewhere else per day)

No, I don't. I have some real puzzlers in my actual job. An interesting aspect of working with software for a while is that you start seeing programming puzzles everywhere you look. It's very similar to the aspect of learning math: the more math you know, the more you see.

would you recommend others to do so?

It depends. One of the most useful aspects of some of these puzzles is that it teaches people to learn how to read a specification and produce code. That's actually a difficult skill to teach.

share|improve this answer

I don't solve puzzles routinely, certainly nothing like one problem per day, but I share your opinion that if I did, I'd probably be better at it.

I do like to dip into Project Euler or other such sites and work through those problems, because they offer a great "context shift" from my day job (I'm a programmer in IT). Also, even though the puzzles may have little application to my day job, working through them keeps your saw sharpened. Peace!

share|improve this answer

I use them as a kind of warm up routine (Project Euler and Coding Kata, and Sphere Online Judge) like you would do before sports.

Get in the office, take a cup of coffee and spend 15 minutes to get in the groove, before starting to wrestle with real life code and all its warts :)

But I doubt, that solving coding puzzles regularly is necessary for becoming a good developer. I think though it helps to build up some "strength" that helps with pushing through the occasional "Oh boy, I can't believe there isn't a method for that" moments.

share|improve this answer

I really enjoy doing Code Katas as they are a great way to practice TDD and strengthen my problem solving skills. They're also great practice for when I'm trying to learn a new language.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.