﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-依睛(IT blog) 我回来了，PHP&lt;--&gt;C/C++ LINUX-随笔分类-面试题目收集 </title><link>http://www.cnitblog.com/guopingleee/category/6039.html</link><description>笨鸟
</description><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 20:37:55 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 20:37:55 GMT</pubDate><ttl>60</ttl><item><title> C/C++ 程序设计员应聘常见面试试题深入剖析 </title><link>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32839.html</link><dc:creator>向左向右走</dc:creator><author>向左向右走</author><pubDate>Mon, 03 Sep 2007 03:07:00 GMT</pubDate><guid>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32839.html</guid><wfw:comment>http://www.cnitblog.com/guopingleee/comments/32839.html</wfw:comment><comments>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32839.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/guopingleee/comments/commentRss/32839.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/guopingleee/services/trackbacks/32839.html</trackback:ping><description><![CDATA[找错题<br /><br />　　试题1：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void test1()<br />{<br />　char string[10];<br />　char* str1 = "0123456789";<br />　strcpy( string, str1 );<br />}</td></tr></tbody></table><br />　　试题2：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void test2()<br />{<br />　char string[10], str1[10];<br />　int i;<br />　for(i=0; i&lt;10; i++)<br />　{<br />　　str1[i] = 'a';<br />　}<br />　strcpy( string, str1 );<br />}</td></tr></tbody></table><br />　　试题3：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void test3(char* str1)<br />{<br />　char string[10];<br />　if( strlen( str1 ) &lt;= 10 )<br />　{<br />　　strcpy( string, str1 );<br />　}<br />}</td></tr></tbody></table><p><br />　　解答：<br /></p><p> </p><div><font color="#993366">我对这几道题目的分析如下：</font></div><div style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt"><font color="#993366">1、<span style="FONT: 7pt 'Times New Roman'"><font size="3">  </font></span>字符串和字符数组char str1[]的异同点：</font></div><div style="MARGIN: 0cm 0cm 0pt 18pt"><font color="#993366">通过实例说明：string str=”0123456789”; char str1[]={0,1,2,3,4,5,6,7,8,9}</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt; TEXT-INDENT: -36pt"><font color="#993366">（1） 实际上字符串str也是由一个个的字符构成的，每一个字符都占据一个字节的空间，这一点和字符数组str1是一样的，但是字符串str后面会有一个追加的空字符’\0’来表示字符串的结尾，而字符数组是不用的。图示如下：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">str字符串</font></div><p></p><table style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN-LEFT: 84.65pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellspacing="0" cellpadding="0" border="1"><tbody><tr><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 22.3pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">0</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">1</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.3pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">2</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">3</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">4</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.3pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">5</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">6</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">7</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.3pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">8</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">9</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.35pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">\0</font></div></td></tr></tbody></table><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">str1字符数组</font></div><p></p><table style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN-LEFT: 86.4pt; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse" cellspacing="0" cellpadding="0" border="1"><tbody><tr><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">0</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">1</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">2</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">3</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">4</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">5</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">6</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">7</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">8</font></div></td><td style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BORDER-LEFT-COLOR: #ebe9ed; PADDING-BOTTOM: 0cm; WIDTH: 22.5pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" valign="top" width="30"><div><font color="#993366">9</font></div></td></tr></tbody></table><div><span>              <font color="#993366">              </font></span></div><div style="MARGIN: 0cm 0cm 0pt 78pt; TEXT-INDENT: -36pt"><font color="#993366">（2） 但是我们在使用strlen()函数，获取字符串或字符数组长度时，都是10，因为在计算字符串长度时，并没有将字符串的最后一个空字符’\0’计算在内，这一点可以参照下面的strlen()函数的具体实现。</font></div><div style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt"><font color="#993366">2、<span style="FONT: 7pt 'Times New Roman'"><font size="3">  </font></span>关于字符串拷贝函数strcpy()：</font></div><div style="MARGIN: 0cm 0cm 0pt 18pt"><font color="#993366">这个函数需要两个字符指针char*参数，第一个参数表示目的字符串，第二个参数表示源字符串。但是需要注意的就是第二个字符指针必须指向一个字符串，而不能是一个字符数组，因为strcpy()函数具体实现里面有一个for循环，而这个for循环的结束条件就是碰到字符串中的空字符’\0’，如果第二个字符指针指向字符数组的话，将会导致for循环得不到正常结束，从而导致拷贝错误。Strcpy()函数也可参照下面的具体实现代码。</font></div><div style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt"><font color="#993366">3、<span style="FONT: 7pt 'Times New Roman'"><font size="3">  </font></span>字符串指针char*或称做字符指针的初始化问题（关键要习惯这种初始化格式）：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt; TEXT-INDENT: -36pt"><font color="#993366">（1） </font><font color="#ff0000">将char*看作字符串指针，使用字符串初始化：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">string str=”12345”;</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">char* ch=str;//错误，不能将str型赋给char*，因为str是一个string类对象，类型不同不能赋值。</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">但是，下面的初始化就是正确的：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">char ch="12345";//"12345"根本就是一个字符串，也就是一个追加了空字符的字符数组而已，它的内存模型和string类对象根本就是两码事，这里初学者很容易搞混。</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt; TEXT-INDENT: -36pt"><font color="#993366">（2） 将char*看作字符串指针，使用字符数组初始化：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">char str[]={1,2,3,4,5};</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">char* ch=str;//实际就是将字符数组中的第一个字符地址赋给ch</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">上一语句相当于：char* ch=&amp;str[0];</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">实际上，上面的字符数组str可以直接使用字符串初始化，这也是可以的，即：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#ff0000">char str[]="12345";</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt; TEXT-INDENT: -36pt"><font color="#993366">（3） 将char*看作字符指针，使用某个字符的地址初始，但这种初始化方式的实际意义并不大：</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><font color="#993366">char str=’A’;</font></div><div style="MARGIN: 0cm 0cm 0pt 78pt"><span style="FONT-SIZE: 10.5pt"><font color="#993366">char* ch=&amp;str;</font></span></div><p><br />　　试题1字符串str1需要11个字节才能存放下（包括末尾的’\0’），而string只有10个字节的空间，strcpy会导致数组越界；<br /><br />　　对试题2，如果面试者指出字符数组str1不能在数组内结束可以给3分；如果面试者指出strcpy(string, str1)调用使得从str1内存起复制到string内存起所复制的字节数具有不确定性可以给7分，在此基础上指出库函数strcpy工作方式的给10分；<br /><br />　　对试题3，if(strlen(str1) &lt;= 10)应改为if(strlen(str1) &lt; 10)，因为strlen的结果未统计’\0’所占用的1个字节。<br /><br />　　剖析：<br /><br />　　考查对基本功的掌握：<br /><br />　　(1)字符串以’\0’结尾；<br /><br />　　(2)对数组越界把握的敏感度；<br /><br />　　(3)库函数strcpy的工作方式，如果编写一个标准strcpy函数的总分值为10，下面给出几个不同得分的答案：<br /><br />　　2分<br /><br /></p><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void strcpy( char *strDest, char *strSrc )<br />{<br />　 while( (*strDest++ = * strSrc++) != ‘\0’ );<br />}</td></tr></tbody></table><br />　　4分<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void strcpy( char *strDest, const char *strSrc ) <br />//将源字符串加const，表明其为输入参数，加2分<br />{<br />　 while( (*strDest++ = * strSrc++) != ‘\0’ );<br />}</td></tr></tbody></table><br />　　7分<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void strcpy(char *strDest, const char *strSrc) <br />{<br />　//对源地址和目的地址加非0断言，加3分<br />　assert( (strDest != NULL) &amp;&amp; (strSrc != NULL) );<br />　while( (*strDest++ = * strSrc++) != ‘\0’ );<br />}</td></tr></tbody></table><br />　　10分<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td><font color="#993366">//为了实现链式操作，将目的地址返回，加3分！<br /><br />char * strcpy( char *strDest, const char *strSrc ) <br />{<br />　assert( (strDest != NULL) &amp;&amp; (strSrc != NULL) );<br />　<font color="#ff0000">char *address = strDest; //必须将目的字符串的目的地址保存，以防下面的while之后，无法返回目的字符串的地址，即第一个字符的地址</font><br />　while( (*strDest++ = * strSrc++) != <font color="#ff0000">‘\0’</font> ); <br />　　return address;<br />}</font></td></tr></tbody></table><br />　　从2分到10分的几个答案我们可以清楚的看到，小小的strcpy竟然暗藏着这么多玄机，真不是盖的！需要多么扎实的基本功才能写一个完美的strcpy啊！<br /><br />　　(4)对strlen的掌握，它没有包括字符串末尾的'\0'。<br /><br />　　读者看了不同分值的strcpy版本，应该也可以写出一个10分的strlen函数了，完美的版本为： int strlen( const char *str ) //输入参数const<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td><font color="#993366">{<br />　assert( strt != NULL ); //断言字符串地址非0<br />　int len;<br />　while( (*str++) != '\0' ) <br />　{ <br />　　len++; <br />　} <br />　return len;<br />}</font></td></tr></tbody></table><br />　　试题4：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void GetMemory( char *p )<br />{<br />　p = (char *) malloc( 100 );<br />}<br /><br />void Test( void ) <br />{<br />　char *str = NULL;<br />　GetMemory( str ); <br />　strcpy( str, "hello world" );<br />　printf( str );<br />}</td></tr></tbody></table><br />　　试题5：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>char *GetMemory( void )<br />{ <br />　char p[] = "hello world"; <br />　return p; <br />}<br /><br />void Test( void )<br />{ <br />　char *str = NULL; <br />　str = GetMemory(); <br />　printf( str ); <br />}</td></tr></tbody></table><br />　　试题6：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void GetMemory( char **p, int num )<br />{<br />　*p = (char *) malloc( num );<br />}<br /><br />void Test( void )<br />{<br />　char *str = NULL;<br />　GetMemory( &amp;str, 100 );<br />　strcpy( str, "hello" ); <br />　printf( str ); <br />}</td></tr></tbody></table><br />　　试题7：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>void Test( void )<br />{<br />　char *str = (char *) malloc( 100 );<br />　strcpy( str, "hello" );<br />　free( str ); <br />　... //省略的其它语句<br />}</td></tr></tbody></table><br />　　解答：<br /><br />　　试题4传入中GetMemory( char *p )函数的形参为字符串指针，在函数内部修改形参并不能真正的改变传入形参的值，执行完<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>char *str = NULL;<br />GetMemory( str ); </td></tr></tbody></table><p><br />　　后的str仍然为NULL；</p><p>        <font color="#ff0000">实际上，上面的参数传递是数值传递，不是地址传递，如果传入的指针地址是有效的，那么修改形参的指针值是不影响实参的，但如果修改形参指针指向的具体数据的话，那么实参指针指向的数据也就会改变的，因为形参和实参是地址相同的两个指针，他们指向同一个内存单元。</font><br /><br />　　试题5中<br /><br /></p><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>char p[] = "hello world"; <br />return p; </td></tr></tbody></table><p><br />　　的p[]数组为函数内的局部自动变量，在函数返回后，内存已经被释放。这是许多程序员常犯的错误，其根源在于不理解变量的生存期。<font color="#ff0000">实际上，字符数组p存放在栈中的地址返回了，但是退出函数后，指针p指向的栈空间被释放，也就是说p指向的内存空间已经在退出函数时变成无效内存了。<br /></font><br />　　试题6: <font color="#ff0000">该题稍微麻烦的地方是使用的指向指针型数据的指针：char **p这里我们就务必要清楚指针p的具体指向模型，否则无法做该题。</font></p><p> <img alt="" src="http://p.blog.csdn.net/images/p_blog_csdn_net/btooth/未命名.JPG" /></p><p>GetMemory避免了试题4的问题，传入GetMemory的参数为字符串指针的指针，但是在GetMemory中执行申请内存及赋值语句<br /><br /></p><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>*p = (char *) malloc( num );</td></tr></tbody></table><br />　　后未判断内存是否申请成功，应加上：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>if ( *p == NULL )<br />{<br />　...//进行申请内存失败处理<br />}</td></tr></tbody></table><p><br />　　试题7存在与试题6同样的问题，在执行<br /><br /></p><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>char *str = (char *) malloc(100);</td></tr></tbody></table><br />　　后未进行内存是否申请成功的判断；另外，在free(str)后未置str为空，导致可能变成一个“野”指针，应加上：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>str = NULL;</td></tr></tbody></table><br />　　试题6的Test函数中也未对malloc的内存进行释放。<br /><br />　　剖析：<br /><br />　　试题4～7考查面试者对内存操作的理解程度，基本功扎实的面试者一般都能正确的回答其中50~60的错误。但是要完全解答正确，却也绝非易事。<br /><br />　　对内存操作的考查主要集中在：<br /><br />　　（1）指针的理解；<br /><br />　　（2）变量的生存期及作用范围；<br /><br />　　（3）良好的动态内存申请和释放习惯。<br /><br />　　再看看下面的一段程序有什么错误：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>swap( int* p1,int* p2 )<br />{<br />　int *p;<br />　*p = *p1;<br />　*p1 = *p2;<br />　*p2 = *p;<br />}</td></tr></tbody></table><br />　　在swap函数中，p是一个“野”指针，有可能指向系统区，导致程序运行的崩溃。在VC++中DEBUG运行时提示错误“Access Violation”。该程序应该改为：<br /><br /><table bordercolor="#cccccc" width="90%" align="center" bgcolor="#e3e3e3" border="1"><tbody><tr><td>swap( int* p1,int* p2 )<br />{<br />　int p;<br />　p = *p1;<br />　*p1 = *p2;<br />　*p2 = p;<br />}</td></tr></tbody></table><p> </p><p><font color="#ff0000">补充：关于字符、字符串、字符数组的打印输出问题：</font></p><p>char ch1='a';</p><p>char* ch2="12345";</p><p>char  ch3[]="67890";</p><p>cout&lt;&lt;ch1&lt;&lt;endl;//输出a</p><p>cout&lt;&lt;ch2&lt;&lt;endl;//输出12345</p><p>cout&lt;&lt;ch3&lt;&lt;endl;//输出67890</p><p>cout&lt;&lt;*ch2&lt;&lt;endl;//输出1</p><p>cout&lt;&lt;*ch3&lt;&lt;endl;//输出6</p><p>cout&lt;&lt;&amp;ch1&lt;&lt;endl;//输出a，然后是乱码</p><p>需要注意的就是当cout指针时，也是碰到字符串的终止符'\0'后就停止输出，而字节数组也有长度可以判断，所以输出信息正常。当输出具体指针指向的字符时，就仅仅输出一个字符而已了。但是当输出&amp;ch1时，由于得不到终止符号就不停输出，所以才会出现乱码。</p><br /><br /><p id="TBPingURL">Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1246925</p><img src ="http://www.cnitblog.com/guopingleee/aggbug/32839.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/guopingleee/" target="_blank">向左向右走</a> 2007-09-03 11:07 <a href="http://www.cnitblog.com/guopingleee/archive/2007/09/03/32839.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title> 一些公司的笔试题 </title><link>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32835.html</link><dc:creator>向左向右走</dc:creator><author>向左向右走</author><pubDate>Mon, 03 Sep 2007 01:47:00 GMT</pubDate><guid>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32835.html</guid><wfw:comment>http://www.cnitblog.com/guopingleee/comments/32835.html</wfw:comment><comments>http://www.cnitblog.com/guopingleee/archive/2007/09/03/32835.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/guopingleee/comments/commentRss/32835.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/guopingleee/services/trackbacks/32835.html</trackback:ping><description><![CDATA[
		<p>转载自瀚海星云</p>
		<p>Sony笔试题 <br />　　1．完成下列程序 <br />　　* <br />　　*.*. <br />　　*..*..*.. <br />　　*...*...*...*... <br />　　*....*....*....*....*.... <br />　　*.....*.....*.....*.....*.....*..... <br />　　*......*......*......*......*......*......*...... <br />　　*.......*.......*.......*.......*.......*.......*.......*....... <br />　　#include &lt;stdio.h&gt; <br />　　#define N 8 <br />　　int main() <br />　　{ <br />　　 int i; <br />　　 int j; <br />　　 int k; <br />　　 --------------------------------------------------------- <br />　　 | | <br />　　 | | <br />　　 | | <br />　　 --------------------------------------------------------- <br />　　 return 0; <br />　　} <br />　　2．完成程序，实现对数组的降序排序 <br />　　#include &lt;stdio.h&gt; <br />　　void sort( ); <br />　　int main() <br />　　{ <br />　　 int array[]={45，56，76，234，1，34，23，2，3}； //数字任//意给出 <br />　　 sort( ); <br />　　 return 0; <br />　　} <br />　　void sort( ) <br />　　{ <br />　　 ____________________________________ <br />　　 | | <br />　　 | | <br />　　 |-----------------------------------------------------| <br />　　} <br />　　3．费波那其数列，1，1，2，3，5……编写程序求第十项。可以用递归，也可以用<br />其 <br />他方法，但要说明你选择的理由。 <br />　　#include &lt;stdio.h&gt; <br />　　int Pheponatch(int); <br />　　int main() <br />　　{ <br />　　 printf("The 10th is %d",Pheponatch(10)); <br />　　 return 0; <br />　　} <br />　　int Pheponatch(int N) <br />　　{ <br />　　-------------------------------- <br />　　| | <br />　　| | <br />　　-------------------------------- <br />　　} <br />　　4．下列程序运行时会崩溃，请找出错误并改正，并且说明原因。 <br />　　#include &lt;stdio.h&gt; <br />　　#include &lt;malloc.h&gt; <br />　　typedef struct{ <br />　　 TNode* left; <br />　　 TNode* right; <br />　　 int value; <br />　　} TNode; <br />　　TNode* root=NULL; <br />　　void append(int N); <br />　　int main() <br />　　{ <br />　　 append(63); <br />　　 append(45); <br />　　 append(32); <br />　　 append(77); <br />　　 append(96); <br />　　 append(21); <br />　　 append(17); // Again, 数字任意给出 <br />　　} <br />　　void append(int N) <br />　　{ <br />　　 TNode* NewNode=(TNode *)malloc(sizeof(TNode)); <br />　　 NewNode-&gt;value=N; <br /><br /><br />　　 if(root==NULL) <br />　　 { <br />　　 root=NewNode; <br />　　 return; <br />　　 } <br />　　 else <br />　　 { <br />　　 TNode* temp; <br />　　 temp=root; <br /><br />　　 while((N&gt;=temp.value &amp;&amp; temp.left!=NULL) || (N&lt;temp. value &amp;&amp; temp. <br />right <br />!=NULL <br />　　)) <br />　　 { <br />　　 while(N&gt;=temp.value &amp;&amp; temp.left!=NULL) <br />　　 temp=temp.left; <br />　　 while(N&lt;temp.value &amp;&amp; temp.right!=NULL) <br />　　 temp=temp.right; <br />　　 } <br />　　 if(N&gt;=temp.value) <br />　　 temp.left=NewNode; <br />　　 else <br />　　 temp.right=NewNode; <br />　　 return; <br />　　 } <br />　　} <br /><br /><br /><br />华为笔试题 <br />　　1．请你分别画出OSI的七层网络结构图和TCP/IP的五层结构图。 <br />　　2．请你详细地解释一下IP协议的定义，在哪个层上面？主要有什么作用？TCP与UDP呢 ？ <br />　　3．请问交换机和路由器各自的实现原理是什么？分别在哪个层次上面实现的？ <br />　　4．请问C++的类和C里面的struct有什么区别？ <br />　　5．请讲一讲析构函数和虚函数的用法和作用。 <br />　　6．全局变量和局部变量有什么区别？是怎么实现的？操作系统和编译器是怎么知道的 ？ <br />　　7．8086是多少位的系统？在数据总线上是怎么实现的？ <br /><br /><br /><br />联想笔试题 <br />　　1．设计函数 int atoi(char *s)。 <br />　　2．int i=(j=4,k=8,l=16,m=32); printf(“%d”, i); 输出是多少？ <br />　　3．解释局部变量、全局变量和静态变量的含义。 <br />　　4．解释堆和栈的区别。 <br />　　5．论述含参数的宏与函数的优缺点。 <br /><br /><br /><br />普天C++笔试题 <br />　　1．实现双向链表删除一个节点P，在节点P后插入一个节点，写出这两个函数。 <br />　　2．写一个函数，将其中的\t都转换成4个空格。 <br />　　3．Windows程序的入口是哪里？写出Windows消息机制的流程。 <br />　　4．如何定义和实现一个类的成员函数为回调函数？ <br />　　5．C++里面是不是所有的动作都是main()引起的？如果不是，请举例。 <br />　　6．C++里面如何声明const void f(void)函数为C程序中的库函数？ <br />　　7．下列哪两个是等同的 <br />　　int b; <br />　　A const int* a = &amp;b; <br />　　B const* int a = &amp;b; <br />　　C const int* const a = &amp;b; <br />　　D int const* const a = &amp;b; <br />　　8．内联函数在编译时是否做参数类型检查？ <br />　　void g(base &amp; b){ <br />　　 b.play; <br />　　} <br />　　void main(){ <br />　　 son s; <br />　　 g(s); <br />　　 return; <br />　　} <br /><br />大唐电信 <br />　　DTT笔试题 <br />　　考试时间一小时，第一部分是填空和选择： <br />　　1．数列6，10，18，32，“？”，问“？”是几？ <br />　　2．某人出70买进一个x，80卖出，90买回，100卖出，这桩买卖怎么样？ <br />　　3．月球绕地球一圈，至少要多少时间？ <br />　　4．7个人用7小时挖了7米的沟，以同样的速度在50小时挖50米的沟要多少人？ <br />　　5．鱼头长9，鱼尾等于鱼头加半个鱼身，鱼身等于鱼头加鱼尾，问鱼全长多少？ <br />　　6．一个小姐买了一块手表，回家发现手表比她家的表慢了两分钟，晚上看新闻的时候 <br />又发现她家的表比新闻里的时间慢了两分钟，则 。 <br />　　A 手表和新闻里的时间一样 <br />　　B 手表比新闻里的时间慢 <br />　　C 手表比新闻里的时间快 <br />　　7．王先生看到一则招聘启事，发现两个公司除了以下条件不同外，其他条件都相同 <br /><br />　　A 半年年薪50万，每半年涨5万 <br />　　B 一年年薪100万，每一年涨20万 <br />　　王先生想去一家待遇比较优厚的公司，他会去哪家？ <br />　　10．问哪个袋子里有金子？ <br />　　A袋子上的标签是这样写的：B袋子上的话是对的，金子在A袋子。 <br />　　B袋子上的标签是这样写的：A袋子上的话是错的，金子在A袋子里。 <br />　　11．3个人住酒店30块钱，经理找回5块钱，服务生从中藏了2块钱，找给每人1块钱， <br />3×（10&amp;#61485;1）+2=29，问这是怎么回事？ <br />　　12．三篇写作，均为书信形式。 <br />　　（1）一片中文的祝贺信，祝贺某男当了某公司xx <br />　　（2）两篇英文的，一是说有事不能应邀，派别人去；另一篇是讨债的，7天不给钱就 <br />走人（主要考business letter格式）。 <br />　　大唐面试试题 <br />　　1．什么是中断？中断发生时CPU做什么工作？ <br />　　2．CPU在上电后，进入操作系统的main()之前必须做什么工作？ <br />　　3．简述ISO OSI的物理层Layer1，链路层Layer2，网络层Layer3的任务。 <br />　　4．有线电话和无线电话有何区别？无线电话特别需要注意的是什么？ <br />　　5．软件开发五个主要step是什么？ <br />　　6．你在开发软件的时候，这5个step分别占用的时间百分比是多少？ <br />　　7．makefile文件的作用是什么？ <br />　　8．UNIX显示文件夹中，文件名的命令是什么？能使文件内容显示在屏幕的命令是什么 ？ <br />　　9．（选做）手机用户在从一个基站漫游到另一个基站的过程中，都会发生什么? <br /><br /><br />网通笔试题 <br />　　选择题（每题5分，只有一个正确答案） <br />　　1．中国1号信令协议属于 的协议。 <br />　　A ccs B cas C ip D atm <br />　　2．isdnpri协议全称是 。 <br />　　A 综合业务模拟网基速协议 <br />　　B 综合业务模拟网模拟协议 <br />　　C 综合业务数字网基率协议 <br />　　D 综合业务数字网基次协议 <br />　　3．路由协议中， 协议是用距离作为向量的。 <br />　　A ospf B bgp C is-is D rip <br />　　4．中国智能网中，ssp与scp间最上层的ss7协议是 。 <br />　　A incs B is41b C is41c D inap <br />　　5．dtmf全称是 。 <br />　　A 双音多频 B多音双频 C多音三频 D三音多频 <br />　　6．计算机的基本组成部分中，不包含下面设备的是 。 <br />　　A cpu B输入设备 C存储器 D接口 <br />　　7．脉冲编码调制的简称是 。 <br />　　A pcm B pam C (delta)M D atm <br />　　8．普通电话线接口专业称呼是 。 <br />　　A rj11 B rj45 C rs232 D bnc <br />　　9．现有的公共数据网都采用 。 <br />　　A电路交换技术 B报文交换技术 <br />　　C语音插空 D分组交换 <br />　　10．ss7协议中的制止市忙消息简写为 。 <br />　　A stb B slb C sub D spb <br />　　简答题（每题10分） <br />　　1．简述普通电话与IP电话的区别。 <br />　　2．简述随路信令与公路信令的根本区别。 <br />　　3．说明掩码的主要作用。 <br />　　4．ss7协议中，有三大要素决定其具体定位，哪三大要素？ <br />　　5．描述ss7的基本通话过程。 <br />　　6．简述通信网的组成结构。 <br />　　7．面向连接与面向非连接各有何利弊？ <br />　　8．写出爱尔兰的基本计算公式。 <br />　　9．数据网主要有哪些设备？ <br />　　10．中国一号协议是如何在被叫号码中插入主叫号码的？ <br /><br /><br />东信笔试题目 <br />　　笔试：30分钟。 <br />　　1．压控振荡器的英文缩写。 <br />　　2．动态随机存储器的英文缩写。 <br />　　3．选择电阻时要考虑什么？ <br />　　4．单片机上电后没有运转，首先要检查什么？ <br />　　5．计算机的基本组成部分及其各自的作用。 <br />　　6．怎样用D触发器、与或非门组成二分频电路？ <br /><br /><br /><br />中软融鑫笔试题 <br />　　1．关于工作 <br />　　（1） 你对未来的工作生活是怎样憧憬的？为何选择我公司作为求职公司？ <br />　　（2）请用不超过30个字给出一个最能让我们录用你的理由。 <br />　　（3）你认为比较理想的工作环境是怎样的？ <br />　　（4）你个人的中长期的职业发展目标是怎样的？ <br />　　2．关于社会 <br />　　（1）如果你是杨利伟，你在太空中向祖国人民说的第一句话是什么？ <br />　　（2）宋美龄女士于2003年10月谢世，对这位著名人士在西安事变中的态度和作用，你 <br />是如何看待的？（不超过300字） <br />　　（3）北京政府颁布的对拾金不昧者，失主要奖励相当于财产20%奖金的公告，你是如 <br />何看的？ <br />　　（4）如果给你50万元人民币，你将会用这些钱做什么？ <br />　　（5）在美国，男、女卫生间（厕所）的正确称呼为什么？请用英语写出答案。 <br />　　（6）你认为麦当劳是世界最大的汉堡生产商吗？如果不是，请说出你的观点。 <br />　　3．教育背景 <br />　　（1）你受过哪些正规的教育或培训？（自高中毕业起） <br />　　（2）在校期间进行过哪些社会活动？ <br /><br /><br />Delphi笔试题目 <br />　　机械类笔试试题 <br />　　1. Briefly describe what is blanking(cutting), forming, coining and <br />emboss <br />ing in stamping process. <br />　　2. What is metal clading? <br />　　3. What is the purpose of adding glass fiber to thermoplastic material? <br />　　4. In contrast with metal and thermoplastic material,which has a higher <br />co <br />efficient of thermal expansion(CTE). <br />　　5. The most suitable material for a integral hinge design (typical <br />plastic <br />thickness=0.25 to 0.5mm at hinge) <br />　　6. Can a bending load makes both compressive and tensile stress in a <br />membe <br />r? <br />　　7. What is the design criteria used in plastics catch/snap? <br />　　8. What is FEA? <br />　　9. Why is natural frequency important in vibration analysis? <br />　　10. What is the deflection equation of a cantilever beam fixed at one <br />edge <br />? <br />　　EE笔试试题 <br />　　1. Name 3 Vehicle Buses. <br />　　2. Name 2 possible sources of Electromagnetic interference on <br />Electronics <br />Circuit ASM. <br />　　3. Wavelength for 12MHz frequency signal is____ <br />　　4. Name 2 important considerations for car radio performan -ce related <br />to <br />audio signal processing under multipath condition? <br />　　5. What is the typical FM receiver RF signal strength to achieve 30dB <br />S/N <br />for car radio? <br />　　6. When a radio is tuned to 98.1 MHz &amp; with a LO of 108.8 MHz, what is <br />the <br />image frequency? <br />　　7. For a system with a matched impedance, what is the Reflection <br />Coefficie <br />nt and SWR? <br />　　8. Which property of the output capacitor is the primary cause of Low <br />Drop <br />Out(LDO) regulator loop instability? <br />　　（1）Equivalent series resistance(ESR) <br />　　（2）Effective series inductance(ESL) <br />　　（3）Capacitance value <br />　　（4）Dielectric material <br />　　9. The switching regulator is capable of: <br />　　（1）Higher power conversion efficiency <br />　　（2）Providing an output voltage that is higher than the input <br />　　（3）Generating an output boltage oppsite in polarity to the input <br />　　（4）All of the above <br />　　10. A linear regulator op Vin(max) = 10v, Vout(min) = 4.8v, Iout(max) = <br />2. <br />5mA, Iq(max) = 2.5mA, Ta(max) = 8.5摄氏度，The regulator is available in 3 <br />pac <br />kages.Each package has the following thermal characteristics: <br />　　Package Rja（摄氏度/W） Rjc（摄氏度/W） <br />　　SO14 125 30 <br />　　D1P8 100 52 <br />　　Choose the most suitable package to handle the power dissipation <br />requireme <br />nt without a heat sink and why. <br />　　软件笔试题 <br />　　1. How do you code an infinite loop in C? <br />　　2. Volatile: <br />　　（1）What does the keyword volatile mean? Give an example <br />　　（2）Can a parameter be both const and volatile? Give an example <br />　　（3）Can a pointer be volatile? Give an example <br />　　3. What are the values of a, b, and c after the following instructions: <br />　　int a=5, b=7, c; <br />　　c = a+++b; <br />　　4. What do the following declarations mean? <br />　　（1）const int a; <br />　　（2）int const a; <br />　　（3）const int *a; <br />　　（4）int * const a; <br />　　（5）int const * a const; <br />　　5. Which of the following statements describe the use of the keyword <br />stati <br />c? <br />　　（1）Within the body of a function: A static variable maintains its <br />value <br />between function revocations <br />　　（2）Within a module: A static variable is accessible by all functions <br />wit <br />hin that module <br />　　（3）Within a module: A static function can only be called by other <br />functi <br />ons within that module <br />　　6. Embedded systems always require the user to manipulate bits in <br />register <br />s or variables. Given an integer variable a, write two code fragments. <br />　　The first should set bit 5 of a. The second shnuld clear bit 5 of a. In <br />bo <br />th cases, the remaining bits should be unmodified. <br />　　7. What does the following function return? <br />　　char foo(void) <br />　　{ <br />　　 unsigned int a = 6; <br />　　 iht b = -20; <br />　　 char c; <br />　　 (a+b &gt; 6) ? (c=1): (c=0); <br />　　 return c; <br />　　} <br />　　8. What will be the output of the following C code? <br />　　main() <br />　　{ <br />　　 int k, num= 30; <br />　　 k =(num &gt; 5 ? (num &lt;=10 ? 100:200): 500); <br />　　 printf(“%d”, k); <br />　　} <br />　　9. What will the following C code do? <br />　　int *ptr; <br />　　ptr =(int *)Ox67a9; <br />　　*ptr = Oxaa55; <br />　　10. What will be the output of the follow C code? <br />　　#define product(x) (x*x) <br />　　main() <br />　　{ <br />　　 int i = 3, j, k; <br />　　 j = product(i++); <br />　　 k = product(++i); <br />　　 printf(“%d %d”,j,k); <br />　　} <br />　　11. Simplify the following Boolean expression <br />　　!((i ==12) || (j &gt; 15)) <br />　　12. How many flip-flop circuits are needed to divide by 16? <br />　　13. Provides 3 properties that make an OS, a RTOS? <br />　　14. What is pre-emption? <br />　　15. Assume the BC register value is 8538H, and the DE register value is <br />62 <br />A5H.Find the value of register BC after the following assembly operations: <br />　　MOV A,C <br />　　SUB E <br />　　MOV C,A <br />　　MOV A,B <br />　　SBB D <br />　　MOV B,A <br />　　16. In the Assembly code shown below <br />　　LOOP: MVI C,78H <br />　　 DCR C <br />　　 JNZ LOOP <br />　　 HLT <br />　　How many times is the DCR C Operation executed? <br />　　17. Describe the most efficient way (in term of execution time and code <br />si <br />ze) to divide a number by 4 in assembly language <br />　　18. what value is stored in m in the following assembly language code <br />frag <br />ment if n=7? <br />　　 LDAA #n <br />　　LABEL1: CMPA #5 <br />　　 BHI L3 <br />　　 BEQ L2 <br />　　 DECA <br />　　 BRA L1 <br />　　LABEL2: CLRA <br />　　LABEL3: STAA #m <br />　　19. What is the state of a process if a resource is not available? <br />　　#define a 365*24*60*60 <br />　　20. Using the #define statement, how would you declare a manifest <br />constant <br />that returns the number of seconds in a year? Disregard leap years in your <br />an <br />swer. <br />　　21. Interrupts are an important part of embedded systems. Consequently, <br />ma <br />ny compiler vendors offer an extension to standard C to support interrupts. <br />Ty <br />pically, the keyword is __interrupt. The following routine (ISR). Point out <br />pr <br />oblems in the code. <br />　　__interrupt double compute_area (double radius) <br />　　{ <br />　　 double area = PI * radius * radius; <br />　　 printf(“\nArea = %f”, area); <br />　　 return area; <br />　　} <br /><br /><br /><br />Hongkong Bank笔试题 <br />　　1. Please state why you chose to follow these activities and how they <br />have <br />contributed to your personal development. You may wish to give details of <br />you <br />r role whether anyone else was involved and any difficulties you <br />encountered. <br /><br />　　2. Please state how you have benefited from your work experience. <br />　　3. How much is your present monthly salary including allowances. <br />　　4. Do you need to compensate your present employer if you resign? If so, <br />p <br />lease give details. <br />　　5. Other than academic success, what has been your greatest achievement <br />to <br />date? What do you see as your personal strength, why? <br />　　6. Please state why the position you have applied for is appropriate for <br />y <br />ou; Why you have selected HongKong Bank and what your career objectives are. <br /><br /><br />A.T. Keaney笔试题 <br />　　1. Describe your greatest achievement in the past 4-5 years? <br />　　2. What are your short-term and long-term career objectives? What do you <br />t <br />hink is the most ideal job for you? <br />　　3. Why do you want to join A.T kearney? What do you think you can <br />contribu <br />te to A.T kearney? <br />　　4. Why are you applying for a position at Arthur Anderson? <br />　　5. What are your expectations of our firm. <br />　　6. Describe your hobbies and interests. <br /><br /><br /><br />Shell company笔试题 <br />　　1. How wold your colleagues/classmates describe you in five words? On <br />what <br />evidence would they base this assessment. <br />　　2. If you are asked to recruit the best graduates for shell, what would <br />yo <br />u do to attract them? What would you do to select them? <br />　　3. Please describe a new activity that you have initiated and <br />implemented. <br />Please highlight your role out. <br />　　4. Please describe your outstanding non-academic achieve- ments. <br />　　5. Please describe any other significant activities you have been <br />involved <br />in including organizing people. <br />　　6. Imagine that Shell has found oil in an inland province of China, near <br />a <br />large river. You are responsible for planning how to transport the oil to <br />the <br />coast thousands of miles away. What are the main issue you would consider, <br />an <br />d what would you do? <br /><br /><br /><br /><br />KPMG笔试题 <br />　　“The big economic difference between nuclear and fossil-fuelled power <br />sta <br />tions is that nuclear reactors are more expensive to build and decommission, <br />b <br />ut cheaper to sun. So disputes over the relative efficiency of the two <br />systems <br />revolve not just around prices of coal and uranium today and tomorrow, but <br />al <br />so around the way in which future income should be compared with current <br />incom <br />e.” <br />　　1. The main difference between nuclear and fossil-fuelled power stations <br />i <br />s an economic one. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　2. The price of coal is not relevant to discussions about the relative <br />eff <br />iciency of nuclear reactors. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　3. If nuclear reactors were cheaper to build and decommission than <br />fossil- <br />fuelled power stations, they would definitely have the economic advantage. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　“At any given moment we are being bombarded by physical and <br />psychological <br />stimuli competing for our attention. Although our eyes are capable of <br />handlin <br />g more than 5 million bits of data per second, our brain are capable of <br />interp <br />reting only about 500 bits per second. With similar disparities between each <br />o <br />f the other senses and the brain, it is easy to see that we must select the <br />vi <br />sual, auditory, or tactile stimuli that we wish to compute at any specific <br />tim <br />e.” <br />　　4. Physical stimuli usually win in the competition for our attention. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　5. The capacity of the human brain is sufficient to interpret nearly all <br />t <br />he stimuli the senses can register under optimum conditions. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　6. Eyes are able to cope with a greater input of information than ears. <br />　　TRUE <br />　　UNTRUE <br />　　CANNOT SAY <br />　　VERBAL ANSWER： <br />　　（1）C CANNOT SAY <br />　　（2）B UNTRUE <br />　　（3）A TRUE <br />　　（4）C CANNOT SAY <br />　　（5）B UNTRUE <br />　　（6）C CANNOT SAY <br />　　PartII NUMERCAL TEST <br />　　1．Which country had the highest number of people aged 60 or over at the <br />s <br />tart of 1985? <br />　　A. UK <br />　　B. France <br />　　C. Italy <br />　　D. W.Germany <br />　　E. Spain <br />　　2．What percentage of the total 15mm button production was classed as <br />sub- <br />standard in September? <br />　　AA 10.5% BB 13% CC 15% DD 17.5% EE 20% AB 23.5% AC 25% <br />　　AD 27.5% AE 28% BC 30.5% <br />　　3. How many live births occurred in 1985 in Spain and Italy together (to <br />t <br />he nearest 1000)? <br />　　A. 104 000 <br />　　B. 840 000 <br />　　C. 1 044 000 <br />　　D. 8 400 000 <br />　　E. 10 440 000 <br />　　4. What was the net effect on the UK population of the live birth and <br />deat <br />h rates in 1985? <br />　　A. Decrease of 66 700 <br />　　B. Increase of 752 780 <br />　　C. Increase of 84 900 <br />　　D. Cannot Say <br />　　E. Increase of 85 270 <br />　　5. By how much did the total sales value of November‘s button <br />production <br />vary from October‘s? <br />　　A. 8.50 (Decrease) <br />　　B. 42.50 (Decrease) <br />　　C. 85.00 (Increase) <br />　　D. 27.50 (Decrease) <br />　　E. No change <br />　　6. What was the loss in potential sales revenue attributable to the <br />produc <br />tion of sub-standard (as opposed to standard) buttons over the 6 month <br />period? <br /><br />　　A. 13.75 <br />　　B. 27.50 <br />　　C. 137.50 <br />　　D. 280.00 <br />　　E. 275.00 <br /><br />香港电信笔试题 <br />　　1. Based on your understanding of the following java related <br />technologies: <br />servlets, JavaServerPage, JavaBeans, Enterprise JavaBeans, how do you think <br />t <br />hese technologies are work together or are applied in the development of an <br />in <br />ternet-based application (25marks). <br />　　2. In your opinion ,what do you think are the advantages or benefitsof <br />usi <br />ng an object-oriented approach to software development? how do you think <br />those <br />benefits can be achieved or realized? (15marks). <br />　　3. In designing your classes, given the choice between inheritance and <br />agg <br />regation which do you choose (15marks). <br />　　4. How would you work around the lack of multiple inheritance feature in <br />J <br />ava (15marks). <br />　　5. What would you consider to be the hardest part of OO analysis and <br />desig <br />n and why (10marks). <br />　　6. How do you keep yourself up to date with the latest in software <br />techono <br />gy, especially in the field of software development (10marks). <br />　　7. What si your career aspiration? Why do you think this E-Commerce <br />Develo <br />pment Center can help you in achieving your career goals (10marks) (1hr, <br />answe <br />r in English). <br /><br />　　L\‘OR&amp;Eacute;AL的笔试题 <br />　　1. Would you please describe yourself in 3-4 lines? (limited in 500 <br />words) <br /><br />　　2. Could you tell us why we should choose you as a Loreal Person, and <br />what <br />makes you unique? (limited in 500 words) <br />　　3. What is your short-term and long-term career plan? (limited in 500 <br />word <br />s) <br />　　4. What kind of group activities are you interested in and what type of <br />ro <br />le do you often play? (limited in 500 words) <br />　　5. Please use one sentence to give a definition of ‘Beauty’, and <br />describ <br />e the most beautiful thing in your life. (limited in 500 words) <br /><br />维尔VERITAS软件笔试题 <br />　　1. A class B network on the internet has a subnet mask of 255.255.240.0, <br />w <br />hat is the maximum number of hosts per subnet . <br />　　a. 240 b. 255 c. 4094 d. 65534 <br />　　2. What is the difference: between o(log n) and o(log n^2), where both <br />log <br />arithems have base 2 . <br />　　a. o(log n^2) is bigger b. o(log n) is bigger <br />　　c. no difference <br />　　3. For a class what would happen if we call a class’s constructor from <br />wi <br />th the same class’s constructor . <br />　　a. compilation error b. linking error <br />　　c. stack overflow d. none of the above <br />　　4. “new” in c++ is a: . <br />　　a. library function like malloc in c <br />　　b. key word c. operator <br />　　d. none of the above <br />　　5. Which of the following information is not contained in an inode . <br />　　a. file owner b. file size <br />　　c. file name d. disk address <br />　　6. What’s the number of comparisons in the worst case to merge two <br />sorted <br />lists containing n elements each . <br />　　a. 2n b.2n-1 c.2n+1 d.2n-2 <br />　　7. Time complexity of n algorithm T(n), where n is the input size ,is T<br />(n) <br />=T(n-1)+1/n if n&gt;1 otherwise 1 the order of this algorithm is . <br />　　a. log (n) b. n c. n^2 d. n^n <br />　　8. The number of 1’s in the binary representation of 3*4096+ <br />15*256+5*16+ <br />3 are . <br />　　a. 8 b. 9 c. 10 d. 12 <br /><br /><br />百威啤酒(武汉公司) <br />　　1,为什么申请来百威? <br />　　2,将来有什么打算? <br />　　3,有没有社会活动经历? <br />　　4,有没有当众演讲的经历? <br />　　5,经常使用那些软件? <br />　　6,喜欢哪些课程? <br />　　7,你认为工作中的什么因素对你来说最重要? <br />　　8,什么时候可以来上班?可以在这里工作多久? <br />　　9,八点上班,要加班和出差,能不能做到? <br /><br /><br /><br />星巴克 <br />　　1、 您是一家咖啡店的店经理，你发现店内同时出现下列状况： <br />　　　1）许多张桌子桌面上有客人离去后留下的空杯未清理，桌面不干净待整理。 <br />　　　2）有客人正在询问店内卖哪些品种，他不知如何点咖啡菜单。 <br />　　　3）已有客人点完成咖啡，正在收银机旁等待结帐。 <br />　　　4）有厂商正准备要进货，需要店经理签收。 <br />　　　　请问，针对上述同时发生的情况，你要如何排定处理之先后顺序，为什么 <br />　　2、 有一位甲员工脾气不好以致在前三家店因为与店内其他同事相处不佳而屡屡调动 <br />，现在甲被调到你的店里面来，请问身为店经理的你，将如何应对？？ <br />　　3、 你是店经理，本周五结帐后，发现门市总销售额较上周五减少30%，请问可能原因 <br />会是哪几种，各原因如何应对？ <br /><br /><br /><br />凹凸电子软件笔试题 <br />　　1. Select ONE of the following projects to discuss: <br />　　a. Signal Filtering: You are given a sampled realtime waveform <br />consisting <br />of a sensor reading mixed with highly periodic impulses and high frequency <br />noi <br />se.The desired output is the realtime filtered sensor signal with the <br />impulses <br />and noise removed, and a readout of the impulse period. The FFT may not be <br />us <br />ed. <br />　　b. Interrupt Processing.A headware register consisting of eight <br />independen <br />t edge triggered latches is used to record external asynchronous interrupt <br />req <br />uests. When any of the request bits are latched, a software interrupt is <br />gener <br /><br />ated. The software may read the latch to see which interrupt(s) occurred. <br />Writ <br />ing a one to any latch bit will clear the latch. How does that software <br />assure <br />that no interrupt request is ever missed? <br />　　c. User Interface: a prototype MP3 player interface consisting of a <br />playli <br />st display and a few control buttons is given to you. How would you make the <br />i <br />nterface “skinnable”,with user selected graphics, options, and control <br />butto <br />n placement? <br />　　Each project description is incomplete. What questions would you ask to <br />co <br />mpletely specify the project? What development tools would you prefer to <br />use? <br />What algorithm /data structures/design would you use? <br />　　2. What program(s) have you coded for you own enjoyment (not part of a <br />sch <br />ool project,not for pay). What type of software project would you most enjoy <br />w <br />orking on? <br />　　3. Have you participated in a team programming project? What is the <br />hardes <br />t part of programming as a team, as opposed to programming alone? <br /><br /><br /><br />友立资讯笔试题目 <br />　　1．一堆鸡蛋，3个3个数剩余2个，5个5个数剩余1个，7个7个数剩余3个，问这堆鸡蛋 <br />最少有多少个？并给出通解。 <br />　　2．列举五岳，及其所在省份。 <br />　　3．何为四书。 <br />　　4．按顺序默写24节气。 <br />　　5．默写于谦的《吟石灰》。 <br />　　6．英语翻译约300字。 <br />　　7．作文一篇：求职有感。 <br /><br /><br /><br />普华永道PWC笔试题目（作文） <br />　　1．最近10年来中国媒体的变化。 <br />　　2．你认为发展汽车产业和公共交通哪个更重要？ <br />　　3．如何理解风险投资？ <br />　　4．如何理解广告的消极作用和积极作用？ <br /><br /><br /><br />Avant! 微电子EE笔试题 <br />　　1．名词解释：VLSI，CMOS，EDA，VHDL，Verilog，HDL，ROM，RAM，DRC，LVS。 <br />　　2．简述CMOS工艺流程。 <br />　　3．画出CMOS与非门的电路，并画出波形图简述其功能。 <br /><br />　　4．画出N沟道增强型MOSFET的剖面图。 <br />　　5．简述ESD和latch-up的含义。 <br />　　6．简述三极管与MOS管的区别。 <br />　　7．简述MOORE模型和MEALY模型。 <br />　　8．简述堆栈与队列的区别。 <br />　　奇码数字信息有限公司笔试题 <br />　　1．画出NMOS的特性曲线（指明饱和区，截至区，线性区，击穿区和C-V曲线） <br />　　2．2.2um工艺下，Kn＝3Kp，设计一个反相器，说出器件尺寸。 <br />　　3．说出制作N-well的工艺流程。 <br />　　4．雪崩击穿和齐纳击穿的机理和区别。 <br />　　5．用CMOS画一个D触发器（clk，d，q，q-）。 <br /><br /><br />德勤笔试题 <br />　　五个人来自不同地方，住不同房子，养不同动物，吸不同牌子香烟，喝不同饮料，喜 <br />欢不同食物。根据以下线索确定谁是养猫的人。 <br />　　（1）红房子在蓝房子的右边，白房子的左边（不一定紧邻） <br />　　（2）黄房子的主人来自香港，而且他的房子不在最左边。 <br />　　（3）爱吃比萨饼的人住在爱喝矿泉水的人的隔壁。 <br />　　（4）来自北京的人爱喝茅台，住在来自上海的人的隔壁。 <br />　　（5）吸希尔顿香烟的人住在养马的人右边隔壁。 <br />　　（6）爱喝啤酒的人也爱吃鸡。 <br />　　（7）绿房子的人养狗。 <br />　　（8）爱吃面条的人住在养蛇的人的隔壁。 <br />　　（9）来自天津的人的邻居（紧邻）一个爱吃牛肉，另一个来自 成都。 <br />　　（10）养鱼的人住在最右边的房子里。 <br />　　（11）吸万宝路香烟的人住在吸希尔顿香烟的人和吸“555”香烟的人的中间（紧邻） <br />　　（12）红房子的人爱喝茶。 <br />　　（13）爱喝葡萄酒的人住在爱吃豆腐的人的右边隔壁。 <br />　　（14）吸红塔山香烟的人既不住在吸健牌香烟的人的隔壁，也不与来自上海的人相邻 。 <br />　　（15）来自上海的人住在左数第二间房子里。 <br />　　（16）爱喝矿泉水的人住在最中间的房子里。 <br />　　（17）爱吃面条的人也爱喝葡萄酒。 <br />　　（18）吸“555”香烟的人比吸希尔顿香烟的人住的*右。 <br /><br /><br /><br />扬智（科技）笔试题目 <br />　　软件题目 <br />　　1. Queue is a useful structure <br />　　* What is a queue? <br />　　* Write 5 operations or functions, without details, that can be done on <br />a <br />queue. <br />　　2. Insert a sequence fo keys(24,49,13,20,59,23,90,35) into a data <br />structur <br />e, which has no keys initially. Depict the data structure after these <br />insertio <br />ns, if it is: <br />　　* a heap tree <br />　　* an AVL tree <br />　　3. * What is a synchronous I/O bus? <br />　　* What is an asnchronous I/O bus? <br />　　* Compare the advantages and disadvantages of synchronous and a <br />synchronou <br />s I/O bus. <br />　　4. Explain the following terminology: <br />　　* Baud rate <br />　　* Handshaking <br />　　* Memory mapped I/O <br />　　5. Explain the key issues in supporting a real-time operation system for <br />e <br />mbedded system. <br />　　6. Explain the mapping of visual addresses to real addresses under <br />paging <br />by <br />　　* direct mapping <br />　　* associative mapping <br />　　* combined direct/associated mapping <br />　　7. Please explain what is “write-back” and “write-through”, and <br />discus <br />s the advantage and disadvantage about these two methods. <br />　　8. Explain the concept and benefit of threads <br />　　9. What is hardware interrupt? What is software interrupt? What is <br />excepti <br />on? Please tell me all you know about interrupt. <br />　　10. Write a recursive function that tests wether a string is a <br />palindrome. <br />A palindrome is s string such as “abcba” or “otto” that reads the same <br />in <br />both directions.If you can write this function recursively,you can write an <br />i <br />terative version of this function instead. <br />　　11．什么是进程（Process）和线程（Thread）？有何区别？ <br />　　12．MFC和SDK有何区别？ <br />　　13．IRP是什么？有何作用？ <br />　　14．Windows 2000操作系统下用户模式和内核模式下编程有何区别？ <br />　　15．驱动程序的BUFFER能swap到磁盘上去吗？为什么？ <br />　　16．试编写3个函数实现 <br />　　（1）建立一个双向链表 <br />　　（2）插入一个节点 <br />　　（3）删除一个节点 <br />　　17．简述Hardware interrupt和software中断的区别，简述其应用。 <br /><br />　　18．试编写一个函数，计算一个字符串中A的个数。 <br />　　19．画出其相应流程图并编写一个函数实现一个整数到二进制数的转换，如输入6，输 <br />出110。 <br />　　20． <br />　　（1）编写一个递归函数，删除一个目录。 <br />　　（2）编写一个非递归函数，删除一个目录。 <br />　　并比较其性能。 <br />　　21．附加题：简单叙述编程经历 <br />　　硬件题目 <br />　　1．用mos管搭出一个二输入与非门。 <br />　　2．集成电路前段设计流程，写出相关的工具。 <br />　　3．解释名词IRQ，BIOS，USB，VHDL，SDR。 <br />　　4．简述如下Unix命令cp -r, rm,uname。 <br />　　5．用波形表示D触发器的功能。 <br /><br />　　6．写异步D触发器的verilog module。 <br />　　7．What is PC Chipset？ <br />　　8．用传输门和倒向器搭一个边沿触发器。 <br />　　9．画状态机，接受1，2，5分钱的卖报机，每份报纸5分钱。 <br />　　DSP题目 <br />　　1．H（n）&amp;#61501;&amp;#61485;a*h（n&amp;#61485;1）+b*δ（n） <br />　　（1）求h（n）的z变换 <br />　　（2）该系统是否为稳定系统 <br />　　（3）写出FIR数字滤波器的差分方程 <br />　　2．写出下面模拟信号所需的最小采样带宽 <br />　　（1）模拟信号的频率范围是0~4kHz <br />　　（2）模拟信号的频率范围是2~4kHz <br />　　3．名词解释 <br />　　（1）量化误差 <br />　　（2）直方图 <br />　　（3）白平衡 <br />　　（4）MMX <br />　　4．写出下面几种格式中用到的压缩技术 <br />　　（1）JPEG <br />　　（2）MPEG2 <br />　　（3）MP3 <br /><br /><br /><br />高通笔试题 <br />　　1. Can you describe the trend of wireless mobile communication industry? <br />( <br />2000 letters) <br />　　2. Compare the major third generation technologies.(2000 letters) <br />　　3. Describe the characteristics of Walsh function. Explain how to <br />generate <br />Walsh Function. (2000 letters) <br />　　4. List factors that will affect the capacity of forward and reverse <br />links <br />of a CDMA system. (2000 letters) <br />　　5. What are the differences between IS-95 A/B and cdma2000 1X? (2000 <br />lette <br />rs) <br /><br /><br /><br /><br />威盛笔试试题 <br />　　2002年软件笔试题 <br />　　1．三组程序，找出你认为的错误。 <br />　　（1）a.c long temp[255]; <br />　　b.c extern *temp; <br />　　（2）a.c long temp[255]; <br />　　b.c extern temp[256]; <br />　　（3）a.c long temp[255]; <br />　　b.c extern temp[]; <br />　　2．在第一个声明处编译出了奇怪的错误，为什么？ <br />　　#include &lt;stdio.h&gt; <br />　　#include “myfun1.h” <br />　　#include “myfun2.h” <br />　　int myInt1; <br />　　int myInt2; <br />　　3．printf(“0x%x”, (&amp;0)[&amp;#61485;1]); 请问打印了什么？ <br />　　4．汇编，用ax,bx,cx,dx，求1000×1000/30（四舍五入），结果放在ax中。 <br />　　5．编最优化Bubble(int *pIntArray,int L)，要求:交换元素不能用临时变量，如果 <br />有序需要最优。 <br />　　6．用任意一种编程语言写n!的算法。 <br />　　2003 Asic部分 <br />　　1．一个四级的Mux，其中第二级信号为关键信号，如何改善timing？ <br />　　2．一个状态机的题目用Verilog实现。 <br />　　3．Asic中的design flow的实现。 <br />　　4．用逻辑门画出D触发器。 <br />　　5．给出某个一般时序电路的图，有Tsetup，Tdelay，Tck&amp;#61485;&gt;q还有clock的del <br />ay，写出决定最大时钟的因素，同时给出表达式。 <br />　　6．用C语言实现统计某个cell在某.v文件调用的次数。 <br />　　7．Cache的主要部分。 <br />　　2003 EE笔试题目 <br />　　1．写出电流公式。 <br />　　2．写出平板电容公式。 <br />　　3．电阻R和电容C串联，输入电压为R和C之间的电压，输出电压分别为C上电压和R上电 <br />压，要求绘制这两种电路输入电压的频谱，判断这两种电路何为高通滤波器，何为低通滤 <br />波器。当RC&lt;&lt;T时，给出输入电压波形图，绘制两种电路的输出波形图。 <br />　　4．给出时域信号，求其直流分量。 <br />　　5．给出一时域信号，要求写出频率分量，并写出其傅立叶变换级数。当波形经过低通 <br />滤波器滤掉高次谐波而只保留一次谐波时，画出滤波后的输出波形。 <br />　　6．有一时域信号S=V0sin(2pif0t)+V1cos(2pif1t)+V2sin(2pif3t+90)，写出当其通过 <br />低通、带通、高通滤波器后的信号表示方式。 <br />　　7．给出一差分电路，告诉其输出电压Y+和Y&amp;#61485;，求共模分量和差模分量。 <br />　　8．一电源和一段传输线相连（长度为L，传输时间为T），画出终端处波形，考虑传输 <br />线无损耗。给出电源电压波形图，要求绘制终端波形图。 <br />　　9．求锁相环的输出频率，给了一个锁相环的结构图。 <br />　　10．给出一个堆栈的结构，求中断后显示结果，主要是考堆栈压入返回地址存放在低 <br />端地址还是高端。 <br />　　2003 Graphic笔试题目 <br />　　1．问答题 <br />　　（1）texture mapping是什么？为什么要用filter？ <br />　　（2）用float和int表示一个数，比如2，说明优点和缺点。 <br />　　（3）在MPEG哪部分可以加速硬件？ <br />　　（4）解释cubic和B-spline的差别，写出各自函数。 <br />　　（5）写出几个Win API中的OpenGL函数。 <br />　　（6）说出固定小数表示和浮点小数表示的优缺点。 <br />　　（7）说出显卡可以优化哪些MPEG中的计算？ <br />　　（8）说出Bezier和B-Spline曲线的区别。 <br />　　2．用最简单的方法判断一个数是否是2的指数次幂。 <br />　　3．S23E8和S10E5两种浮点数表示方法分析，表示0.25写一个类S10E5，实现从S23E8转 换。 <br />　　4．用模版的方式实现三个量取最大值。 <br />　　5．题目告诉你IEEE 16和32浮点数表示的规范，要求将&amp;#61485;0.25分别用IEEE 16和 <br />32表示并写一个C++函数将输入的IEEE 16表示转化为IEEE 32的表示。 <br />　　6．用C语言写一个函数f（x）&amp;#61501; x * 0.5要求只能用整数操作。 <br />　　2003 Software Engineer笔试题 <br />　　1. Describe x86 PC’s architecture in a diagram cpu,core chipset, <br />Cache,DR <br />AM, IO-subsystem, IO-Bus <br />　　2. SWI instruction is often called a “supervisor call”, describe the <br />act <br />ions in detail <br />　　* Save the address of the instruction after the SWI in rl4_svc. <br />　　* Save the CPSR in SPSR_svc. <br />　　* Enter supervisor mode and disable IRQs. <br />　　* Set the PC to 08 and begin executing the instruction there. <br />　　3. <br />　　* What is PIO operation? advantage and disadvantage? <br />　　* DMA operation? advantage and disadvantage? <br />　　* Scatter/Gather DMA engine? how does it operate? <br />　　4. MP3 decoder related. (a flow chart of decoding is presented) <br />　　* advantages of Huffman encoding? <br />　　* why the aliasing reduction is necessary? <br />　　* analytical expression in mathematics of the IMDCT? <br />　　* which block in the flow chart is suitable for the software <br />implementatio <br />n and which for the hardware? why? <br />　　5. Assembly codes -&gt; C language (about 15 lines). <br />　　6. Graduation thesis description. <br /><br /><br />汉王笔试题 <br />　　高级研究人员（模式识别、图像处理类）招聘试题 <br />　　说明： <br />　　可能您的专业并不完全符合本试题所涉及的领域。因此，并非所有的问题都需要回答 <br />，您可以只回答你所熟悉和能够回答的问题。允许参考任意的资料，但请独立完成此试题 <br />，我们更欣赏您独立的思考和创新的精神。本试题并非我们录用或者不录用您的惟一依据 <br />。应聘高级研究人员者请回答这部分问题。 <br />　　1．人工智能与模式识别的研究已有多年，但似乎公认的观点认为它仍然非常困难。试 <br />对你所熟悉的任一方向（如指纹识别、人像识别、语音识别、字符识别、自然语言理解等 <br />）的发展状况进行描述。并设想如果你将从事该方向的研究，你打算如何着手，以建立有 <br />效的识别理论和方法；或者你认为现在的理论和方法有何缺陷，有什么办法来进行改进？ <br />（500字以内即可，不要太长） <br />　　2．简述下面任一主题的主要理论框架或主要观点（500字以内即可，不要太长） <br />　　（1）David Marr的视觉计算理论框架 <br />　　（2）格式塔（Gestalt）心理学派的主要观点 <br />　　（3）Bayes决策理论 <br />　　（4）人工神经网络中的BP网络、自组织网络和联想记忆网络的主要内容 <br />　　（5）基因算法 <br />　　（6）小波分析 <br />　　（7）目前流行的有损静态图像压缩方法 <br />　　3．设想你要设计一个算法，检测给定的图像中是否有矩形结构。所要检测的矩形可能 <br />有多种形态，试提出你的算法框架。要求你的算法至少能检测出样本中的矩形，而拒绝其 <br />他的任意非矩形结构。矩形的大小、位置和方向未知，要求你的算法能确定这些参数。 <br />　　如果你认为这个问题太难而不能解决，请说明理由。 <br />　　高级软件开发人员招聘试题 <br />　　说明： <br />　　可能您的专业并不完全符合本试题所涉及的领域。因此，并非所有的问题都需要回答 <br />，您可以只回答你所熟悉和能够回答的问题。允许参考任意的资料，但请独立完成此试题 <br />，我们更欣赏您独立的思考和创新的精神。本试题并非我们录用或者不录用您的惟一依据 。 <br />　　应聘高级软件开发人员者请回答这部分问题。 <br />　　1．数据的逻辑存储结构（如数组，队列，树等）对于软件开发具有十分重要的影响， <br />试对你所了解的各种存储结构从运行速度、存储效率和适用场合等方面进行简要地分析。 <br /><br />　　2．数据库技术是计算机系统中一个非常重要的领域，几乎所有的计算机应用中都或多 <br />或少地用到了数据库。试简要地谈谈数据库设计中应当注意哪些问题，以及如何解决？给 <br />出两种你所熟悉的DBMS，要求一种适用于小型应用，另一种适用于大型应用，给出你做出 <br />选择的理由。 <br />　　3．某公司的主要业务是提供WWW和E-mail服务，出于安全考虑，该公司要求我公司提 <br />供一套网络指纹登录系统，该系统要求能够利用指纹替代E-mail中常用的密码，并对所提 <br />供的部分网页通过指纹认证后才能访问，请利用你所学过的知识对该系统进行分析设计， <br />你可以指定网络的配置（包括协议），但必须保证邮件用户既可通过网页（http方式）收 <br />取信件，也可通过Outlook收取信件。请分析该系统的可行性，可行时给出系统结构和主要 <br />的存储结构，指出系统中的难点和解决方法。（假设指纹识别的问题已经解决） <br />　　高级硬件开发人员招聘试题 <br />　　说明： <br />　　可能您的专业并不完全符合本试题所涉及的领域。因此，并非所有的问题都需要回答 <br />，您可以只回答你所熟悉和能够回答的问题。允许参考任意的资料，但请独立完成此试题 <br />，我们更欣赏您独立的思考和创新的精神。本试题并非我们录用或者不录用您的惟一依据 。 <br />　　应聘高级硬件开发人员者请回答这部分问题。 <br />　　1．下面是一些基本的数字电路知识问题，请简要回答： <br />　　（1）什么是Setup和Holdup时间？ <br />　　（2）什么是竞争与冒险现象？怎样判断？如何消除？ <br />　　（3）请画出用D触发器实现2倍分频的逻辑电路。 <br />　　（4）什么是“线与”逻辑？要实现它，在硬件特性上有什么具体要求？ <br />　　（5）什么是同步逻辑和异步逻辑？ <br />　　（6）请画出微机接口电路中，典型的输入设备与微机接口逻辑示意图（数据接口、控 <br />制接口、所存器／缓冲器）。 <br />　　（7）你知道哪些常用的逻辑电平？TTL与COMS电平可以直接互连吗？ <br />　　2．可编程逻辑器件在现代电子设计中越来越重要，请问： <br />　　（1）你所知道的可编程逻辑器件有哪些？ <br />　　（2）试用VHDL或Verilog，ABLE描述8位D触发器逻辑 <br />　　3．设想你将设计完成一个电子电路方案。请简述用EDA软件（如PROTEL）进行设计<br />（ <br />包括原理图和PCB图）到调试出样机的整个过程。在各个环节应注意哪些问题？ <br /><br /><br /><br /><br />北京信威通信技术股份有限公司面试题 <br />　　1．DSP和通用处理器在结构上有什么不同？请简要画出你熟悉的一种DSP结构图。 <br />　　2．说说定点DSP和浮点DSP的定义（或者说出他们的区别）。 <br />　　3．说说你对循环寻址和位反序寻址的理解。 <br />　　4．请写出【&amp;#61485;8，7】的二进制补码和二进制偏置码。用Q15表示出0.5和&amp;#614; <br />85;0.5。 <br /><br /><br /><br /><br />中国国际金融有限公司CICC笔试题 <br />　　1. Please tell us about an achievement that you are especially proud of <br />be <br />cause it was difficult or demanding. <br />　　（1）What the objective was? <br />　　（2）Why it is important to you? <br />　　（3）How you achieved it and the obstacles that you had to overcome in <br />ord <br />er to do so? <br />　　2. What is your career plan? Three years after graduation, and five <br />years <br />after graduation? <br />　　3. Why are you interested in investment bank? What other industries do <br />you <br />also have interests? <br />　　4. Why do you think you can be a qualified investment banker? How can <br />you <br />contribute in this industry? <br /><br /><br /><br />国泰君安笔试题 <br />　　一列火车上有三个工人，史密斯、琼斯和罗伯特，三人工作为消防员、司闸员和机械 <br />师，有三个乘客与这三人的名字相同。罗伯特住在底特律；司闸员住在芝加哥和底特律中 <br />间的地方；琼斯一年赚2万美金；有一个乘客和司闸员住在一个地方，每年的薪水是司闸员 <br />的3倍整；史密斯台球打得比消防员好；和司闸员同名的乘客住在芝加哥。 <br />　　请问谁是机械师？ <br /><br /><br /><br />Briny笔试题 <br />　　1．说出RC振荡器的构成和工作原理。 <br />　　2．什么是SDH? <br />　　3．什么是共模、差模?画出差分电路的结构。 <br />　　4．a=5; b=6; a+=b++; 执行结果是什么？ <br />　　5．什么是TDM？什么是CDMA？ <br />　　6．什么是采样定理？ <br />　　7．什么是香农定理？ <br />　　8．计算机的中断有哪几类？ <br /><br />广东北电面试题目 <br />　　英文笔试题 <br />　　1. Tranlation (Mandatory) <br />　　CDMA venders have worked hard to give CDMA roaming capabilities via the <br />de <br />velopment of RUIM-essentially, a SIM card for CDMA handsets currently being <br />de <br />ployed in China for new CDMA operator China Unicom. Korean cellco KTF <br />demonstr <br />ated earlier this year the ability to roam between GSM and CDMA using such <br />car <br />ds.However,only the card containing the user’s service data can roam-not <br />the <br />CDMA handset or the user’s number (except via call forwarding). <br />　　2. Programming (Mandatory) <br />　　Linked list <br />　　a. Implement a linked list for integers,which supports the insertafter <br />(in <br />sert a node after a specified node) and removeafter (remove the node after a <br />s <br />pecified node) methods; <br />　　b. Implement a method to sort the linked list to descending order. <br />　　3. Debugging (Mandatory) <br />　　a. For each of the following recursive methods,enter Y in the answer box <br />i <br />f themethod terminaters (assume i=5), Otherwise enter N. <br />　　static int f(int i){ <br />　　 return f(i-1)*f(i-1); <br />　　 } <br />　　Ansewr: <br />　　static int f(int i){ <br />　　 if(i==0){return 1;} <br />　　 else {return f(i-1)*f(i-1);} <br />　　 } <br />　　Ansewr: <br />　　static int f(int i){ <br />　　 if(i==0){return 1;} <br />　　 else {return f(i-1)*f(i-2);} <br />　　 } <br />　　Ansewr: <br />　　b. There are two errors in the following JAVA program: <br />　　static void g(int i){ <br />　　 if(i==1){return;} <br />　　 if(i%2==0){g(i/2);return;} <br />　　 else {g(3*i);return;} <br />　　 } <br />　　please correct them to make sure we can get the printed-out result as <br />belo <br />w: <br />　　3 10 5 16 8 4 2 1 <br /><br />　　中文笔试题 <br />　　1．汉译英 <br />　　北电网络的开发者计划使来自于不同组织的开发者，能够在北电网络的平台上开发圆 <br />满的补充业务。北电网络符合工业标准的开放接口，为补充业务的开展引入了无数商机， <br />开发者计划为不同层面的开发者提供不同等级的资格，资格的划分还考虑到以下因素：补 <br /><br />充业务与北电网络平台的集合程度，开发者团体与北电网络的合作关系，等等。 <br />　　2．编程 <br />　　将整数转换成字符串：void itoa(int,char); <br />　　例如itoa(-123,s[])则s=“-123”; <br /><br /><br /><br />U2合唱团在17分钟内得赶到演唱会场，途中必需跨过一座桥，四个人从桥的同一端出发， <br />你得帮助他们到达另一端，天色很暗，而他们只有一只手电筒。一次同时最多可以有两人 <br />一起过桥，而过桥的时候必须持有手电筒，所以就得有人把手电筒带来带去，来回桥两端 <br />。手电筒是不能用丢的方式来传递的。四个人的步行速度各不同，若两人同行则以较慢<br />者 的速度为准。Bono需花1分钟过桥，Edge需花2分钟过桥，Adam需花5分钟过桥，Larry需<br />花 10分钟过桥。他们要如何在17分钟内过桥呢？（有个同济的学生写文章说他当时在微软<br />面 试时就是碰到了这道题，最短只能做出在19分钟内过桥，微软的人对他讲这样的结果已<br />经 是不错的了！） <br /><br />　　A点到B点 <br />　　1和2过去 2分钟 2 <br />　　2过来 4分钟 2+2=4 <br />　　10和5过去 14分钟 4+10=14 <br />　　1过来 15分钟 14+1=15 <br />　　1和2过去 17分钟 15+2=17 <br /><br />　　19分钟还很不错？？？？ <br /><br />这是广州本田的试题，大家看一下 <br /><br />广州本田笔试题 <br />　　1．排序s-m-t-w-t-f-？ <br />　　2．如果六千，六百，六表示成6606，那么十一千，十一百，十一表示成什么？ <br />　　3．grass后面加一个词，agent前面加一个单词，组成两个新词，这个词是什么？ <br />　　4．农场不知道有多少鸡，现有一批饲料，如果卖掉75只鸡饲料够20天用，买进100<br />只 鸡饲料够用15天，问原来有多少只鸡？ <br />　　5．6个桶，装着两种液体，一种液体的价格是另外一种的double，桶容量为8，13，<br />15，17，19，31，有一个美国人，各用了14美元买两种液体，剩下一个桶。问剩下哪<br />个？ <br /><br />　　6．篮球场，还剩6秒，差对手4分，没可能追得上，现在有一个暂停，你会怎么指导<br />球 员去做？ <br /><br /><br />明基面试问题 <br />　　1．自我介绍（2分钟）。 <br />　　2．你大学期间最辉煌的一件事是什么？ <br />　　3．如果你明天去火星呆上300年，今天晚上你最想做的一件事是什么? <br /><br /><br />网易 <br />　　1、10个人分成4组 有几种分法？ <br />　　2、如图： <br />　　　　 7 8 9 10 <br />　　　　 6 1 2 11 <br />　　　　 5 4 3 12 <br />　　　　 16 15 14 13 <br />　　　　设“1”的坐标为（0，0） “7”的坐标为（－1，－1） 编写一个小程序，使<br />程 序做到输入坐标（X,Y）之后显示出相应的数字。 <br />　　3、#include&lt;stdio.h&gt; <br />　　　　//example input and output <br />　　　　//in 1 2 3 out 1 3 1 <br />　　　　//in 123456789 2 100 out 123456789 100 21 <br />　　　　long mex(long a,long b,long c) <br />　　　　{ long d; <br />　　　　 if(b==0) return 0; <br />　　　　 if(b==1) return a%c; <br />　　　　 d=mex(a,b/2,c)； d*=d;这里忘了;d*=mex(a,b%2,c);d%=c; <br />　　　　 return d; <br />　　　　} <br />　　　　int main(void) <br />　　　　{ long x,y,z; <br />　　　　 while(1) <br />　　　　 { if(scanf(%d %d %d,&amp;x,&amp;y,&amp;z)&gt;3) return 0; <br />　　　　 if(x&lt;0) { printf("too small\n");continue;} <br />　　　　 if(y&lt;0) { printf("too small\n");continue;} <br />　　　　 if(z&lt;1) { printf("too small\n");continue;} <br />　　　　 if(y&gt;z) { printf("too big\n");continue;} <br /><br />　　　　 if(z&gt;1000000010) {printf("too big\n");continue} <br />　　　　 printf(%d %d %d,x,z,mex(x,y,z); <br />　　　　}} <br />　　　　根据这个程序，当已知一个输入，算出输出，如：输入 1 3 1 则输出 1 2 3 <br />输 入 123456789 100 21 输出 123456789 2 100 <br /><br /><br />广州日报 <br />　　1、填空部分是一些时事题，如：我国有多少网民，三个代表、北京申奥什么的，及<br />记 者的一些常识性的问题：如我国第一个以写新闻通讯出名的记者是谁？蔡元培曾经夸奖<br />过 的记者是谁？ <br />　　2、选择题范围与填空基本一样，包括时政和新闻知识：如深度采访的实质，记者的<br />职 业道德等。 <br />　　3、简答题就比较专业：一道是你参加一条高速公路的开通典礼，如何在记者会上发<br />的 新闻通稿之外写出会上没说的内容。一道是你去一个单位采访，但没有任何该单位的证<br />件 <br />、邀请函之类东西，你如何骗过门卫混进去。第三道是有几家香水公司都想让你说好<br />话， 就是做软新闻了，你该如何处理。第四道是A明星与B明星不和，你如何报道A骂B的话而<br />又 不能让B告你诽谤。 <br />　　4、写作题是以“今年冬天不太冷”为题任意想象，加叙加议。 <br />　　5、五道智力测验：如何喝道啤酒杯底部的啤酒、汽车过隧道但高2厘米该怎么办、<br />你 吃苹果时吃到几条虫最恶心之类，10只点燃的蜡烛，让风吹灭了2只，后来在关窗户前又吹 <br />灭1只。问最后还有几支。 <br /><br /><br />面试官揭秘500强面试题几年来，我遇到三个刁钻的问题。可惜的是，我因没有心理准备而 <br />未能给出令人满意的答复。 <br /><br />　　（1）你的约会很多吗？（问这个问题的是美国一家防务公司的一名女面试官。） <br /><br />　　（2）你今天为什么来这里？（一家投资银行的面试官走进他的办公室，看到我坐在<br />那 里等他时所问的问题。） <br /><br />　　（3）如果此时外面有一艘宇宙飞船着陆，你会走进去吗？如果它可以去任何一个地方 <br />，你会要求它把您带到哪里？（一家投资银行的面试官所问的问题。）——凯利，1999年 <br />5月3日 <br /><br />　　□建议 <br /><br />　　这几个问题都具有挑战性，虽然第一个问题看上去有点不同寻常，是一名女性向另一 <br />名女性提出的问题，但你仍要认真作答，让对方感到满意。比较好的回答方式是：“如果 <br />你担心我对私人生活的关注程度大于对工作的关注程度，那么我向你保证，我对工作非常 <br />投入。同样，我努力保持平衡的生活，以各种各样的方式充实我的业余生活。”这既回答 <br />了面试官的问题，也没有暴露自己的隐私。 <br /><br />　　“你今天为什么来这里”这样的问题给你提供了一个阐述自己对这份工作的热情的<br />机 会。如果你不是从这句话的表面意思去看，那么这就是一个刁钻的问题。在接受面试<br />时， 很重要的一点是让自己轻松一点，不要分析每个问题到底是什么意思。想方设法让你的回 <br />答能够拉近你与面试官之间的关系。并表明你作为这个职位的应聘者，有着自己的优势。 <br />“我来这里是要和你讨论一下我应聘某某工作的问题。你愿意同我介绍一下自己的情况吗 ？” <br /><br />　　宇宙飞船这个问题问的是你有多大的冒险精神，要回答这个问题，需要根据你对自<br />己 所应聘的工作的了解好好组织自己的语言。假如这项工作要求你具有创新精神，那么你<br />可 以说：“是的，我会上去，去见见曾经在这个星球走过的那些最具有创新精神的人，问<br />问 他们最喜欢用什么方式来让自己尽可能保持创造力。” <br /><br />　　■下水道的井盖为什么是圆的？ <br /><br />　　微软的顾问有时会得到一些特殊待遇，因为在面试时询问他们的问题并不是真的算<br />算 术。 <br /><br />　　□范例 <br /><br />　　理查德·范曼在微软找工作 <br /><br />　　面试官：现在我们要问一个问题，看看你的创造性思维能力。不要想得太多，运用<br />日 常生活中的常识，描述一下你的想法。这个问题是，下水道的井盖为什么是圆的？ <br /><br />　　范曼：它们并不都是圆的，有些是方的，的确有些圆井盖，但我也看过方的，长方的 。 <br /><br />　　面试官：不过我们只考虑圆形的井盖，他们为什么是圆的？ <br /><br />　　范曼：如果我们只考虑圆的，那么它们自然是圆的。 <br /><br />　　面试官：我的意思是，为什么会存在圆的井盖？把井盖设计成圆形的有什么特殊的<br />意 义吗？ <br /><br />　　范曼：是有特殊意义，当需要覆盖的洞是圆形时，通常盖子也是圆的。用一个圆形<br />的 盖子盖一个圆形的洞，这是最简单的办法。 <br /><br />　　面试官：你能想到一个圆形的井盖比方形的井盖有哪些优点吗？ <br /><br />　　范曼：在回答这个问题之前，我们先看看盖子下面是什么。盖子下面的洞是圆的，<br />因 为圆柱形最能承受周围土地的压力。而且，下水道出孔要留出足够一个人通 </p>
		<p>转载网址：<a href="http://blog.csdn.net/casularm/archive/2006/10/11/1330145.aspx">http://blog.csdn.net/casularm/archive/2006/10/11/1330145.aspx</a><br /> </p>
<img src ="http://www.cnitblog.com/guopingleee/aggbug/32835.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/guopingleee/" target="_blank">向左向右走</a> 2007-09-03 09:47 <a href="http://www.cnitblog.com/guopingleee/archive/2007/09/03/32835.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>