<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>F monologue &#187; 홍콩</title>
	<atom:link href="http://blog.fguy.com/tag/%ed%99%8d%ec%bd%a9/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fguy.com</link>
	<description>Taehoon Kang</description>
	<lastBuildDate>Fri, 10 Feb 2012 00:53:34 +0000</lastBuildDate>
	<language>ko</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.fguy.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/302d17afa2133e49879c9121b033814d?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>F monologue &#187; 홍콩</title>
		<link>http://blog.fguy.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.fguy.com/osd.xml" title="F monologue" />
	<atom:link rel='hub' href='http://blog.fguy.com/?pushpress=hub'/>
		<item>
		<title>야후! 홍콩 입사 시험 문제</title>
		<link>http://blog.fguy.com/2008/06/03/%ec%95%bc%ed%9b%84-%ed%99%8d%ec%bd%a9-%ec%9e%85%ec%82%ac-%ec%8b%9c%ed%97%98-%eb%ac%b8%ec%a0%9c/</link>
		<comments>http://blog.fguy.com/2008/06/03/%ec%95%bc%ed%9b%84-%ed%99%8d%ec%bd%a9-%ec%9e%85%ec%82%ac-%ec%8b%9c%ed%97%98-%eb%ac%b8%ec%a0%9c/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 04:14:53 +0000</pubDate>
		<dc:creator>fguy</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[야후]]></category>
		<category><![CDATA[홍콩]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://fguy.krac.kr/2008/06/03/%ec%95%bc%ed%9b%84-%ed%99%8d%ec%bd%a9-%ec%9e%85%ec%82%ac-%ec%8b%9c%ed%97%98-%eb%ac%b8%ec%a0%9c/</guid>
		<description><![CDATA[내가 입사할때의 NHN의 시험문제와 거의 비슷한 수준의 난이도이다. (심지어 같은 문제도 있다. -_-) 아래 부터 문제와 나의 풀이이다. C and C++: Q1. What is wrong with the following code? char a[256]; unsigned char x; for (x=0; x&#60; sizeof(a); x++) a[x]=0; &#8230; <a href="http://blog.fguy.com/2008/06/03/%ec%95%bc%ed%9b%84-%ed%99%8d%ec%bd%a9-%ec%9e%85%ec%82%ac-%ec%8b%9c%ed%97%98-%eb%ac%b8%ec%a0%9c/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fguy.com&amp;blog=13748523&amp;post=27&amp;subd=fguyblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>내가 입사할때의 NHN의 시험문제와 거의 비슷한 수준의 난이도이다. (심지어 같은 문제도 있다. -_-)</p>
<p>아래 부터 문제와 나의 풀이이다.</p>
<p>C and C++:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. What is wrong with the following code?</p>
<p class="western" lang="en-GB">char a[256];</p>
<p class="western" lang="en-GB">unsigned char x;</p>
<p class="western" lang="en-GB">for (x=0; x&lt; sizeof(a); x++) a[x]=0;</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">The loop ends with x has 256. but, x is never become 256. because unsigned char&#8217;s max value is 255 (1 byte). The code will loop infinity.</font></p>
<p class="western" lang="en-GB">&nbsp;</p>
<p class="western" lang="en-GB">Q2. A structure has an integer, a pointer and a char, how big is it?</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">In 32-bit environment, It is bigger than 5bytes.<br />&#8220;char&#8221; member is 1bytes and &#8220;integer&#8221; memeber is 4byte, But we can&#8217;t know the size of a pointer. Because, it is determined by the type the pointer indicated.<br />So, the size of the struct will be determined by the pointer.</font></p>
<p></p>
<p class="western" lang="en-GB">Q3. Implement the following function. It prints a string after replacing all occurrence of a substring with a char ‘*’. Both strings should be left unchanged after the function returns. Runtime efficiency and error checking are considered important.</p>
<p class="western" lang="en-GB">&nbsp; &nbsp;&nbsp; </p>
<p class="western" lang="en-GB">void print_string_replace(char *string, char *substr)</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">void print_string_replace(char *string, char *substr) {<br />&nbsp;int stringLength = strlen(string);<br />&nbsp;int substrLength = strlen(substr);<br />&nbsp;int i;<br />&nbsp;char *result;<br />&nbsp;char *tmp;</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">&nbsp;if(substrLength &gt; stringLength) {<br />&nbsp; puts(&#8220;substr must be shorter than string&#8221;);<br />&nbsp;}<br />&nbsp;<br />&nbsp;// make a local copy of string<br />&nbsp;memcpy(result, string, stringLength);</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">&nbsp;// find an occurrence <br />&nbsp;tmp = strstr(result,substr);</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">&nbsp;if(!tmp) {<br />&nbsp; puts(&#8220;substr is not present in string&#8221;);<br />&nbsp;} else {<br />&nbsp; do {<br />&nbsp; &nbsp;// replace occurrence to &#8220;*&#8221;<br />&nbsp; &nbsp;for(i = 0; i &lt; substrLength; i++) {<br />&nbsp; &nbsp; tmp[i] = &#8216;*&#8217;;<br />&nbsp; &nbsp;}<br />&nbsp; } while (tmp = strstr(result, substr));<br />&nbsp; // print a result<br />&nbsp; puts(result);<br />&nbsp;}<br />}</font></p>
<p></p>
<p class="western" lang="en-GB">Q4. Explain operator overloading in C++.</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">In C++, basic operators are defined by compiler. When you define a different operation for an operator by changing the standard parameter list, it is operator overloading. It can improve understandability and reduce maintenance costs.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Web/CGI:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. I want to provide a personalised web page, which presents different </p>
<p class="western" lang="en-GB">data to different users &#8211; what URL/CGI techniques can I use to </p>
<p class="western" lang="en-GB">identify each user? What are the advantages and disadvantages of </p>
<p class="western" lang="en-GB">each technique?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">URL based : &nbsp;Provided by web server.When a user enters a protected site, the server asks the web browser for authentication. Then, the browser asks user&#8217;s name and password by a prompt, and it will be sent to web server. If given informations are valid, the user is authenticated, and then user can access server&#8217;s location. This cycle is needed by each time of user requests. </font></p>
<ul>
<li>
<div class="western" id="pcth79"><font color="#0000ff">advantages : simply implementation.</font></div>
<li>
<div class="western" id="pcth82"><font color="#0000ff">disadvantages : less security. overhead. bad UI.</font></div>
</li>
</ul>
<p class="western" lang="en-GB"><font color="#0000ff"><br />CGI based : Most of CGI applications are set the session value to web browser. So, the client sends the information of authentication to the server once.&nbsp; In addition, a CGI application can present different pages to different users, as long as they are authenticated. </font></p>
<ul>
<li>
<div class="western" id="pcth89"><font color="#0000ff">advantages :more flexibility. can make more complex UI. </font></div>
<li>
<div class="western" id="pcth92"><font color="#0000ff">disadvantages : more complex development.<br /></font></div>
</li>
</ul>
<p class="western" lang="en-GB">Q2. Assuming we had a continuous feed of data that was being piped into</p>
<p class="western" lang="en-GB">site, and it needed to distributed to up to 10 different machines in </p>
<p class="western" lang="en-GB">real time. Describe at least one method you would use?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">There 3 methods I have. These are:</font></p>
<p></p>
<ul>
<li>
<div class="western" id="pcth104"><font color="#0000ff">rsync : Run rsync as a daemon on each server. And, Deploy to each server by call the rsync command when the feed has been renewed.</font></div>
<li>
<div class="western" id="pcth107"><font color="#0000ff">NAS : If the NAS equipment is mount the directory has a feed to each servers using NFS, it will be automatically updated when feed has been renewed.</font></div>
<li>
<div class="western" id="pcth110"><font color="#0000ff">SAMBA&nbsp; :SAMBA is similar to NAS. It become a equipment like NAS to run SAMBA daemon on the feed server. Each servers can mount use CIFS type. It would has very lower cost than NAS.<br /></font></div>
</li>
</ul>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Perl:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. Write a perl program to insert a white space before and after the occurrence of numeric string. The program read from standard input and writes to standard output. For example, Input: ‘aaaa1111bb22cc333’, Output: ‘aaaa 1111 bb 22 cc 333 ‘</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">foreach $char(split(//,&lt;STDIN&gt;)) {<br />&nbsp; &nbsp; print $prev_char ne &#8220;&#8221; &amp;&amp; $prev_char ne $char ? &#8221; $char&#8221; : $char;<br />&nbsp; &nbsp; $prev_char = $char;<br />} <br /></font><br />Q2. What does ‘my’ do? Is it the same as ‘local’</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">&nbsp;They declare local variable. &#8220;my&#8221; creates private scope variable. &#8220;local&#8221; creates temporary copies of selected global variables.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q3. Suppose I want to pass two arguments to a subroutine, both of which are</p>
<p class="western" lang="en-GB">arrays. How do I do that without using global varialbe?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">Perl supports a reference variable. You can make a reference to append &#8220;\&#8221; at first of subroutine&#8217;s parameters when it is called. And, you can access it with &#8220;@&#8221; in subroutine.</font></p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">Like this :</font></p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">@arr1 = (&#8216;alpha&#8217;, &#8216;bravo&#8217;);<br />@arr2 = (&#8216;chalie&#8217;, &#8216;delta&#8217;);</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">mysub(\@arr1, \@arr2);</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">sub mysub {<br />&nbsp;my ($myarr1, $myarr2) = @_;<br />&nbsp;print(&#8220;my arr1 : @$myarr1 \n&#8221;);<br />&nbsp;print(&#8220;my arr2 : @$myarr2 \n&#8221;);<br />}</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">PHP:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. How do you serialize data in PHP?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">It can be just calling &#8220;serialize()&#8221; function. &#8220;serialize()&#8221; can serialize to string all data type without resource. In object type, &#8220;serialize()&#8221; call &#8220;__sleep()&#8221; before serialize it.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q2. What is the difference between a reference and a regular variable? How do you pass by reference &amp; why would you want to?</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">If a regular variable is passed to function, it creates temporary copy on their block. It keeps the value in outside of function.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">When a variable is passed by reference, the function it is being passed to can modify the variable.</font></p>
<p><font color="#0000ff">You can pass by reference to add &#8220;&amp;&#8221; on head of parameter in the function definition. </font></p>
<p><font color="#0000ff">like this,</font></p>
<p><font color="#0000ff">function foo(<b>&amp;</b>$param) {</font></p>
<p><font color="#0000ff">&#8230;</font></p>
<p><font color="#0000ff">}</font></p>
<p><font color="#0000ff"></p>
<p class="western" lang="en-GB"></p>
<p></font></p>
<p class="western" lang="en-GB">Q3. Assuming you have inserted a record in a MySQL table, which has an auto-increment column. How do you retrieve the generated value of that column?</p>
<p>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">PHP function : mysql_insert_id(), mysqli_insert_id(), PDO-&gt;lastInsertId()<br /></font></p>
<p class="western" lang="en-GB"><font color="#0000ff">SQL : select last_insert_id()</font></p>
<p class="western" lang="en-GB"><font color="#0000ff"><br /></font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">UNIX:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. Detail what Unix tools you are experienced with and why you like</p>
<p class="western" lang="en-GB">them?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">yum/apt : Package manager. I am tired out to compile sources.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">perl : Most of Unix machines have this. I prefer PHP.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">ruby : Exprience agile development. Just for fun.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">wget : Download via http/ftp. I use this for crawling.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Database:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. Explain what is left join, right join and inner join?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">Left/Right join returns all rows of first table and all matching rows from the next table. Not matched columns of next tables are set to NULL.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">Inner join returns all matching rows. It does a full join.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Windows Related:</p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q1. How will you create a window and have it show in the taskbar when the window is minimized ?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">Hmm, I can&#8217;t remember this exactly.</font>&nbsp;</p>
<p class="western" lang="en-GB"><font color="#0000ff">Set the property that show in the taskbar when window is minimized to some class and register it.</font></p>
<p class="western" lang="en-GB"><font color="#0000ff">And then, creates window&#8230;.</font></p>
<p class="western" lang="en-GB"></p>
<p class="western" lang="en-GB">Q2. What is the IUnknown interface and what functions does it provide? (C++)</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">I&#8217;ve been see it in visual basic before. But, I don&#8217;t remember it. Just know that it is a COM interface.</font></p>
<p></p>
<p class="western" lang="en-GB">Q3. You join a 3 person project which has been running for some time. </p>
<p class="western" lang="en-GB">During your first week you notice that a piece of the project&#8217;s VC++ </p>
<p class="western" lang="en-GB">code appears to be running slower than you would expect. </p>
<p class="western" lang="en-GB">How do you confirm your suspicion?</p>
<p></p>
<p class="western" lang="en-GB"><font color="#0000ff">I know that VC++ has profiling function. Simply, I can enable profiling option on the &#8220;Project Preference&#8221; menu (Probably.. I don&#8217;t have the Visual Studio) and show it to them. </font></p>
<p class="western" lang="en-GB"></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/fguyblog.wordpress.com/27/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/fguyblog.wordpress.com/27/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fguyblog.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fguyblog.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fguyblog.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.fguy.com&amp;blog=13748523&amp;post=27&amp;subd=fguyblog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.fguy.com/2008/06/03/%ec%95%bc%ed%9b%84-%ed%99%8d%ec%bd%a9-%ec%9e%85%ec%82%ac-%ec%8b%9c%ed%97%98-%eb%ac%b8%ec%a0%9c/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d10c905edc572a61b5206377c1a36c98?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">fguy79</media:title>
		</media:content>
	</item>
	</channel>
</rss>
