Such as 9-dots puzzle, but for programming.
Possibly something that would be to coding/math what "What if?" by xkcd is to physics - crazy questions with extremely unexpected solutions.
If you know about books/websites that collect these puzzles, or you know some good examples yourself - please share them.
If you have any ideas on how I could learn to invent these puzzles myself, or maybe some programming projects that could be a source for a lot of such challenges - please share them too, that would be extremely valuable as well.
P.S. Ideally these puzzles would be small and simple enough to be solvable by a beginner/intermediate programmer, although that is not a strict requirement, more advanced examples are very welcome too.
EDIT: To be clear, these puzzles are for me. To train my brain and have fun and get better at hacking. Not to test or train other people. Well, maybe also to list them on my blog, if I manage to gather a cool collection.