1、 关于硬件巨头 Intel 笔试面试卷目智力题 1每天中午从法国塞纳河畔的勒阿佛有一艘轮船驶往美国纽约,在同一时刻纽约也有一艘轮船驶往勒阿佛。已知横渡一次的时间是 7 天 7 夜,轮船匀速航行,在同一航线,轮船近距离可见。 请问今天中午从勒阿佛开出的船会遇到几艘从纽约来的船? 2巴拿赫病故于 1945 年 8 月 31 日。他的出生年份恰好是他在世时某年年龄的平方,问:他是哪年出生的? 答案: 设他在世时某年年龄为 x,则 x 的平方1945 ,且 x 为自然数。其出生年份 x 的平方-x=x(x-1),他在世年龄 1945-x(x-1)。 1945 的平方根=44.1 ,则x 应为 44 或
2、略小于此的数。而 x=44 时,x(x-1 )=4443=1892,算得其在世年龄为 1945-1892=53;又 x=43 时, x(x-1)=4342=1806,得其在世年龄为 1945-1806=139;若 x 再取小,其在世年龄越大,显然不妥。故 x=44,即他出生于 1892 年,终年 53 岁。笔试题目 1设计一个重采样系统,说明如何 anti-alias。 2y1(n)=x (2n),y2(n)=x (n/2),问: 如果 y1 为周期函数,那么 x 是否为周期函数? 如果 x 为周期函数,那么 y1 是否为周期函数? 如果 y2 为周期函数,那么 x 是否为周期函数? 如果 x
3、为周期函数,那么 y2 是否为周期函数? 3如果模拟信号的带宽为5kHz,要用 8k 的采样率,怎么办。 4某个程序在一个嵌入式系统(200M 的 CPU,50M 的 SDRAM)中已经最优化了,换到另一个系统(300M 的 CPU,50M 的 SDRAM)中运行,还需要优化吗?5x+a*x+x +c*x+d 最少需要做几次乘法。 6三个 float:a,b,c 问值: (a+b)+c=(b+a )+c (a+b)+c=(a+c)+b 7把一个链表反向填空。 8下面哪种排序法对 12354 最快? A. quick sort B. buble sort C. merge sort 9哪种结构平
4、均来讲获取一个值最快? A. binary tree B. hash table C. stack 10 #include “stdafx.h” #include iostream.h struct bit int a:3; int b:2; int c:3; ; int main(int argc, char* argv) bit s; char *c = (char*)s; *c = 0x99; cout s.a endl s.bendls.cendl; return 0; Output:? 11 挑 bug,在 linux 下运行: #include stdio.h char *reve
5、rse(char* str) int len=0, i=0; char *pstr=str, *ptemp,*pd; while(*+pstr) len+; pstr-; /ptemp=(char*)malloc(len+1); ptemp=(char*)malloc(len+1); pd=ptemp; while(len-) *ptemp=*pstr; ptemp+; pstr-; i+; *ptemp=*pstr; ptemp+; *ptemp=0; return pd; main() char string40= “Hello World!”; char *pstr=string; pr
6、intf(“%s”, pstr); printf(“%s”, reverse(pstr); 实验室笔试题 1写出下列信号的奈亏斯特频率 (1)f(t)=1+cos(2000pait )+sin(4000pait) (2)f (t)=sin(4000pait)/pait (3)f(t)=(sin(4000pait )的平方) /pait 2有两个线程 void producer() while(1) GeneratePacket(); PutPacketIntoBuffer(); Signal(customer); void customer() while(1) WaitForSignal(); if(PacketInBuffer10) ReadAllPackets(); ProcessPackets(); (1)有没有其他方法可以提高程序的性能