Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Education Programming Technology

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?"
This discussion has been archived. No new comments can be posted.

Brain Teasers for Coders?

Comments Filter:
  • by mr_rattles ( 303158 ) on Tuesday August 02, 2005 @11:42AM (#13222245) Homepage
    The ACM puts up a lot of programming challenges and have an automatic judge system to determine if your solution is correct or not. They have hundreds of problems of varying difficulty:

    http://acm.uva.es/ [acm.uva.es]
  • Does Sphere count? (Score:3, Interesting)

    by xTown ( 94562 ) on Tuesday August 02, 2005 @03:14PM (#13224281)
    The SPOJ project [sphere.pl] from Poland has a bunch of algorithmic problems to which you can submit answers which are verified automatically. For most of the problems, you can use pretty much any language, although some of the problems restrict you to one language.
  • Re:RSA (Score:1, Interesting)

    by Anonymous Coward on Tuesday August 02, 2005 @03:22PM (#13224385)
    And no-one's ever proven that you have to factor large numbers to solve the RSA problem.

    ??? 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.

  • by chongo ( 113839 ) * on Tuesday August 02, 2005 @04:53PM (#13225400) Homepage Journal
    If you are looking for puzzles (but NOT coding style), try some of the International Obfuscated C Code Contest winners:

    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:

    In korn.c, what type of symbol is unix?.
    And:
    Why does Korn subtract 0x60? Hint: 'a' in ASCII is 0x61.
    And:
    On a non-Unix system, what will this program do?

    p.s. We are in the middle of judging the 2005 entries. There are some good ones this year, IMHO.

  • Programmer's Koans (Score:3, Interesting)

    by identity0 ( 77976 ) on Tuesday August 02, 2005 @09:37PM (#13227459) Journal
    "One day, master Kernighan sat down with his apprentice and asked, 'What is the sound of one bit flipping?' The apprentice answered by raising one finger."

    "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.
  • Project Euler (Score:2, Interesting)

    by drstock ( 621360 ) on Wednesday August 03, 2005 @02:08AM (#13228706)
    I'm amazed that nobody mentioned Project Euler [mathschallenge.net] yet. I find their challenges very interresting and with varying difficulty.

I tell them to turn to the study of mathematics, for it is only there that they might escape the lusts of the flesh. -- Thomas Mann, "The Magic Mountain"

Working...