<?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>夜弓的咖啡馆 &#187; 求职</title>
	<atom:link href="http://yegong.net/tag/job-wanted/feed/" rel="self" type="application/rss+xml" />
	<link>http://yegong.net</link>
	<description>夜弓=Cooper=某间咖啡室的老板(尚未开张)</description>
	<lastBuildDate>Tue, 27 Jul 2010 04:18:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<item>
		<title>求职测试准备3</title>
		<link>http://yegong.net/job-test-3/</link>
		<comments>http://yegong.net/job-test-3/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 19:55:50 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[求职]]></category>
		<category><![CDATA[笔试]]></category>

		<guid isPermaLink="false">http://yegong.net/?p=177</guid>
		<description><![CDATA[题目： 有1000桶酒，其中1桶有毒。而一旦吃了，毒性会在1周后发作。现在我们用小老鼠做实验，要在1周内找出那桶毒酒，问最少需要多少老鼠。 最近爱上EMC的测试了:) 解答： 网上一堆答案，搞得及繁琐无比，让我来化简吧。 设有x只老鼠，7天后有死亡和存活两种状态，因此能够提供的信息量为2x。解2x&#62;1000即可。 Leave a comment Category : Coding, Thinking &#124; Tags : EMC, 求职, 笔试]]></description>
			<content:encoded><![CDATA[<p><strong>题目：</strong></p>
<p><strong></strong>有1000桶酒，其中1桶有毒。而一旦吃了，毒性会在1周后发作。现在我们用小老鼠做实验，要在1周内找出那桶毒酒，问最少需要多少老鼠。</p>
<p>最近爱上EMC的测试了:)</p>
<p><strong>解答：</strong></p>
<p>网上一堆答案，搞得及繁琐无比，让我来化简吧。</p>
<p>设有x只老鼠，7天后有死亡和存活两种状态，因此能够提供的信息量为2<sup>x</sup>。解2<sup>x</sup>&gt;1000即可。</p>
<p><a href="http://yegong.net/job-test-3/#comments">Leave a comment</a></p>
<p>Category : <a href="http://yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a>, <a href="http://yegong.net/category/thinking/" title="View all posts in Thinking" rel="category tag">Thinking</a> | Tags : <a href="http://yegong.net/tag/emc/" rel="tag">EMC</a>, <a href="http://yegong.net/tag/job-wanted/" rel="tag">求职</a>, <a href="http://yegong.net/tag/test-on-paper/" rel="tag">笔试</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://yegong.net/job-test-3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>求职测试准备2</title>
		<link>http://yegong.net/job-test-2/</link>
		<comments>http://yegong.net/job-test-2/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 09:25:11 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[求职]]></category>
		<category><![CDATA[面试]]></category>

		<guid isPermaLink="false">http://yegong.net/?p=175</guid>
		<description><![CDATA[题目： 地面上有N个硬币，若干机器人在处理这些硬币。机器人首先随机选择一个硬币，若此硬币正面向上，则将其抛出；若此硬币反面向上则直接将其翻转。问最后硬币正反比例的情况。 据说题目来自EMC面试 解答： 假设最后硬币正反比例会稳定。设地面共有N个硬币，最终有Np个硬币正面向上。 稳定时，则每次机器人将一个硬币由正面翻为反面的概率应当等于它将一个硬币由反面翻为正面的概率。 则 1/2 * p = 1-p 解得 p = 2/3 检验硬币是否会稳定：初始时讨论p &#62; 2/3和p &#60; 2/3两种情况，易证p依概率收敛到2/3。 Leave a comment Category : Coding, Thinking &#124; Tags : EMC, 求职, 面试]]></description>
			<content:encoded><![CDATA[<p><strong>题目：</strong></p>
<p>地面上有N个硬币，若干机器人在处理这些硬币。机器人首先随机选择一个硬币，若此硬币正面向上，则将其抛出；若此硬币反面向上则直接将其翻转。问最后硬币正反比例的情况。</p>
<p>据说题目来自EMC面试</p>
<p><strong>解答：</strong></p>
<p>假设最后硬币正反比例会稳定。设地面共有N个硬币，最终有Np个硬币正面向上。</p>
<p>稳定时，则每次机器人将一个硬币由正面翻为反面的概率应当等于它将一个硬币由反面翻为正面的概率。</p>
<p>则 1/2 * p = 1-p</p>
<p>解得 p = 2/3</p>
<p>检验硬币是否会稳定：初始时讨论p &gt; 2/3和p &lt; 2/3两种情况，易证p依概率收敛到2/3。</p>
<p><a href="http://yegong.net/job-test-2/#comments">Leave a comment</a></p>
<p>Category : <a href="http://yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a>, <a href="http://yegong.net/category/thinking/" title="View all posts in Thinking" rel="category tag">Thinking</a> | Tags : <a href="http://yegong.net/tag/emc/" rel="tag">EMC</a>, <a href="http://yegong.net/tag/job-wanted/" rel="tag">求职</a>, <a href="http://yegong.net/tag/interview/" rel="tag">面试</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://yegong.net/job-test-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>求职测试准备1</title>
		<link>http://yegong.net/job-test-1/</link>
		<comments>http://yegong.net/job-test-1/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 09:03:09 +0000</pubDate>
		<dc:creator>cooper</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Thinking]]></category>
		<category><![CDATA[EMC]]></category>
		<category><![CDATA[求职]]></category>
		<category><![CDATA[笔试]]></category>
		<category><![CDATA[计算机]]></category>

		<guid isPermaLink="false">http://yegong.net/?p=173</guid>
		<description><![CDATA[题目： 写一个函数 int p(int x, int y)，输出x到y再到x (假设x&#60;y) 要求只用一个语句完成，不允许用?:等多元操作符和关键字。只能用一个printf库函数。 据说题目来自EMC笔试 解答： 此题难点显然在后面那些要求上。只用一个语句完成的要求很容易让人联想到函数递归。因此 int p(int x, int y){ return printf("%d ", x) &#38;&#38; (x&#60;y &#38;&#38; p(x+1, y)); } 可以完成从x打印到y的任务。 进一步的有 int p(int x, int y){ return printf("%d ", x) &#38;&#38; (x&#60;y &#38;&#38; p(x+1, y)) &#124;&#124; printf("%d ", x); } 但是，值得注意的是题目要求只使用一个printf函数，因此，最后那个printf也必须改为递归语句，即 int p(int x, int y){ return [...]]]></description>
			<content:encoded><![CDATA[<p><strong>题目：</strong></p>
<p>写一个函数 int p(int x, int y)，输出x到y再到x (假设x&lt;y)</p>
<p>要求只用一个语句完成，不允许用?:等多元操作符和关键字。只能用一个printf库函数。</p>
<p>据说题目来自EMC笔试</p>
<p><strong>解答：</strong></p>
<p>此题难点显然在后面那些要求上。只用一个语句完成的要求很容易让人联想到函数递归。因此</p>
<pre>int p(int x, int y){
    return printf("%d ", x)
        &amp;&amp; (x&lt;y &amp;&amp; p(x+1, y));
}</pre>
<p>可以完成从x打印到y的任务。</p>
<p>进一步的有</p>
<pre>int p(int x, int y){
    return printf("%d ", x)
        &amp;&amp; (x&lt;y &amp;&amp; p(x+1, y))
        || printf("%d ", x);
}
</pre>
<p>但是，值得注意的是题目要求只使用一个printf函数，因此，最后那个printf也必须改为递归语句，即</p>
<pre>int p(int x, int y){
    return printf("%d ", x)
        &amp;&amp; (x&lt;y &amp;&amp; p(x+1, y))
        || (x&lt;y &amp;&amp; p(x, x));
}
</pre>
<p>如果考虑x&gt;y的情况，修改条件判断&lt;为!=，修改p(x+1, y)为p(x+(y-x)/abs(y-x), y)即可</p>
<pre>int p(int x, int y){
    return printf("%d ", x)
        &amp;&amp; (x!=y &amp;&amp; p(x+(y-x)/abs(y-x), y))
        || (x!=y &amp;&amp; p(x, x));
}</pre>
<p><strong>点评：</strong>问题的关键在于递归、逻辑运算的短路原理。尤其是后者比前者更难想到。</p>
<p><a href="http://yegong.net/job-test-1/#comments">Leave a comment</a></p>
<p>Category : <a href="http://yegong.net/category/coding/" title="View all posts in Coding" rel="category tag">Coding</a>, <a href="http://yegong.net/category/thinking/" title="View all posts in Thinking" rel="category tag">Thinking</a> | Tags : <a href="http://yegong.net/tag/emc/" rel="tag">EMC</a>, <a href="http://yegong.net/tag/job-wanted/" rel="tag">求职</a>, <a href="http://yegong.net/tag/test-on-paper/" rel="tag">笔试</a>, <a href="http://yegong.net/tag/computer/" rel="tag">计算机</a></p>
<!-- Analytics by image -->
<img alt="analytics image" src="http://img.users.51.la/2657393.asp" style="border:none;height:1px;width:1px;" />]]></content:encoded>
			<wfw:commentRss>http://yegong.net/job-test-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->