Imran on interviewing programmers

Read this to see how Imran tests his interviewees.  Couldn’t help throwing out some code. (And it turned out that the time for me to look up the method collect() was the most.)  Not sure if the senior developers interviewed by Imran have anything to do with the MCSD.NET folks who were interviewed by Gojko Adzic which I blogged about before.

 

# long version
(1..100).each { |n|
	if (n % 15 == 0)
		print "FizzBuzz ";
	elsif (n % 3 == 0)
		print "Fizz "
	elsif (n % 5 == 0)
		print "Buzz "
	else
		print n.to_s + " ";
	end
}

# short version
p ((1..100).to_a.collect{|n|(n%15==0?"FizzBuzz":n%3==0?"Fizz":n%5==0?"Buzz":n.to_s) + " "; }).to_s;

5 Comments

Phong BuiMarch 10th, 2007 at 8:05 pm

I like the way that Imran shared. But better saying to interviewees that there is no trick just use to filter weak ones.
If those code does not come from other, you’re not a weak programmer :))

Buu NguyenMarch 10th, 2007 at 11:20 pm

Well, I’m not sure, Phong. An assignment like FizzBuzz can only filter very very weak programmers (who somehow able to get out of college and pass the CVs filter phase). I have never asked anybody to write code during an interview, but I think it’s worth to try (of course not FizzBuzz, since someone may accidentally read my blog the day before the interview :-))

If those code does not come from other, you’re not a weak programmer

Phong, I would not consider this as a compliment, you must be kidding me ;-). Regardless, take a look at the comments as Imran’s entry, you will be surprised to see how many ways there are to solve this simple problem.

Phong BuiMarch 11th, 2007 at 10:44 am

I have not attempted to ask interviewees writing any code during intervew. But I had been asking to do that when attending the interview as an interviewee. I feel that was a pretty chance to show my ability. Yes, I prefer to give a little bit harder than FizzBuzz but not as hard as the Login Handler is.

By using Imran’s filtering I did say you are not a weak one. If you don’t feel confident, I respect your thought…haha :))

Buu NguyenMarch 11th, 2007 at 12:44 pm

By using Imran’s filtering I did say you are not a weak one. If you don’t feel confident, I respect your thought…haha :))

I guess my message to the interviewees is “If I, as a project manager, can write the darn code, you [the interviewee], as a developer, should be able to write something better that that” :-). In other words, if a candidate is confident [in its pure meaning] in himself because he is able to write code for FizzBuzz, I surely throw him out of the door :-).

Yes, I prefer to give a little bit harder than FizzBuzz but not as hard as the Login Handler is.

For coding request, besides an algorithm question (e.g. selection vs binary sort, pick one), we can always have some other types, for example “come up with a use case for the Chain of Responsibility pattern and design it” (test pattern and pattern application knowledge) etc.

[...] interviewing him for a developer position. And I have not even asked him to write any code, like FizzBuzz, before deciding to turn him [...]

Leave a comment

Your comment