Date: Tue, 5 Jun 2007 12:25:45 +0000
Reply-To: iw1junk@COMCAST.NET
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ian Whitlock <iw1junk@COMCAST.NET>
Subject: Interview questions
Summary: Interview questions
#iw-value=1
A common request on SAS-L is for interview questions either from the
interviewer or the interviewee. I recently ran into the question:
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 "FizzBuzz".
Apparently quite a lot of traffic has been generated this year on the
question. (Google "fizzbuzz test".)
Several people responded with code that would be written in SAS as
data _null_ ;
put "1" / "2" / "FIZZ" / "4" / "BUZZ" /
....
;
run ;
One added, "Yeah it's not elegant (on purpose). But it shows that I can
follow the directions and produce code that works. If the interviewer wants
to do a code review and ask me to defend my methodology, I'm happy to do
so."
What do you think about such questions? Are they useful? Do you think the
average SAS programmer can answer the question? What about the above
answer? Is it good? It reminds me of the end of my first programming
course. The teacher said, "Now you now how to write program, but do you
know when to write a program?" It is something I have kept in mind over
many years.
Ian Whitlock