Live data from Hacker News

Fizzbuzz, Interviews, And Overthinking

dave.fayr.am

31–40 of 115 posts

Re: Fizzbuzz, Interviews, And Overthinking

#31

Forget Fizzbuzz, we get candidates that cannot reverse a string (in their language of choice). A friend of mine just told me he uses the question "What is the hex number that comes after 'F'" as his first "weed-out" technical question. It boggles the mind.

They cannot reverse a string even using the API call?

If so are these people who have held down a programming job before?

Re: Fizzbuzz, Interviews, And Overthinking

#32
post #22

Forget Fizzbuzz, we get candidates that cannot reverse a string (in their language of choice). A friend of mine just told me he uses the question "What is the hex number that comes after 'F'" as his first "weed-out" technical question. It boggles the mind.

I wonder what kind of answers he gets for that. I think I would probably answer that verbally as "sixteen, spelled one-zero ".

I would think that 'G' would also be correct, in a base higher than 16, just like how 11 is just 0xB, 013, and 0b1011, depending on your perspective.

Re: Fizzbuzz, Interviews, And Overthinking

#33
post #25

cases = ( (3, 'Fizz'), (5, 'Buzz'), (7, 'Bazz'), (11, 'Boo'), (13, 'Blip'), ) for i in range(1, 101): out = [] for c in cases: if i % c[0] == 0: out.append(c[1]) if out: print ''.join(out) else: print i Edit: not to detract from the post's point, I think it's valid. Monoids are cool and all but simple counting arguments can take you a long, long, long, way when case analysis fails you.

Came here to say this ;)

Good job.

Re: Fizzbuzz, Interviews, And Overthinking

#34
post #32
post #22

Earlier quoted context omitted.

I wonder what kind of answers he gets for that. I think I would probably answer that verbally as "sixteen, spelled one-zero ".

I would think that 'G' would also be correct, in a base higher than 16, just like how 11 is just 0xB, 013, and 0b1011, depending on your perspective.

He asked 'in hex', which means 'in base 16'. It's not open to different perspectives.

Re: Fizzbuzz, Interviews, And Overthinking

#35
post #32
post #22

Earlier quoted context omitted.

I wonder what kind of answers he gets for that. I think I would probably answer that verbally as "sixteen, spelled one-zero ".

I would think that 'G' would also be correct, in a base higher than 16, just like how 11 is just 0xB, 013, and 0b1011, depending on your perspective.

No that wouldn't be a hex(adecimal) number.

Re: Fizzbuzz, Interviews, And Overthinking

#36
post #14

I recently challenged people to codegolf fizzbuzz ( http://swizec.com/blog/fizzbuzz-without-ifs-in-90-char-i-wil... ) The Haskell solution was really cool: [max(show x)(concat[n|(f,n) This is much simpler and it looks easier to extend as well.

Unfortunately not below 90 characters, but without loops or ifs:

    l=range(101)
    l[3::3]=100/3*['Fizz']
    l[5::5]=100/5*['Buzz']
    l[15::15]=100/15*['FizzBuzz']
    print l[1:]
This one is 86 characters by using constants:

    l=range(101)
    l[::3]=34*['Fizz']
    l[::5]=21*['Buzz']
    l[::15]=7*['FizzBuzz']
    print l[1:]

Re: Fizzbuzz, Interviews, And Overthinking

#37
post #32

Earlier quoted context omitted.

I would think that 'G' would also be correct, in a base higher than 16, just like how 11 is just 0xB, 013, and 0b1011, depending on your perspective.

He asked 'in hex', which means 'in base 16'. It's not open to different perspectives.

Apparently I can't read today :).

Re: Fizzbuzz, Interviews, And Overthinking

#38
post #37

Earlier quoted context omitted.

He asked 'in hex', which means 'in base 16'. It's not open to different perspectives.

Apparently I can't read today :).

perhaps this is a good example of how even this question might count as 'tricky under high pressure' :)

Re: Fizzbuzz, Interviews, And Overthinking

#39
post #32
post #22

Earlier quoted context omitted.

I wonder what kind of answers he gets for that. I think I would probably answer that verbally as "sixteen, spelled one-zero ".

I would think that 'G' would also be correct, in a base higher than 16, just like how 11 is just 0xB, 013, and 0b1011, depending on your perspective.

He explicitly said "hex"

Re: Fizzbuzz, Interviews, And Overthinking

#40
post #4

I understood from near the very beginning that this wasn't really about Fizzbuzz. All the way through the post, I was waiting for the author to get a real world example instead of Fizzbuzz. Yet, I got to the end of the post and realized it was already pretty long. I think in talking about programming, we are often hindered by the fact that it is much more complicated than our brains can handle. Our only choices are t…

Thanks! What sort of surprised me as I shopped my copy around and showed people the python-add-one-factor example is that even programmers I consider experts didn't realize how quickly the conditional cascade blows up. It's easy to miss. And I looked around for people to mention this in blog posts, but almost no one does. So I feel like there's a bit of life left in the old fizzbuzz yet.

I think the non-blown cascade is exactly what makes fizzbuzz aggravating. With three noises, the linear solution clearly dominates. With two, the exponential is actually shorter -- but feels unclean.
Post reply on HN