
FizzBuzz Still Works - raganwald
http://www.globalnerdy.com/2012/11/15/fizzbuzz-still-works/
======
Deestan
> I can’t go fairly judge other programmers with FizzBuzz without going
> through the test myself. I implemented it in Ruby, my go-to language for
> hammering out quick solutions, and in the spirit of fairness to those I
> interviewed, I did it with pen and paper on the first day of the interviews
> (and confirmed it by entering and running it)

Be careful with this kind of test evaluation:

1\. The problem isn't _new_ to you - you have already had the problem in your
head for days or even years. Whether you admit it or not, you already have a
good idea of how to approach the problem.

2\. You are not under stress, as the candidate would be.

~~~
sync
His solution isn't even correct, failing his own test.

    
    
      if !multiple_of_3(i) && !multiple_of_5(i)
        output = i
    

edit: In order to avoid overwriting output, the solution should read...

    
    
      if !multiple_of_3(i) && !multiple_of_5(i)
        output << i

~~~
raganwald
That's probably deliberate: he says himself (and I agree with this approach)
that the point is to figure out if someone knows how to program at all. Off by
one errors, syntax errors, these are not all that relevant. The failures are
the ones who stare at the paper blankly, or have no idea that they need a
loop, or some other such hopeless approach.

If you get "close enough" on paper and pencil under the pressure of an
interview, that's great. You can walk through debugging it if you want to see
more, but I wouldn't hold even basic logic errors against someone.

I certainly admit that when coding on my own I usually get all kinds of stuff
wrong that I fix as I write tests and iterate.

~~~
lucisferre
Yeah I've used FizzBuzz myself, and under interview conditions it's actually
much harder to implement a correct (for edge cases, etc.) solution in a short
time. I always took that into account. However I also added the twist that I
wanted the candidates to also write the tests for the program in TDD style. I
hoped that this would actually help, by asking the interviewee to follow a
repeatable pattern of first expressing what they wanted to code to do and then
implementing. We also did ping-pong pairing so I could help write a test, or
do an implementation if things were going poorly, to see if that would jump
start the candidates brain into the problem.

The results were quite frankly a disaster, no better than what Joey found
(though I didn't do enough interviews for a statistical sample).

Unfortunately my limited observations have lead me to believe that too many
developers (particularly in the enterprise environments) are used to working
on legacy codebases that they hack and change until the bug they are fixing
goes away. Many rarely implement features much, if at all, and the ones they
do are heavily broken.

------
goostavos
Hacker News as of late has given me quite a bit of hope that I'll be able to
actually get a job writing code one day (anyone need an intern? ;) ) between
this FizzBuzz thing, and hearing about people who've never heard of multi-
dimensional arrays, I'm feeling a little more confident..!

Of the authors three ideas as to the reason for the inability of candidates to
pass the test, I can perhaps understand the first two. My younger days
involved copying/pasting Actionscript2 code and relying on superstition to get
it working. All the while having no idea of how the fundamental constructs
(like loops) even worked. What I don't understand is how someone has the
confidence to apply to a job/hold down a job when their coding style is cut
and paste.

His final point has me scratching my head a bit. Specialist or not, aren't
loops and conditional logic kind of the _fundamental_ tools in all languages.
What would the discipline be that has you coding in a specialist niche, but
not using loops or conditionals?

~~~
fusiongyro
Perhaps what you're experiencing is the Dunning-Kruger effect: that people who
are unskilled frequently rank themselves as more competent than people who
actually are skilled.

~~~
goostavos
Hmm.. perhaps. Still it seems a wildly bold to overestimate yourself by such a
large amount. We're talking about the absolute basics here. I mean, I look at
job postings and come away depressed after realizing I don't recognize half
the stuff they want 5+ years experience in. So what does for-loop-not-knowing
guy think we he sees the same requirements?

I dunno. I just think it's strange that they even get to the interview stage.

------
yllus
80% of applicants for an internship at a company I used to work at failed
FizzBuzz when I applied it to them (same deal, pencil and paper and a choice
of any language they want).

The worst was one perky young woman who wrote her answer in three minutes
flat, handed it back and asked, "Did I get it right?" I answered, "No...." and
from that point on it became the most awkward interview ever.

~~~
Spoom
Assuming it's for a developer position, why would you continue the interview
if they failed FizzBuzz?

