<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jason Rowe &#187; Interview Question</title>
	<atom:link href="http://jasonrowe.com/tag/interview-question/feed/" rel="self" type="application/rss+xml" />
	<link>http://jasonrowe.com</link>
	<description>enjoying the web</description>
	<lastBuildDate>Sun, 13 May 2012 14:05:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Interview Programming Question &#8211; find perfect numbers</title>
		<link>http://jasonrowe.com/2009/09/15/interview-programming-question-i-was-asked-once/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=interview-programming-question-i-was-asked-once</link>
		<comments>http://jasonrowe.com/2009/09/15/interview-programming-question-i-was-asked-once/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 05:37:17 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Interview Question]]></category>

		<guid isPermaLink="false">http://jasonrowe.com/?p=691</guid>
		<description><![CDATA[Here is a problem I got once for a entry level programming job. I received lots of help from the person asking and it turned out to be a good experience. If you ever use this in an interview be &#8230; <a href="http://jasonrowe.com/2009/09/15/interview-programming-question-i-was-asked-once/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Here is a problem I got once for a entry level programming job. I received lots of help from the person asking and it turned out to be a good experience. If you ever use this in an interview be nice because this really has little to do with real world programming and more about finding out about the person.

<strong>Question</strong>: Create a method to find perfect numbers. In mathematics, a perfect number is defined as a positive integer which is the sum of its proper positive divisors

<strong>Possible Answer:</strong>

<pre class="brush: csharp; title: ; notranslate">

class Program
{
static void Main()
{

for (int j = 1; j &lt; 10000; j++)
{
if (j % 2 == 0)
{
if (PerfectNumber.IsPerfectNumber(j))
Console.WriteLine(j + &quot;is perfect&quot;);
}
}
Console.ReadLine();
}
}

public static class PerfectNumber
{
public static bool IsPerfectNumber(int n)
{
var totalFactor = 0;
for (var i = 1; i &lt; n; i++)
{
if(n % i == 0)
{
totalFactor = totalFactor + i;
}
}

return totalFactor == n;
}
}

</pre>]]></content:encoded>
			<wfw:commentRss>http://jasonrowe.com/2009/09/15/interview-programming-question-i-was-asked-once/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

