<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: A &#8220;FizzBuzz&#8221; Faux Pas</title>
	<atom:link href="http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/</link>
	<description></description>
	<lastBuildDate>Sun, 19 May 2013 04:24:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: The Main Reason Why You Suck at Interviews: Lack of Preparation</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-6926</link>
		<dc:creator>The Main Reason Why You Suck at Interviews: Lack of Preparation</dc:creator>
		<pubDate>Thu, 24 Feb 2011 10:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-6926</guid>
		<description><![CDATA[[...] talked about interviews from one perspective or another on several occasions—you might even say it is a pet subject of mine. It&#8217;s fascinating [...]]]></description>
		<content:encoded><![CDATA[<p>[...] talked about interviews from one perspective or another on several occasions—you might even say it is a pet subject of mine. It&#8217;s fascinating [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dilip</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-6251</link>
		<dc:creator>Dilip</dc:creator>
		<pubDate>Sun, 17 Oct 2010 03:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-6251</guid>
		<description><![CDATA[Somewhat off the topic question: How is this &#039;FizzBuzz&#039; problem asked in English?  In kids parties, to entertain them, I used to ask exactly the same question with same variations, to young kids sitting in a circle. I would say:
...
When your turn comes, say the next number. But, 
1. If your number is a multiple of 3 say 3 instead. 
2. If your number is a multiple of 5 say 5 instead. 
3. If your number is a multiple of both 3 &amp; 5 (like 15, 30),  don&#039;t say either 3 or 5, instead say 15. 

I think something on these lines would be a better statement of the &#039;FizzBuzz&#039; problem. 
So. if the 3rd condition was just: if your number is a multiple of 15 say 15.
Then, 3 (instead of 15) is not a wrong answer, as the last part was not explicitly spelled out.  
Incomplete business problem definition :)]]></description>
		<content:encoded><![CDATA[<p>Somewhat off the topic question: How is this &#8216;FizzBuzz&#8217; problem asked in English?  In kids parties, to entertain them, I used to ask exactly the same question with same variations, to young kids sitting in a circle. I would say:<br />
&#8230;<br />
When your turn comes, say the next number. But,<br />
1. If your number is a multiple of 3 say 3 instead.<br />
2. If your number is a multiple of 5 say 5 instead.<br />
3. If your number is a multiple of both 3 &amp; 5 (like 15, 30),  don&#8217;t say either 3 or 5, instead say 15. </p>
<p>I think something on these lines would be a better statement of the &#8216;FizzBuzz&#8217; problem.<br />
So. if the 3rd condition was just: if your number is a multiple of 15 say 15.<br />
Then, 3 (instead of 15) is not a wrong answer, as the last part was not explicitly spelled out.<br />
Incomplete business problem definition :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Skorkin</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-6229</link>
		<dc:creator>Alan Skorkin</dc:creator>
		<pubDate>Sun, 17 Oct 2010 02:04:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-6229</guid>
		<description><![CDATA[I am glad you&#039;re enjoying it :). It was a while since I wrote this, but the way I am feeling at the moment I think the onus is both on the interviewee and the interviewer. The interviewee loses nothing by taking all questions seriously, so might as well respect the question even if it seems stupid. The interviewer gains by not being a syntax nazi and making allowances for the conditions, as long as they&#039;re heading in the right direction I don&#039;t really need things to be correct.]]></description>
		<content:encoded><![CDATA[<p>I am glad you&#8217;re enjoying it :). It was a while since I wrote this, but the way I am feeling at the moment I think the onus is both on the interviewee and the interviewer. The interviewee loses nothing by taking all questions seriously, so might as well respect the question even if it seems stupid. The interviewer gains by not being a syntax nazi and making allowances for the conditions, as long as they&#8217;re heading in the right direction I don&#8217;t really need things to be correct.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Iain Dooley</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-6182</link>
		<dc:creator>Iain Dooley</dc:creator>
		<pubDate>Sat, 16 Oct 2010 15:56:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-6182</guid>
		<description><![CDATA[Bit of a latecomer to this post ... Just discovered this blog and finding it curiously addictive so I&#039;m reading many old articles at once.

One important part of the original post I think everyone is missing, especially the TDD responses, is that the interviewee is expected to write the code on paper, obviously not being able to execute it before submitting it.

That would certainly make me respect the question and take my time writing my solution! I remember questions like these on Uni exams were the downfall of many. 

If you ask me to submit code without compilation/execution I start to get nervous, and I think for obvious reasons - several of the above responses had simple errors that would have meant they failed the test if they didn&#039;t see the code run first before handing it over for examination.]]></description>
		<content:encoded><![CDATA[<p>Bit of a latecomer to this post &#8230; Just discovered this blog and finding it curiously addictive so I&#8217;m reading many old articles at once.</p>
<p>One important part of the original post I think everyone is missing, especially the TDD responses, is that the interviewee is expected to write the code on paper, obviously not being able to execute it before submitting it.</p>
<p>That would certainly make me respect the question and take my time writing my solution! I remember questions like these on Uni exams were the downfall of many. </p>
<p>If you ask me to submit code without compilation/execution I start to get nervous, and I think for obvious reasons &#8211; several of the above responses had simple errors that would have meant they failed the test if they didn&#8217;t see the code run first before handing it over for examination.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cecil</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4998</link>
		<dc:creator>Cecil</dc:creator>
		<pubDate>Tue, 04 May 2010 16:35:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4998</guid>
		<description><![CDATA[I&#039;ve never been asked this question yet, but if I do I&#039;m totally pulling out J.

((0 i.~15 3 5&#124;]){::&#039;FizzBuzz&#039;;&#039;Fizz&#039;;&#039;Buzz&#039;;&quot;:)&quot;0&gt;:i.100]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve never been asked this question yet, but if I do I&#8217;m totally pulling out J.</p>
<p>((0 i.~15 3 5|]){::&#8217;FizzBuzz&#8217;;'Fizz&#8217;;'Buzz&#8217;;&#8221;:)&#8221;0&gt;:i.100</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sell textbooks online</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4824</link>
		<dc:creator>sell textbooks online</dc:creator>
		<pubDate>Tue, 27 Apr 2010 15:17:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4824</guid>
		<description><![CDATA[It&#039;s great how you can go back and remind yourself although things may seem easy and trivial of you rush threw something just because you think it&#039;s easy or no big deal you are more likely to make mistakes.  There is a reason your teachers back in school used to tell you to always double check your work before handing it over!]]></description>
		<content:encoded><![CDATA[<p>It&#8217;s great how you can go back and remind yourself although things may seem easy and trivial of you rush threw something just because you think it&#8217;s easy or no big deal you are more likely to make mistakes.  There is a reason your teachers back in school used to tell you to always double check your work before handing it over!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sirupsen</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4736</link>
		<dc:creator>Sirupsen</dc:creator>
		<pubDate>Mon, 19 Apr 2010 16:24:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4736</guid>
		<description><![CDATA[Haha. Damn. It&#039;s not the code though, it&#039;s bad ram in my mind.]]></description>
		<content:encoded><![CDATA[<p>Haha. Damn. It&#8217;s not the code though, it&#8217;s bad ram in my mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Srdjan Pejic</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4733</link>
		<dc:creator>Srdjan Pejic</dc:creator>
		<pubDate>Mon, 19 Apr 2010 15:33:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4733</guid>
		<description><![CDATA[I came to make that exact comment. When I first did the FizzBuzz test, I wrote 4 tests. 3 for the conditionals and one for a boundary condition.

Now, even when I do a throwaway or one-time-use program, I write a small test suite checking the boundaries, possible errors in logic, etc. It&#039;s a good way to get into TDD.]]></description>
		<content:encoded><![CDATA[<p>I came to make that exact comment. When I first did the FizzBuzz test, I wrote 4 tests. 3 for the conditionals and one for a boundary condition.</p>
<p>Now, even when I do a throwaway or one-time-use program, I write a small test suite checking the boundaries, possible errors in logic, etc. It&#8217;s a good way to get into TDD.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alan Skorkin</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4729</link>
		<dc:creator>Alan Skorkin</dc:creator>
		<pubDate>Mon, 19 Apr 2010 10:53:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4729</guid>
		<description><![CDATA[Hi Mike,

You&#039;re right, I guess there is always a way to turn even a relatively trivial question into a more complex one, you just need to be creative and know what you&#039;re trying to find out.]]></description>
		<content:encoded><![CDATA[<p>Hi Mike,</p>
<p>You&#8217;re right, I guess there is always a way to turn even a relatively trivial question into a more complex one, you just need to be creative and know what you&#8217;re trying to find out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Woodhouse</title>
		<link>http://www.skorks.com/2010/04/a-fizzbuzz-faux-pas/comment-page-1/#comment-4728</link>
		<dc:creator>Mike Woodhouse</dc:creator>
		<pubDate>Mon, 19 Apr 2010 10:46:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.skorks.com/?p=1708#comment-4728</guid>
		<description><![CDATA[I think it was probably in reaction to the Coding Horror article that I wrote

1.upto(100) { &#124;n&#124; puts n % 3 == 0 ? n % 5 == 0 ? &quot;fizzbuzz&quot; : &quot;buzz&quot; : n % 5 == 0 ? &quot;fizz&quot; : n }

But it&#039;s not necessarily the question itself that matters, it&#039;s what you get from the interviewee&#039;s answer - the if/elsif solution given (and my short one above, for that matter) contains some duplication, for example (tests for modulus 3 or 5, repetition of &quot;fizz&quot; and &quot;buzz&quot;) . So a the reaction to a followup question such as &quot;how might you refactor that?&quot; might be informative, or &quot;how would you minimise the locus of change if I introduced &#039;foo&#039; for 7, or wanted an arbitrary set of numbers and words?&quot;

If asked to refactor, I might write something like the following. I may also comment that it&#039;s probably overkill in this relatively trivial case but I&#039;d hope to show that I have some grasp of advanced (?) concepts like DRY and refactorings such as Extract Method.

def fizzbuzz(n)
  fb_string = [[3,&#039;fizz&#039;],[5,&#039;buzz&#039;]].inject(&#039;&#039;) do &#124;output, fb&#124;
    divisor, replacement = fb
    output &lt;&lt; ( n % divisor == 0 ? replacement : &#039;&#039; )
  end
  fb_string.size == 0 ? n : fb_string
end
(1..100).each { &#124;n&#124; p fizzbuzz(n) }

I might also comment that, should it be worthwhile to really hone the code, I would like to try simplifying more to remove the temporary string assignment and size check.]]></description>
		<content:encoded><![CDATA[<p>I think it was probably in reaction to the Coding Horror article that I wrote</p>
<p>1.upto(100) { |n| puts n % 3 == 0 ? n % 5 == 0 ? &#8220;fizzbuzz&#8221; : &#8220;buzz&#8221; : n % 5 == 0 ? &#8220;fizz&#8221; : n }</p>
<p>But it&#8217;s not necessarily the question itself that matters, it&#8217;s what you get from the interviewee&#8217;s answer &#8211; the if/elsif solution given (and my short one above, for that matter) contains some duplication, for example (tests for modulus 3 or 5, repetition of &#8220;fizz&#8221; and &#8220;buzz&#8221;) . So a the reaction to a followup question such as &#8220;how might you refactor that?&#8221; might be informative, or &#8220;how would you minimise the locus of change if I introduced &#8216;foo&#8217; for 7, or wanted an arbitrary set of numbers and words?&#8221;</p>
<p>If asked to refactor, I might write something like the following. I may also comment that it&#8217;s probably overkill in this relatively trivial case but I&#8217;d hope to show that I have some grasp of advanced (?) concepts like DRY and refactorings such as Extract Method.</p>
<p>def fizzbuzz(n)<br />
  fb_string = [[3,'fizz'],[5,'buzz']].inject(&#8221;) do |output, fb|<br />
    divisor, replacement = fb<br />
    output &lt;&lt; ( n % divisor == 0 ? replacement : &#039;&#039; )<br />
  end<br />
  fb_string.size == 0 ? n : fb_string<br />
end<br />
(1..100).each { |n| p fizzbuzz(n) }</p>
<p>I might also comment that, should it be worthwhile to really hone the code, I would like to try simplifying more to remove the temporary string assignment and size check.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: basic

 Served from: www.skorks.com @ 2013-05-20 01:11:05 by W3 Total Cache -->