~~~
yllus
The interviews were for all of 15 minutes anyways. I'm not so bent on time
efficiency that I felt it necessary to save myself and the applicant twelve
minutes by concluding the interview early. Also, I'm human and that's a level
of cold that I didn't want to go to.

------
TamDenholm
I'm amazed this still works. Like the author i would've thought everyone going
for such a job would instantly know what fizzbuzz is and make sure they know
it.

Another question i feel works really well in interviews is asking them to show
you something they've created, personally or professionally. Its a nice open
ended question, gets them talking about something they know and lets you ask
many follow up questions about specific parts of the thing they've done which
gives you a good feel of what they're capable of.

~~~
raganwald
One of the things I've learned is that almost all introductory blog posts are
wasted: The people I'd most like to reach don't read programming blogs, Hacker
News, progreasmming.reddit.com, or anything else.

FizzBuzz is famous, but alas it is famous _amongst people who could code it
without advance knowledge of it_.

~~~
nathan_long
>> FizzBuzz is famous, but alas it is famous amongst people who could code it
without advance knowledge of it.

If that's true, it's still a good screening test. You either have heard of it
but could code it even if you hadn't, so you pass, or you haven't heard of it
and couldn't code it even if you had, so you fail.

------
ashray
Is it just me or does his "sample" program look needlessly complex ? Does he
really need to create all those function definitions ? I'm not super familiar
with ruby but those ARE function definitions - right ?

Since when is it good programming practice to have functions for every little
thing ? (I'm picturing myself scrolling or jumping around in an editor to
figure out what exactly the call does). This is like doing hello world with a
function. Or having a function to add two numbers. Yes, sometimes it's
necessary for syntactical clarity but in this case it just seems like
overkill.

Also why are some people on HN talking about edge cases to FizzBuzz ? There
are no edge cases that I know of unless you talk about the number zero - which
isn't part of the question.

EDIT: Why the downvotes? I don't see why trying to discuss what's clearly a
_programming related problem_ on HN brings you downvotes ? Interesting.

~~~
zacharydanger
Yes. Who would give functions such cryptic names as "multiple_of_3" or
"multiple_of_5".

~~~
ashray
My question was: Why would you create a function that does something you could
access as a built in language feature ? What is the benefit of using a
function as opposed to just evaluating the result of i%3==0 ?

Looking at a function call for "multiple_of_3" I would actually expect it to
do more than i%3==0 since that could've been done just right there.

I'm just trying to understand if there are benefits of doing it this way and
not directly. So far I've just encountered snarky remarks and no real
arguments either way.

~~~
danielweber
Before I quit The Daily WTF, the joke answer to your question would be
"because it's resilient against someone changing the value of 3."

~~~
auxbuss
Which could, of course, be avoided by:

    
    
      > 3.frozen?
       => false
      > 3.freeze
       => 3
      > 3.frozen?
       => true
    

Just in case, I'd better add: :)

------
rplnt
I like the problem of printing the leap years (or deciding if a year is leap).
It's the same as FizzBuzz in the core (though a bit more complicated), but
presents itself as something real, not like an artificial task. And as a
bonus, you can see if the applicant knows the rules for inserting leap years
(there are no negative points for not knowing that, only positive if you do).

~~~
modernerd
The trouble with more practical tests like this is that good languages are
already full of practical methods. e.g. Ruby:

    
    
        Date.leap?(2000) # => true
    

So you might inadvertently end up testing a candidate's knowledge of their
language's standard libraries, unless you forbid them from using these.

I suspect that's why more artificial tasks like FizzBuzz are still popular.

~~~
hga
Isn't this the point where you congratulate the interviewee on the breadth of
their off the top of their head Ruby knowledge ... and then ask them to do it
by hand?

Surely the latter won't be a surprise; if I answered like that I'd do it with
a grin and a "Well, I _could_ do it like this [write out the above], but I
suspect you want something more like this [then write an implementation of the
method]."

------
meritt
> All the candidates came to us pre-screened by a recruiting company.

Immediately end business relationships with that recruiting firm and start
doing phone interviews yourself. Someone failing FizzBuzz during an _in-
person_ interview is also a red-flag on your hiring process.

~~~
raganwald
I recall being sent to a programming interview by a recruiting company. The
recruiter coached me on questions the company had asked previous applicants
and then debriefed me afterwards to find out what I'd been asked.

This person was definitely not acting in their client's best interests.

------
fusiongyro
It's true. Of the last four or so candidates we've had, only one managed to do
FB and none had heard of it. One of them, once presented with the problem,
even said "Why on earth would I want to do that?" to which I replied "Because
you want the job?"

