<?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: Facebook Programming Puzzles - A Boatload of Fun?</title>
	<atom:link href="http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/</link>
	<description>I say potato, you say potato...</description>
	<pubDate>Thu, 08 Jan 2009 18:09:27 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jesse</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3819</link>
		<dc:creator>Jesse</dc:creator>
		<pubDate>Fri, 27 Apr 2007 15:25:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3819</guid>
		<description>Hey, I wrote my own implementation and posted it: http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/

How does it compare to yours?</description>
		<content:encoded><![CDATA[<p>Hey, I wrote my own implementation and posted it: <a href="http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/" rel="nofollow">http://20bits.com/2007/04/27/facebook-job-puzzles-prime-bits/</a></p>
<p>How does it compare to yours?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3455</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Sun, 15 Apr 2007 07:17:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3455</guid>
		<description>This problem took me two days, but I finally solved it.  It took about 3 separate "eureka"s for me to figure it out.  It's nice to not be able to find a solution online, either :)

It can be done in worst case log(n) or log^2(n) depending on whether you consider array mapping to be one computation or not.

On my system it calculates the number of primes between 482904823908 and 905848920 [answer: 317303301] in about .002 seconds... a slight improvement over 1000 years.

As per the purpose of this problem, it is definitely a very difficult problem -- each of their problems is designed to appeal to a certain type of engineer.  This one seems to me to appeal to the "C guru" or "Comp Sci Nerd" who enjoys handling things on the bit level.  Their other problems are for general problem solvers and PHP gurus, it seems.

-sam</description>
		<content:encoded><![CDATA[<p>This problem took me two days, but I finally solved it.  It took about 3 separate &#8220;eureka&#8221;s for me to figure it out.  It&#8217;s nice to not be able to find a solution online, either <img src='http://www.hung-truong.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>It can be done in worst case log(n) or log^2(n) depending on whether you consider array mapping to be one computation or not.</p>
<p>On my system it calculates the number of primes between 482904823908 and 905848920 [answer: 317303301] in about .002 seconds&#8230; a slight improvement over 1000 years.</p>
<p>As per the purpose of this problem, it is definitely a very difficult problem &#8212; each of their problems is designed to appeal to a certain type of engineer.  This one seems to me to appeal to the &#8220;C guru&#8221; or &#8220;Comp Sci Nerd&#8221; who enjoys handling things on the bit level.  Their other problems are for general problem solvers and PHP gurus, it seems.</p>
<p>-sam</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3396</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 12 Apr 2007 20:16:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3396</guid>
		<description>also, some guy on reddit used a highly mathematical language called J to solve it, and the program (which is utterly unreadable) supposedly can solve the problem even for the range between the numbers 50! and 100! (where 50 factorial is, according to the post, 30414093201713378043612608166064768844377641568960512000000000000).</description>
		<content:encoded><![CDATA[<p>also, some guy on reddit used a highly mathematical language called J to solve it, and the program (which is utterly unreadable) supposedly can solve the problem even for the range between the numbers 50! and 100! (where 50 factorial is, according to the post, 30414093201713378043612608166064768844377641568960512000000000000).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hungtruong</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3391</link>
		<dc:creator>hungtruong</dc:creator>
		<pubDate>Thu, 12 Apr 2007 18:19:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3391</guid>
		<description>Right, I know what O(n) notation is... I didn't see that less than O(n) requirement, which makes this problem a lot more interesting than it was before.

And by more interesting, I mean I might actually put some thought into it now!</description>
		<content:encoded><![CDATA[<p>Right, I know what O(n) notation is&#8230; I didn&#8217;t see that less than O(n) requirement, which makes this problem a lot more interesting than it was before.</p>
<p>And by more interesting, I mean I might actually put some thought into it now!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Facebook Schmacebook</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3388</link>
		<dc:creator>Facebook Schmacebook</dc:creator>
		<pubDate>Thu, 12 Apr 2007 17:53:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3388</guid>
		<description>A O(n) implementation when the possible inputs to that function are 64-bit integers would take thousands of years to finish running (on a modern GHz computer), and still on the order of years when run on the fastest TFLOP supercomputers available today.

So yes, if you thought it was "too easy" (in the sense that you gave a linear-time solution that just examines all the numbers in the range), then you probably fell for their red herring.</description>
		<content:encoded><![CDATA[<p>A O(n) implementation when the possible inputs to that function are 64-bit integers would take thousands of years to finish running (on a modern GHz computer), and still on the order of years when run on the fastest TFLOP supercomputers available today.</p>
<p>So yes, if you thought it was &#8220;too easy&#8221; (in the sense that you gave a linear-time solution that just examines all the numbers in the range), then you probably fell for their red herring.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hungtruong</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3385</link>
		<dc:creator>hungtruong</dc:creator>
		<pubDate>Thu, 12 Apr 2007 16:40:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3385</guid>
		<description>Hmmm. I could've sworn I didn't see that "running time must be better than O(n)" when I looked at the problem for the first time... Weird.

I have a feeling my solution isn't O(n). So I might take a look at it and try again.</description>
		<content:encoded><![CDATA[<p>Hmmm. I could&#8217;ve sworn I didn&#8217;t see that &#8220;running time must be better than O(n)&#8221; when I looked at the problem for the first time&#8230; Weird.</p>
<p>I have a feeling my solution isn&#8217;t O(n). So I might take a look at it and try again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/comment-page-1/#comment-3384</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Thu, 12 Apr 2007 16:36:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.hung-truong.com/blog/2007/03/30/facebook-programming-puzzles-a-boatload-of-fun/#comment-3384</guid>
		<description>did you get this part ?

   Your implementation should have a running time faster than O(n), where n is b - a. 

id like to see how you solved it.</description>
		<content:encoded><![CDATA[<p>did you get this part ?</p>
<p>   Your implementation should have a running time faster than O(n), where n is b - a. </p>
<p>id like to see how you solved it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
