Yes there is, isn’t there?
That be as it may, putting forth the idea is much like saying “Nobody can lick their own elbow”: Whether it’s true or false, everyone who reads it is going to try it.
Nobody commented their code! Okay, so we all understand this simple task but one of the biggest headaches is working with other people’s code when they leave no clues to what they’re trying to do. The benefits of using a top programmer to quickly write brilliant code are negated if the maintenance consequently takes forever.
I too tried the solution, and I too timed myself. I think if you gave any small problem in any context you will get a lot of people trying to solve it for the hell of it.
I would agree that it is a slightly biased test in that to do it in a reasonable time it requires knowladge of the modulo operator. I guess I would expect decent programers to be aware of it, but still…
Well, the length to which these comments have gone, and off the mark at that, is something to think about.
I’ve interviewed 100’s of programmers over the years, and many of them (20%? I don’t know) couldn’t write fizzbuzz, and I would never recommend those for any programming job. In fact, if no one else were available, I would recommend hiring no one - adding these people would probably have a negative impact.
However, there’s been a conversation around my office about the concept of a ‘computer trade school’, say, for non-programming computer roles. For example, desktop support, server or LAN admin, etc. Like the ‘computer operator’ of days past.
I know there are existing programs, some with more merit, some with less. And like the fizzbuzz solution I expect people will answer this a debate over the relative merit of existing education applied to a ‘computer operator’ role.
But I’m interested in if it is even possible to come up with a proper program. Everyone in my office is quite impressed at the quality of local tradesmen from the local community college. I think it would be valueable to everyone if that quality control could be applied to a non-programming computer trade. And, would it be necessary for these graduates to write fizzbuzz? I would hope even these graduates could write fizzbuzz, but they might never have to.
IMHO, all real programmers understand flow control, and those who don’t aren’t programmers (yet, until they do). I’m also surprised when people don’t understand at least the concept of a stack, but I have met some reasonably productive programmers that don’t - and they pick it up right away when it is explained. I think any fizzbuzz test that requires flow control is a good first line. For more advanced jobs further lines will be needed.
Last time I hired a student, I did 10 interviews, and one of the interview questions was “discuss the difference between assignment in C/C++ and Java”. Everybody except 2 said they were the same, even when I tried to prod them a little. Only 2 of 10 understood the difference between objects and object references. Is this because Java is taught and pointers are neglected? Perhaps, but I don’t think so, because the wrong 80% seemed to think Java assignment copied by value like C/C++.
I think some of the 80% might have done an OK job writing a program for me, but the task for the student was actually to use AspectJ to retrofit some instrumentation into some legacy code. One of the 2 that got this question was hired, and he did a fine job, and I had a great time acting as a reference for his job search on graduation.
But I don’t think you’d need a guy like that to configure and maintain an Exchange e-mail server. Nor would you want that (he’d get bored), nor would he want that (he’d be bored) - overqualified.
Any thoughts on what a non-programming fizzbuzz test would be for hiring a desktop support/server/LAN admin?
TristanK has some ideas on non-programming FizzBuzz:
http://blogs.technet.com/tristank/archive/2007/02/28/it-s-not-just-a-programming-problem.aspx
Feel free to email him directly if you need to, he’s a great guy.
ms tsql
sorry it’s procedural
declare @bzr varchar(4);set nocount on;declare @onehundredniiiiinetynine int;set @onehundredniiiiinetynine=1;declare @rdir varchar(8);declare @200 int;set @200=1000*@onehundredniiiiinetynine/10;declare @onehundredniiiinetynine int;set @onehundredniiiiinetynine=@onehundredniiiiinetynine;declare @not int;set @onehundredniiiinetynine=1;declare @exists int;set @bzr = 'fizz';set @200=201-@onehundredniiiinetynine-(@onehundredniiiinetynine*(@200%201));set @not=0;while @onehundredniiiinetynine=@200 begin set nocount on;declare @buzr varchar(200);set @exists=floor(21*@200/31415/*9*/);set @buzr=NULL;select @rdir=coalesce(fizzbuzz+nullif(fizz,@bzr)+nullif(fizz,'buzz')+nullif(fizz,@bzr+'buzz'),fizz) from (select convert(varchar(3),@onehundredniiiinetynine) as fizzbuzz, case @onehundredniiiinetynine%((7^4)%9) when @not then @bzr else '' end+case @onehundredniiiinetynine%(12(7754)^1) when @exists then 'buzz' else '' end as fizz) bitwise_nor;print @rdir+coalesce(@buzr+'fizz','') set nocount off;set @exists=NULL;set @onehundredniiiinetynine=@onehundredniiiinetynine+1;end;
# //alternating perl and java
# stairwaytoheaven.pl.java
$flag = exists ($ladywhoknows)
allThatGlitters.setColor(Color.gold)
she.buy("Stairway to Heaven");
if( she.getsThere() ) { she.knows(); }
foreach $c @store { @store[$c] = "closed"; }
if( she.oneword() ) { she.setCanGetWhatSheCameFor(true); }
# oh ohhohh
and she-buying("a stairway to heaven");
if( !she.wantsToBeSure() ) { boolean signOnTheWall = true; }
int sometimes = words.numOfMeanings();
assert sometimes = 2;
Better image
http://www.angelo.com/assets/images/M_Angelo_Batio_Quad_One.jpg
or
http://www.metal-rules.com/zine/images/stories/interviews/_2006/MAB/gilletteangelo.jpg
Scott, you’re so right. Those kick ass. I updated this article with one of the pics you selected:
Hmm - Think I have an idea for a new killer video game here: “Programmer Hero”. Start off with FizzBuzz, and progress up to The Traveling Salesman. Venues could be interview rooms at Google, MicroSoft, ZoomInfo (shameless plug).
Code should be readable. If a programmer can’t read, how can you expect that programmer to read what they just wrote in code? Good code is readable. Just like you want to be able to read the resume.
What surprises me is that even if I can write a FizzBuzz solution, it still hasn’t guaranteed me a job with any employer that wants a programmer.
#include iostream
main()
{
for( int i = 1 ; i = 100 ; i ++ )
{
if( ( i % 3 ) ( i % 5 ) )
std::cout i std::endl ;
else
std::cout
( i % 3 ? "" : "Fizz" )
( i % 5 ? "" : "Buzz" )
std::endl ;
}
}
Hmm… I found a feature in your blog in the above message of mine, as it left out some text in my insertion. Do you see where?
I’m not even a programmer, and when I read the FizzBuzz thing, the code popped up in my head, in BASIC. Literally five seconds.
Why, oh why, I seem to like the spider guitar ?
After reading this, the thing that popped into my head was “people like solving little programming problems”. So I made a blog for a daily dose of little programming projects that should be completable in just about any language (most require the ability to output text and manipulate numbers, so it does limit it to a certain level) and in a relatively short amount of time. Today is day #3 for me, and I have 3 projects up already that are about the size and scope of FizzBuzz. If you have any interest, click my name and check it out.
I feel slightly dirty having just posted a blatant plug like that…
The interviewer who is expecting, and eventually selecting, a programmer to developing the FizzBuzz logic in less than couple of minutes, is actually trying to build a team for a project which is more than likely to lead to failure and waste millions of dollars and leading the project stakeholders to suicidal death. A programming skill is not something that may spontaneously be predicted and come up with the best logic suitable for a given scenario.
In fact, I did not solve FissBuzz within 2 minutes. I immediately had a question: “Will the special outputs change often or are they constant forever?”.
If they change often, I think, most solutions are not very good, because adding another special output - like “Qux” if number % {7, 23, 58} == 0 - will be a bit more difficult.
I’d rather create something like this:
function FizzBuzz(int Start, int End, Hashtable Specials) {
for(int Counter = Start; Counter End; Counter++) {
foreach(Specials as Constraints = Output) {
if(sum(map(fun(X) = Counter % X end)) == 0) print(Output);
} // foreach
} // for
} //function
(Pseudocode. Influenced by a lot of Stuff )
Btw, this assumes A % B 0. Who sees why?
Of course, the sum(map(…)) can be replaced by foldl for more obscurity and efficience
I think the reason I was compelled to code FizzBuzz is because I had to prove to myself that I wasn’t as incompetent as you described.