~~~
talmand
With an answer like that I would have assumed you were a jerk. You could have
easily answered the question in a positive manner that explained your need to
have the candidate complete the task. "Because I said so" is often a valid
answer to a child, but not to an adult.

What I'm curious about is why so many seem so beholden to FizzBuzz in the
first place to the point they assume everyone already knows what it is. The
fact that none of your candidates had heard of FizzBuzz was to your advantage.
What's the point of administering a test if everyone had already heard of it
and knew the answer?

So, did you hire the one candidate that completed FizzBuzz and did you hire
this person because they could?

~~~
S4M
I think you are missing the point of the GP's answer. Instead of nailing in 1
minute the easy question (would it be fizzbuzz or "write me a program that
prints 'hello world'" or something of that kind), the candidate is supposed to
write the answer quickly and move on.

Being snob about the interview question is not going to help things.

~~~
tvjunky
Maybe sometimes we forget, the interview is for BOTH parties. I think it's
fair to ask if puzzle like questions are an expectation. It would be simple to
answer: "Yes, we know this is a silly puzzle, but it's a fast way for you to
show us your real world skill".

~~~
fusiongyro
That was said _before_ we asked the question.

------
tokenadult
A thought-provoking post. I really like the specific details the author
provides about the interview set-up and the results observed among candidates
at his company.

Now amazing as it is that there is anyone around who has not already heard of
FizzBuzz as a job screen, I actually heard an even more amazing story in
August 2012, which I shared here on Hacker News a month ago.

<http://news.ycombinator.com/item?id=4603414>

The story, which no one here seemed to believe the first time I related it,
but which I fear is very likely true, is that the hiring supervisor who told
me this story is the lead programmer for a company that uses Web back-end
programming to serve up online, adaptive lessons. He has a position open for a
new programmer as the company's business grows. He has advertised in the
expected places like Stack Overflow and Joel on Software. During the year
2012, the company has received many resumes. Applicants who have computer
science degrees, and especially the many applicants who have master's degrees
and who otherwise look all right, are invited to do a phone screen in
preparation for an in-person interview. During the phone screen, the
applicants log into an application that allows them to type on their own PC to
write code that can be seen by the hiring supervisor. The test the hiring
supervisor uses is "Write a program using a for loop to print the integers
from 1 to 100." Applicants are permitted to use any language they please, and
the supervisor said he would even consider correct pseudocode a successful
answer. He has not yet had ANY applicant, not even one, submit a flawless
working program to do that. Not one. He was eager to interview an applicant
who got the test MOSTLY correct, after seeing many applicants fail to do it at
all.

I know the company that that hiring supervisor works for. I do not know how
much its location or the fact that the software roles in that company are
support roles rather than producing the company's main product may influence
the desirability of the company. But somehow I think he is not lying when he
says that a straightforward implementation, no tricks, of "Write a program
using a for loop to print the integers from 1 to 100" is too hard for many CS
graduates. That's why everyone hiring today should build a work-sample test
into the hiring process.

<http://news.ycombinator.com/item?id=4613543>

It's not clear that higher education credentials guarantee ANY minimal level
of coding skill, however elementary.

------
buro9
Even with the 40% hit rate you can reduce it further by asking what could make
it perform faster.

"That's great for FizzBuzz to 100, but what if we went to a million? What
would you do to make it perform in... I don't know, a quarter of the current
execution time?"

Even if they wrote a solution that avoided % or / it is always worth a few
minute exploration into how one might optimise code that works today but one
day is found to be slower than desired.

~~~
buro9
In response to an email asking for an example of a fast fizzbuzz, just avoid
division.

    
    
        <html>
            <body>
                <script type="text/javascript">
                    function fastfizzbuzz() {
                        var fizz = 1, buzz = 1, fizzbuzz = 1;
                        for (var i = 1; i <= 100000000; i++) {
                            if (fizzbuzz == 15) {
                                //document.writeln('fizzbuzz<br />');
                                fizz = 0;
                                buzz = 0;
                                fizzbuzz = 0;
                            } else if(fizz == 3) {
                                //document.writeln('fizz<br />');
                                fizz = 0;
                            } else if(buzz == 5) {
                                //document.writeln('buzz<br />');
                                buzz = 0;
                            } else {
                                //document.writeln(i + '<br />');
                            }
    
                            fizz++;
                            buzz++;
                            fizzbuzz++;
                        }
                    }
    
                    function slowfizzbuzz() {
                        for (var i = 1; i <= 100000000; i++) {
                            if (i % 15 == 0) {
                                //document.writeln('FizzBuzz<br />');
                            } else if (i % 3 == 0) {
                                //document.writeln('Fizz<br />');
                            } else if (i % 5 == 0) {
                                //document.writeln('Buzz<br />');
                            } else {
                                //document.writeln(i + '<br />');
                            }
                        }
                    }
    
                    var startTime=new Date();
                    fastfizzbuzz();
                    var endTime=new Date();
                    document.writeln('Fast: ' + (endTime - startTime) + 'ms<br />');
    
                    startTime=new Date();
                    slowfizzbuzz();
                    endTime=new Date();
                    document.writeln('Slow: ' + (endTime - startTime) + 'ms<br />');
                </script>
            </body>
        </html>

------
bad_user
I wonder what would happen if you gave the interviewer a piece of code that's
not familiar to him, e.g...

    
    
        val translation = List(3 -> "Fizz", 5 -> "Buzz")
    
        val numbers = { 
          def start(from: Int): Stream[Int] = 
            from #:: start(from+1)
          start(1) 
        }
    
        val fizzbuzz = numbers.map(nr => 
          translation.collect { 
            case (k,value) if nr % k == 0 => 
              value
          }
          .reduceLeftOption(_+_)
          .getOrElse(nr.toString))
    
    
        println( fizzbuzz.take(100).mkString("\n") )

~~~
jlgreco
If the interviewer were good, they would play it cool and immediately ask the
candidate to walk through the code out-loud and give reasons that they did
what they did.

------
codesuela
Does someone else have a few programming tests on hand aside from FizzBuzz?
Also InterviewStreet ( <https://www.interviewstreet.com/> ) has a nice
collection of problems of varying degrees of difficulty. Quite handy if you
want to "prepare" for an interview.

~~~
roel_v
We deal with maps a lot, and I usually ask this one: assume a matrix. Fill the
matrix with numbers, so that the outer 'ring' of numbers has the value 1, one
'ring' more to the center has the value 2, and so on. To visualize this,
imagine that this matrix represents a height map, where each number represents
a cell in a surface, and the value of the number is the elevation of the area
of that cell. The result should be a height map of a pyramid. To make things
easier, assume that the number of rows and columns in the matrix is equal, and
that that number is uneven.

Followup-questions may go into the direction of what if some of the
assumptions are loosened, or what are the performance implications of several
possible solutions, or how to do it when iterating in whatever is the most
optimal manner performance-wise considering the storage implementation of the
matrix (avoiding cache misses or disk seeking etc.).

I've only had a single person ever pass this test, out of 10 or so
interviewees.

Another one was where a colleague of mine drew a car on a piece of paper and
asked the candidate to explain how he would design a class hierarchy if one
were to model a car in OOP. His answer was to have a class 'rectangle' and two
classes 'circle' (referring to the box and the two wheels my colleague drew on
the paper). Seeing the incredulous looks on our faces, he then proceeded to an
unintelligible story of 'has-a' vs 'is-a' as it related to the point in the
middle of the circles, and how a 'point' somehow 'was-a' circle except that it
had room in the middle. True story.

~~~
Hupo
>We deal with maps a lot, and I usually ask this one: assume a matrix. Fill
the matrix with numbers, so that the outer 'ring' of numbers has the value 1,
one 'ring' more to the center has the value 2, and so on. To visualize this,
imagine that this matrix represents a height map, where each number represents
a cell in a surface, and the value of the number is the elevation of the area
of that cell. The result should be a height map of a pyramid. To make things
easier, assume that the number of rows and columns in the matrix is equal, and
that that number is uneven.

This sounded fun, so I thought about it for a couple minutes and came up with
the following in JavaScript:

    
    
        var pyramatrix = function(a) {
            a += 1 - (a & 1); // increment a by one if even
            var b = [], // pyramid y-axis
              c = a-(a>>1), // get the "center" of the pyramid (eg. 7 -> 1234321 -> 4 is the center)
              d = function(x) { return Math.abs((x+1)-c) }, // calculate offset from center
              e, f, // values for storing current index offset
              g = ''; // initialize string for pretty output
        
            for(var i = 0; i < a; i++) {
              b[i] = []; // pyramid "x-axis" (current row)
              for (var j = 0; j < a; j++) {
                e = d(i); // get y offset
                f = d(j); // get x offset
                b[i][j] = c - (e > f ? e : f); // set current index to center minus larger offset
                g += '['+b[i][j]+']'; // add value to pretty output
              }
              g += '\n'; // add a line break after each row
            }
            console.log(g); // print pretty output
        }
    

Example usage and output:

    
    
        pyramatrix(7)
        [1][1][1][1][1][1][1]
        [1][2][2][2][2][2][1]
        [1][2][3][3][3][2][1]
        [1][2][3][4][3][2][1]
        [1][2][3][3][3][2][1]
        [1][2][2][2][2][2][1]
        [1][1][1][1][1][1][1]
    

I was pretty satisfied when it worked exactly as intended on the first try!

EDIT: Now that I look at it, you could obviously move e = d(i); outside the
second for loop, but for the sake of posterity I'm not going to change the
solution from what I first came up with.

~~~
roel_v
That looks like a nice solution to me, some of the Javascript idioms I'm not
familiar with, but after looking at it for a while it seems you're using what
I'd consider the 'best' method of generating it - looping over each cell and
calculating the height based on the distance to the 'top' (or 'center',
depending on how you look at it).

Personally I consider the 'naive' version (as in: the first, easy to manually
verify version one would bang out as a prototype) to be one where a matrix is
pre-allocated and each ring is filled in from the outside inwards (so first
assign all 1's, then all 2's, and so on), but funnily enough nobody ever went
that route, not even my colleagues who did it.

~~~
Hupo
>Personally I consider the 'naive' version (as in: the first, easy to manually
verify version one would bang out as a prototype) to be one where a matrix is
pre-allocated and each ring is filled in from the outside inwards (so first
assign all 1's, then all 2's, and so on)

I'd consider the 'naive' version (and the first solution that popped to my
mind pretty much instantly) to be where you first fill the grid with 1's, then
then loop over the next level and add 1 and repeat until you're on the top. So
like this for example:

    
    
      function(a) {
        a = a | 1; // add 1 to even numbers
        var b = new Array(a),
            i, y, x,
            s = 0;
      
        // initialize the array
        for(y = 0; y < a; y++) {
          b[y] = new Array(a);
          for(x = 0; x < a; x++) {
            b[y][x] = 0;
          }
        }
        // turn it into a pyramid heightmap
        for(i = a; i > 0; i--) {
          for(y = s; y < i; y++) {
            for(x = s; x < i; x++) {
              b[y][x]++;
            }
          }
          s++;
        }
        return b;
      }
    

Though in JavaScript it's a bit more complex than it might otherwise be since
you can't just declare a multi-dimensional int array in a single line. Anyway,
I discarded this solution about as fast as I came up with it because I knew
there'd be more clever ways to go about it, and came up with the offset
calculation method a couple minutes after that. And amusingly enough I had to
actually test and iterate this 'naive' version a bit before I got it running
right, whereas my 'complex' solution worked on the first try. Funny how that
goes.

------
46Bit
At this point, I'd think the FizzBuzz test is to get people to explain what
the FizzBuzz test was. Most programmers I'd want to hire would probably have
heard of at least the vague problem,

------
jccc
_40% of the candidates passed the FizzBuzz test_

I do not object to the broad points being made here but I do object to this
interpretation. It's beyond awkward for many good valuable programmers,
stifling really, to do this kind of unrealistic audition programming for a
live audience. You are not just under stress -- you are far, far, far outside
of any demonstration of your true value to the employer.

Perhaps the hiring pool really is that bad, you have a giant pile of
unqualified applicants, and you really must use this kind of blunt instrument
rather than taking the time to talk with candidates and their references and
really get to know their work and their reputations. I've never had to do
hiring and I don't envy you if you do. But I've also never in my life had to
do this kind of test, and I think I'd use it as a filter myself to avoid
working for someone who uses it.

[EDIT: I assumed it would be clear that I'm not talking about the coding
challenge of FizzBuzz. I'm talking about the experience of audition-style
programming. You end up filtering on less important characteristics of
applicants who might otherwise be your best candidates, but think you're
filtering on FizzBuzz.]

~~~
henrikschroder
Fizzbuzz is unrealistic? Really?

It's a for-loop, some conditionals, and printing. If you can't produce this in
a few minutes, you can not program.

The point isn't to make a perfect, working fizzbuzz in the first try, the
point is to find out if your applicant can program at all in the first place.

Ridiculously enough, there are people that can't program that would pass a
normal interview with flying colours, but who utterly fail at fizzbuzz, which
makes it a very valuable tool.

~~~
jccc
Programming on paper opposite an examiner with a stopwatch is indeed
unrealistic. I don't disagree that FizzBuzz is crazy simple as a programming
challenge.

~~~
henrikschroder
I agree as well, which is why it's very important that you don't do that as an
interviewer. The important thing is to check if the applicant can write a
little bit of code from scratch, not if they can do it on time, in front of a
big audience, without errors, with extra stress added on top.

And it sounds like the OP did it in an ok way, and didn't scare away any great
programmers, which makes his conclusion pretty valid, that 60% of his
applicants simply weren't capable.

------
tvjunky
Having been on both sides the interview process and going through hundreds of
candidates, I agree that a code solving problem is a valuable gauge for the
technical acumen of the candidate. In fact the best experiences I have had on
both sides of the table have had a well thought out coding element included.
The better ones had a more real world requirement and aren't so puzzle like
(yes FizzBuzz is pretty simplistic, but it’s still a puzzle).

The biggest issue I see with this approach is the “On Paper” (white board
applies as well) code. This is an unrealistic expectation. Unless you’re
writing all your code on paper and this is a basic skill for your process,
you've already added a factor that may push a normally fine developer out.

If language is unimportant, then process should be as well. Let the developer
solve the problem in the best way they can, even if they do ‘Google’ it. You
can use the amount of ‘googleing’ as another factor to evaluate.

~~~
dean
I agree, let them use a computer, however I would just yank out the ethernet
cable. I don't want to see how well someone can Google.

~~~
tvjunky
I see the point. Still you're not testing how the candidate works. No one
knows everything about everything. We are looking for the right team member to
solve business problems, full stop. Shipped code always wins over the perfect
algorithm sketched on the whiteboard.

~~~
jlgreco
Think of it more as "testing how they _don't_ work." A computer without google
ensures that, however they may work, _"google it"_ is not their only method.

I don't want to hire somebody that can only "ship" with google.

~~~
tvjunky
I still see your point. However, how do you solve a problem if you just don't
know something? To me, a big factor in this test is, did they finish and does
it work? Lets say they understand that Modulo would be the way to go but they
are unsure of the syntax. Where would they find the answer? Or do we say,
sorry you're out...you must memorize everything?

~~~
jlgreco
Being able to look up information on demand is an important skill, but that is
not what is being tested by FizzBuzz. Furthermore, if it is a skill that needs
to be exercised while attempting FizzBuzz, that is a disqualifier.

'FizzBuzz without Google' doesn't mean the candidate is expected to have
memorized everything. Just a _very minimal_ baseline.

You can always test Google-skills separately, if you think it is in doubt.

------
jpdoctor
> _I was surprised to find that only one of the candidates had heard of
> FizzBuzz._

If you were being handed a high fastball over the plate, would you let the
interviewer know it was a high fastball over the plate?

~~~
jlgreco
I do, yes. I figure doing so probably looks better than being able to answer
the question (or rather, than just being able to answer the question, since
you still answer it of course).

~~~
dpritchett
One time I got dinged for using a library to calculate standard deviation (as
a part of larger solution) rather than doing the math by hand. I guess I
assumed they were more interested in codecraft than in arithmetic and I was
wrong.

~~~
jlgreco
Ah, that's pretty crappy. I try to avoid that sort of thing by prefacing all
library calls / fancy language features with a _"I'm going to just use [this
thing]. If you want me to go into that, I can"_. Not so much ask permission as
tell them. It's really a pain in the ass to have to be on guard like that
though.

------
mynameishere
I think you could save time by showing people code like this:

int x=5 % 3

and asking "What is the value of x?" Because a lot of jobs are CRUD and that
form of programming rarely involves the modulus operator.

~~~
dllthomas
Well, assuming it's Haskell (given the lack of semicolon and otherwise valid
Haskell syntax):

x is an unused variable in the function "int" you're defining. This function
returns the ratio (as a ratio, not a float) 5 / 3 for any argument, and is
equivalent to "int = const (5 % 3)", which you would be more likely to see
(probably inlined).

------
MatthewPhillips
Yesterday we got "OOP isn't that great", today we get FizzBuzz... must be that
time of the month. We're probably due for a "idea-guys are worthless" here
soon.

~~~
lukeholder
I have a great idea then: <http://www.youtube.com/watch?v=DkGMY63FF3Q>

