Live data from Hacker News

Fifty Fizzbuzzes

vihart.com

21–30 of 64 posts

Re: Fifty Fizzbuzzes

#24
I like this idea. I find it fascinating how many developers I've interviewed who still have not come across FizzBuzz, and how many of those cannot solve the problem. Some of the more interesting interviews I've given though have been with people who know the FizzBuzz problem, where I ask them to make the worst possible version of it that they can. It turns out to be more difficult than they think it will be, and a deeper thinking and communicating exercise than solving the simple FizzBuzz problem itself.

Re: Fifty Fizzbuzzes

#25
post #4

Vi's site is down from the onslaught. In the meantime, enjoy the ever-classic Fizz Buzz Enterprise Edition: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

Also FizzBuzz in TensorFlow: http://joelgrus.com/2016/05/23/fizz-buzz-in-tensorflow/

Not sure whether to think "Damn!" or "Good, someone else has already had that dumb-but-fun idea, so now I don't have to do it!"

Re: Fifty Fizzbuzzes

#28
post #4

Vi's site is down from the onslaught. In the meantime, enjoy the ever-classic Fizz Buzz Enterprise Edition: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...

I opened the link thinking ”hah, what a gag!” But then I thought it’d be funny to try to find the core fizzbuzz logic. Turns out that it hits way too close to home, I just got really annoyed. Not sure what I expected.

Re: Fifty Fizzbuzzes

#29

I like this idea. I find it fascinating how many developers I've interviewed who still have not come across FizzBuzz, and how many of those cannot solve the problem. Some of the more interesting interviews I've given though have been with people who know the FizzBuzz problem, where I ask them to make the worst possible version of it that they can. It turns out to be more difficult than they think it will be, and a de…

  let tokens = [];
  tokens.push("Fizz", "Buzz", "Fizzbuzz");
  for (let i = 0; i  100) { return [[]]; }
    let result = [];
    for (let token of tokens) {
      for (let tail of generateFizzBuzz(n+1)) {
        tail.splice(0, 0, token);
        result.push(tail);
      }
    }
    return result;
  }

  let candidates = generateFizzBuzz(1);
  while (candidates.length > 1) {
    let candidateIndex = Math.floor(Math.random() * candidates.length);
    let candidate = candidates[candidateIndex];
    let checkIndex = Math.floor(Math.random() * 100);
    let expected = checkIndex % 3 == 0
      ? (checkIndex % 5 == 0 ? "Fizzbuzz" : "Fizz")
      : (checkIndex % 5 == 0 ? "Buzz" : checkIndex);
    if (candidate[checkIndex] !== expected) {
      candidates.splice(candidateIndex, 1);
    }
  }

  return candidates[0];

Re: Fifty Fizzbuzzes

#30

I like this idea. I find it fascinating how many developers I've interviewed who still have not come across FizzBuzz, and how many of those cannot solve the problem. Some of the more interesting interviews I've given though have been with people who know the FizzBuzz problem, where I ask them to make the worst possible version of it that they can. It turns out to be more difficult than they think it will be, and a de…

> the worst possible version of it that they can

Based on a true story, sadly:

  #! /usr/bin/tail -n+2
  1
  2
  Fizz
  4
  Buzz
  [...]
  98
  Fizz
  Buzz
On the other hand, there's also ones like:

  let{a="ssfsbfssfbsfssX"++a;x 's'=show;x 'f'=const"Fizz";x 'b'=const"Buzz";x 'X'=const"FizzBuzz"}in putStrLn$concat$map(\(i,f)->x f i++"\n")(zip[1..100]a)
(because who needs divisibility tests, right?)
Post reply on HN