Brain Teasers for Coders? 109
calvinandhobbes asks: "There are about 200 people working on different projects and most of them do programming without having an idea of what they actually do. they have little understanding of OS internals and primitive hacking skills. I want to enthuse them by providing some challenges by which they touch upon complex computing concepts, while solving the problem. Does anyone know of a set of C-based hacks or puzzles with which I can enthuse these budding programmers and testers?"
If they're not interested, they're not interested (Score:4, Insightful)
Re: (Score:2)
Re:If they're not interested, they're not interest (Score:2, Insightful)
There are two types of programmers in the world - hackers and code-grinders.
Hackers live for interesting problems, matching their wits and expertise against the hardest and most intracable problems they can find, and smash through complexities that would make anyone else's your brain bleed with a gleeful laugh [paulgraham.com]. No reward you can offer them is better than a selection of interesting challenges, adequate pay and freedom from drudgery.
Code-grinder
Re:If they're not interested, they're not interest (Score:2)
In addition, what's the point of trying games to "enthuse" people who are already highly motivated to learn? You'd do better by chucking them a book or website and letting them get on with it.
The entire subtext of the question seems to indicate they aren't already interested in learning.
Aren't things like that... (Score:1)
Re:Aren't things like that... (Score:2, Insightful)
chapter exercises? are you kidd
Re:Aren't things like that... (Score:1)
that. You are quite right.
Another argument against complex computing concepts
and OS internals is that the latest trend is away
from having to know such things. It started with
high level languages, then protected mode APIs, now
we have virtual machines (ala Java and it's huge
library).
Of course there's also people who just shouldn't
be told how things work. These are the same people
who would ask what they need to import to use
while (Java class a long time ago.. wa
Re:Aren't things like that... (Score:1)
* a += *b; (a-> A+B)
* b = *a - *b; (b = A)
*a -= *b; (a->B)
because under/o
Re:Aren't things like that... (Score:1)
Try here for inspiration (Score:1)
Re:Make it more interesting (Score:1)
http://www.roothack.org/ [roothack.org]
http://www.hackerslab.org/eorg/ [hackerslab.org]
semi interested people become interested people, idiot.
Hmm (Score:1)
Only one solution: extermination.
Daniel
Re:Hmm (Score:2)
When I read the atricle, I mentally substituted
the word euthanise to enthuse. I found myself wondering, "Why give brain teasers to peopl you're going to kill anyway? This makes no sense."
Programming Challenges (Score:4, Informative)
Best of all, when folks solve the problems, they can submit their solutions online to see if they pass muster!
Re:Programming Challenges (Score:3, Informative)
Re:Programming Challenges (Score:1)
Re:Programming Challenges (Score:1)
Here's a site with challenges (Score:1)
OSIX.net (Score:2)
More programming challenges... (Score:2, Informative)
topcoder (Score:3, Informative)
Re:topcoder (Score:1)
ACM Programming Competition Problems (Score:3, Interesting)
http://acm.uva.es/ [acm.uva.es]
RSA (Score:2)
* RSA Factoring Challenge - because nobody has found a "magic" formula for instant factoring.
* Physics simulations - just because its fun to draw a ball on the screen and have it bounce around in a realitic fashion.
* 3D graphics - because it looks cool
The RSA challenge I play with when I feel more like thinking than coding. The other two are nice when I want to tinker for awhile, but also want quick visual results, which in turn keep me
Re:RSA (Score:3, Insightful)
You're funny. It's very unlikely that a breakthrough in factoring is going to come from the tinkering of a bored coder. It's more likely to come from someone who has already mastered advanced number theory, algebraic number theory, elliptic curves and finite fields, the CFRAC method, the quadratic sieve, and the special and general number field sieves.
And no-one's ever proven that you have to factor large numbers
Re:RSA (Score:1)
Re:RSA (Score:1, Interesting)
??? The "RSA Factoring Challenge" [rsasecurity.com] is a challenge set by the RSA company to... factor large numbers.
This is a different proposition to breaking RSA encryption.
And yes, you do look like an ass now.
Re:RSA (Score:2)
that when one is intelligent enough to solve the problem the problem becomes uninteresting.
Then one would rater use the ones time to solve
one of the great problems facing humanity.
But here is some hints if you like to take on the RSA Factoring Challenge.
You need: a need a frequency generator, electronic components (resistors, capacitors, coils) and the most important thing the correct understanding of electrodynamics.
Have fun.
Good C line (Score:2)
((void(*)(void))0x00)();
Re:Good C line (Score:1)
Re:Good C line (Score:3, Informative)
Re:Good C line (Score:1)
Looks like it casts null to a pointer to a function with no parameters that returns void, and calls it. Remind me how this "touches on complex computing concepts"?
Re:Good C line (Score:2)
Re:Good C line (Score:2)
Re:Good C line (Score:2)
int i = 0;
((void(*)(void))i)();
Re:Good C line (Score:1)
Re:Good C line (Score:2)
Re:Good C line (Score:3, Insightful)
Re:Good C line (Score:2)
for(;;) printf("\t\t\b\b\b\b\b");
Some brainteasers relevant to today (Score:2, Funny)
2. How well can Visual Studio, Eclipse, and Emacs handle filenames in Hindi and Kannada?
Bonus question: How does the answer change when Bengali, Gujarati, and Urdu are also used?
3. Use Rational Rose, Visio, or another modeling tool of your choice to draw a flowchart of the proper actions a call center operator can foll
Re:Some brainteasers relevant to today (Score:1)
surprised noone's suggested (Score:3, Informative)
Surprised noone's suggested this [amazon.com] one yet. One of my favorites. If you can solve these puzzles, you know C.
Re:surprised noone's suggested (Score:2)
Re:surprised noone's suggested (Score:2)
Except for people whose code you'll end up maintaining
If they do, then you need to get rid of it and rewrite it ....
Uh-huh. Try explaining the added expense of rewriting vs. maintaining. If if you don't have the right "colors" of money in your budget, then you can completely forget rewriting.
intentionally obfuscated "I'm going to do a lot of strange things; prove you can understand this" kind of thing.
You've obviously never worked with pe
Re:I blame university (Score:1)
What?
Re:I blame university (Score:2)
Funny thing. University courses were always non-vocational. That means they aren't supposed to train you for specific jobs, but instead teach you to use your brain, teach yourself things and solve your own problems.
A university degree wasn't a certificate to say "Bob Jones is this good at C", but one which said "Bob Jones is this clever, and could therefore learn anything he put his mind to to this degree".
Ever notice how (historically) vocation
Wait one second... (Score:1)
Python Challenge (Score:3, Informative)
Well, it's not C, but the Python Challenge [pythonchallenge.com] is an excellent multilevel programming riddle. Each level builds upon discoveries from previous levels, and encourages deep exploration of the Python library. I got about 1/3 of the way through before being stumped and running out of time to devote to it, but I bet it'd be super fun with a team working on it.
Re:Python Challenge (Score:1)
I have my reservations about Python, largely based on its scoping rules, but this was fun series of programming riddles.
Re:Python Challenge (Score:2)
Re:Python Challenge (Score:2)
No other puzzle has ever had the same level of satisfaction upon solving (each level, that is) for me.
It takes a couple stages for it to get interesting though..
eh? (Score:2)
Could you be more precise? If they are programming without knowing they're programming it sounds like they're writing Excel macros or something similar. If that's the case don't you think "C-based hacks or puzzles" will be too difficult for them?
Re:eh? (Score:1)
Re:eh? (Score:1)
How about code reviews? Have a meeting where people bring in a couple pages of code they've written and everyone discusses the good/bad points of it. I feel dirty suggesting that, since when I participated in such a thing during a previous job, and 1) people missed errors 2) people gave bad/incorrect advice. Of course, I'm fluent and have coded in 8,16,and 32 bit asm, OS-level programming, etc.
Re:eh? (Score:1)
Best would be showing them two implementations of somethi
Programming Pearls (Score:2)
The Daily WTF gives readable, inelegant solutions to common programming tasks. I've avoided many of them.
Re:Programming Pearls (Score:2)
Etudes for Programmers (Score:2)
Write a game (Score:1)
Gimpel/PC-lint bug of the month (Score:3)
If this is to be strictly C/C++ oriented, a fairly steady supply of puzzles may be had by using Gimpel's Bug of the month [gimpel.com]. I have seen these for many years and have usually found them to be interesting and sometimes even educational.
C-based? (Score:2)
Anyway, you could pick up minix from somewhere, install it on a cheap x86 box and let them implement a quota system or something in C. It has been designed for that. Lets them - eh - love vi, make and cc as well.
I had to do this at the "Vrije Universiteit" under Tanenbaum, and gosh, did I have a lot of fun!
Next Week (Score:2)
pete-classic asks: "There are about 200 people working on different projects and most of them write without having an idea of what they actually do. they have little understanding of rudimentary diction and primitive grammar skills. I want to euthanize them by providing some challenges by which they touch upon complex language concepts, while solving the problem. Does anyone know of a set of English-based books or lessons with which I can euthanize these budding s
Re:Next Week (Score:2)
Re:Next Week (Score:1)
I looked the sisters up. First hit gives Extensive online resource for all three Brontë sisters and there writings. [google.com]
Well, if that's how "there" fans represent I'll pass.
-Peter
Re:Next Week (Score:2)
Then you, my friend, never had to try and become interested in Wuthering Heights, bane of my High School english class. The only novel I just simply could not bring myself to finish. I made it through House of Seven Gables, but am none the better for it.
Book: "He's dead. Yep, still dead. Hhm, doesn't seem to be moving. Maybe, because, that's right, he's DEAD. Still."
Me: "Get on with it!"
Does Sphere count? (Score:3, Interesting)
Lots of free time, eh? (Score:1)
When do you want people to do these brain teasers? At work, or on their own time?
If you want them to do this at work, then you have too many people on staff if they can waste time doing brain teasers. Reducing staff to 50 - 100 highly skilled employees will improve productivity and reduce wasted time which is costing you money.
If you expect these people to work on these brain teasers at home, then you must be a manager with your head in the clouds expecting employees to do 'homework'!
Re:Lots of free time, eh? (Score:2)
Quizzing your workers may have the opposite effect (Score:2)
This sounds suspiciously like the kind of puzzles many IT workers are asked prior to employment. Personally, I enjoy these kind of questions, regardless of how accurate my answers are. (Often, I think of solutions not expected by the tester; it's always fun to see their expression when this happens.) ;-) However, this kind of thing tends to really piss off your potential (or in this case, current) employees. Many well-known IT figures, PhDs, etc. have been very outspoken about these quizzes, and have tu
No Starch Press has a simple answer (Score:2)
How Not to Program in C++ [amazon.com]
My Puzzler (Score:2)
for a puzzle, try small or 1-line IOCCC winner (Score:3, Interesting)
I'd pick some of the short programs and 1-liner winners.
My favorite 1-line winner was submitted by David Korn (of ksh fame):
Print out the korn.c source [ioccc.org]. By just looking at it, ask them to tell you what it does and why.
Note that this 1-liner has stumped some people who have been coding in C for > 31 years. So if they get stuck, help them out by asking asking some questions such as:
And: And:p.s. We are in the middle of judging the 2005 entries. There are some good ones this year, IMHO.
The C Puzzle Book (Score:2)
- dshaw
Speaking as an educator (Score:2)
If you want to enthuse them, have them come up with the problems they want to solve, then solve them. This has the added benefit of exercising their imaginations as well as learning/developing programming skills.
How Not To Program in C++ (Score:2)
Steve Oualline
No Starch Press
Programmer's Koans (Score:3, Interesting)
"As Dennis Ritchie was pondering over the coding of the first UNIX kernel, a butterfly landed on his nose. And lo, he was enlightened."
"Stroustrup ran to the head monk, exclaiming, 'Master! I have added object-orientation to the C programming language! I have been enlightened!' to which the head monk responded by hitting him on the head with a stick."
"Theo DeRaadt looked over the cuts of meat in a butcher-shop, and complained loudly, 'This is all crap! What's the best meat you have here?' to which the butcher replied, 'Everything here is the best! You cannot have anything but the best!' and thus DeRaadt was enlightened."
"Once, a hacker asked master Torvalds, 'Does the Linux kernal have the Turing nature?' To which Torvalds replied, 'Get me a beer'."
And now a real quote, from Steven Levy's Hackers:
So Sussman began working on the program. Not long after, this odd-looking bald guy came over. Sussman figured the guy was going to boot him out, but instead the guy came over. Sussman figured the guy was going to boot him out, but instead the man sat down, asking, "Hey, what are you doing?" Sussman talked over the program with the man, Marvin Minsky. At one point in the discussion, Sussman told Minsky he was using a certain randomizing technique in his program because he didn't want the machine to have any preconcieved notions. Minsky said, "Well, it has them, it's just that you don't know what they are." It was the most profound thing Gerry Sussman had ever heard.
Re:Programmer's Koans (Score:2)
That would have to be, unquestionably, the SINGLE MOST VILE BUTCHERING of the actual koan i have ever had the horrible misfortune of reading. It barely makes sense, let alone helps with enlightenment. Try this:
In the days when Sussman was a novice Minsky once came to him as he sat hacking at the PDP-6. "What are you doing?", asked Minsky. "I am training a randomly wired neural net to play Tic-Tac-Toe." "Why is the net wired randomly?", asked Minsky. "I
Re:Programmer's Koans (Score:2)
The 'koan' you cite is a made-up story written by someone, no doubt based on the original Levy material. Note that Levy actually interviewed both participants in the encounter, and neither apparently corroborated the 'closing your eyes' part. While more amusing, I went with the factual account over the 'koan'. Besides, it's not a real koan if they explain the meaning in the text, now is it?
Re:Programmer's Koans (Score:2)
The 'koan' you cite is a made-up story written by someone, no doubt based on the original Levy material.
The koan is one of the most famous examples, has been in the jargon file since the koan examples were added i
Build linux kernel (Score:1)
Project Euler (Score:2, Interesting)
int *(*(*i)[5])(int*) (Score:1)
what is i?
To do this by hand you can use the right-left rule for reading c-declarations: ...directed outwords
1) locate the innermost identificator and classify this first.
2) classify next balanced expression to the right
3) and continue reading clockwise (i.e. to the left)
4)
However if you stumble upon some cryptic code written by others that you do not understand there exists this wonderful, litle known tool named cdecl to
Exceptional C++ (Score:2)
Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions [amazon.com]
More Exceptional C++ [amazon.com]
Exceptional C++ Style : 40 New Engineering Puzzles, Programming Problems, and Solutions (C++ in Depth Series) [amazon.com]
Robocode!! (Score:2)
At work, a competition was formed. If you're interested, I can look up the rules we used.
TopCoder (Score:2)
Although making them do stuff is making them do stuff. It'll probably still feel like work (and I guess, in a way, it is).
Sincere Suggestions (Score:1)
A lambda poem (Score:2)
What is the meaning of (call/cc call/cc) and how might you use it in a program?
get them together (Score:1)
it seems like most posts here are offering up outside sources for problems/puzzles.
while this might interest some of your crew, many of them are likely to look at it as a waste of time and just another stupid task enforced by management.
why don't you gather your people together and challenge them to come up with a project that they all feel is relevant in some way?
the various people in an organisation always feel like they know what's wrong with said organisation and what it needs. so get them to