News for hackers. Stuff that matters.
Re:One hiring filter that works by kenrikm on Friday April 06, 2012 @10:27AM (#3807256)
The only jobs that caught my eye were the ones that offered some type of challenge to apply (Apply Via API, Etc.) If I'm going to end up talking to someone from Human Resources that's going to ask me the "Man Hole Cover" or "Lightbulb Question" then forget about it, I'm not interested in working in more stuffy corporate environments.

-(void)fizzbuzz { int i = 1;int t = 3; int f = 5;int h = 101; int z = 0;

    // here we do a for loop using i and incrementing it until it's equal to z
    for (i = i; i < h; i++) 
    {
        /* we check if both i/t is equal to z and if i/f is equal to z
         if both are true we log fizzbuzz in the console */
        
        if (i % t == z && i % f == z) 
        {
            NSLog(@"FizzBuzz");
        }
        //check if i/t = z and log
        else if (i % t == z)
        {
            NSLog(@"Fizz");
        }
        //check if i/f = z and log
        else if (i % f == z)
        {
            NSLog(@"Buzz");
        }
        // if none of them are true we just act like we're learning to count
        else 
        {
            NSLog(@"%d", i);
        }
    }
}
Re:One hiring filter that works by sray on Friday April 06, 2012 @05:49PM (#3809107)
http://www.codinghorror.com/blog/2007/02/fizzbuzz-the-progra...

Pertinent passage: FizzBuzz was presented as the lowest level of comprehension required to illustrate adequacy. There's no glory to be had in writing code that establishes a minimum level of competency. Even if you can write it in five different languages or in under 50 bytes of code.

Re:One hiring filter that works by Steve_Baker on Friday April 06, 2012 @11:26AM (#3807479)
Every time fizzbuzz comes up, someone has to post a solution it seems, but why does everyone write such huge fizzbuzz programs?

  for(int i=1; i <= 100; i++)
    printf((char *[]){"%d\n","Buzz\n","Fizz\n","FizzBuzz\n"}[((i%3==0)<<1)|((i%5)==0)], i);
Re:One hiring filter that works by Tyrannosaurs on Friday April 06, 2012 @11:42AM (#3807569)
Some people value readability, some compactness / efficiency.

Why they do it one way or another is an occasionally interesting follow up question.

Re:One hiring filter that works by kenrikm on Friday April 06, 2012 @01:51PM (#3808144)
I'm in the readability camp, I'm one to comment my code even if it's something simple and I also like to use verbose variable names. I always keep in the back of my mind that if someone had to pick up my code without knowing how anything was implemented they might appreciate my efforts (even if it's just a personal project that I don't plan on anyone seeing). You can't please everyone I'm sure for as many people that like it compact there are people that like the whitespace.
Re:One hiring filter that works by fhars on Friday April 06, 2012 @12:44PM (#3807874)
A bit long, isn't it?

  1_,`0:'{:[~x!15;"FizzBuzz";~x!3;"Fizz";~x!5;"Buzz";$x],"\n"}'1+!100
(Thats https://github.com/kevinlawler/kona)

[Edit: Found a way to shave off three chars]

Re:One hiring filter that works by kenrikm on Friday April 06, 2012 @11:38AM (#3807548)
I posted it as a joke: http://www.codeslate.com/2007/01/you-dont-bury-survivors.htm...

However, yes it is huge it's Objective C with whitespace what do you expect? ;)

Re:One hiring filter that works by Tyrannosaurs on Friday April 06, 2012 @11:06AM (#3807386)
Do you want a critique of that? I'm mainly interested because I'd be interested in a critique of my critique... We use Fizzbuzz as our lowest bar question and I'm curious to know what people consider significant points and what are not.
Re:One hiring filter that works by waterlesscloud on Friday April 06, 2012 @12:07PM (#3807680)
Significant point- Does it work? Non-significant points- everything else.
Re:One hiring filter that works by Tyrannosaurs on Saturday April 07, 2012 @02:57AM (#3810221)
Depends on what you're looking for.

Does it work is the most important thing by a mile but if you've asked them to wrie production ready code then you've got to ask "how would I feel if one of my developers checked this into version control and how would it fair in a code review?"

Maintainability, readability, efficiency and most significantly the candidates ability to explain why they took the approach they did.

I wouldn't hold any approach against someone so long as they could talk intelligently about the trade offs and why they'd done what they'd done.

Even really simple problems are a chance to see whether someone thinks about things.

Re:One hiring filter that works by pilom on Friday April 06, 2012 @11:10AM (#3807397)
Your first comment should say "until its equal to h" not z
Re:One hiring filter that works by Tyrannosaurs on Friday April 06, 2012 @11:19AM (#3807446)
Shouldn't it say until it ceases to be less than h?

Your comment supposes that the loop will increment without interference. While you'd hope that was the case, it's not necessarily true.

Obviously with the loop as coded your comment is correct (that'll be the first condition that terminates the loop) but it could raise a question about whether comments should reflect the routine as written or just the section they're immediately referring to.

Or indeed whether comments for something so self evident are even useful or necessary... Something I'd definitely ask in an interview if I was presented with this code, not looking for a specific answer, just looking for some indication that the candidate had (or could come up with) some vaguely informed thoughts on the subject.