Thomas Delrue on 13 Sep 2017 08:01:49 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Why Can't Programmers.. Program?

On Wednesday, September 13, 2017 10:47:25 AM EDT ronpguilmet wrote:
>This is not New, but it is new to me. Apparently this is a programming
>interview question to weed out applicants. It's called FizzBuzz. Write a
>program that prints the numbers from 1 to 100. But for multiples of three
>print "Fizz" instead of the number and for the multiples of five print
>"Buzz". For numbers which are multiples of both three and five print

I'm going to make an ass of myself, but...

i = 1;
while (i <= 100):
    output = "";
    if (i % 3 == 0):
        output += "Fizz";
    if (i % 5 == 0):
        output += "Buzz";
    if (output == ""):
        output = str(i);

    i += 1;

I could do it in other languages as well, but this was the fastest and just 
off the top of my head...

Developer interview questions are usually there to make the interviewER feel 
good and superior about themselves. They hardly ever actually ask things 
related to the job. As much as I dislike medium, I'll link to this funny read:
"What if companies interviewed translators the way they interview coders?"

If you want to do a proper interview: give your candidate a problem you're 
actually trying to solve at the moment or one you've just recently solved in 
your day-to-day job. Tell them how long it should take them and send them home 
to work on it. Pay them for however long you told them it would/should take so 
that you don't make them feel like you're getting free labor out of them.
Then have them come in some other time to walk you through their solution.

Attachment: signature.asc
Description: This is a digitally signed message part.

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --