您的位置:首页 > 其它

其他公司的笔试题6

2006-11-22 14:48 239 查看
发信人: Turkey (冬日校园主干道上的阳光), 信区: Jobs
标 题: 面试题目(转载)
发信站: 紫金飞鸿 (2001年11月18日14:10:17 星期天), 站内信件

【 以下文字转载自 PostGraduate 讨论区 】
【 原文由 Turkey 所发表 】

1、What are the two operating mode of X86, and how do they work?
[align=left] 2、class a{};[/align]
[align=left]class b:virtual public a{};[/align]
[align=left]class c:virtual public a{};[/align]
[align=left]class d:public b,public c{};[/align]
[align=left] [/align]
[align=left]void main()[/align]
[align=left]{[/align]
[align=left] int i1,i2,i3,i4;[/align]
[align=left] i1=sizeof a;[/align]
[align=left] i2=sizeof b;[/align]
[align=left] i3=sizeof c;[/align]
[align=left] i4=sizeof d;[/align]
[align=left] cout << i1 << i2 << i3 << i4;[/align]
} what are the results of i1,i2,i3,i4? and why?
1448
3、请问线程和进程在win32平台上的区别和联系。
4、请尽量详细的解释下列名词:PCI,USB,PnP,P1248...

发信人: utiao (啦啦啦啦……), 信区: jobs
标 题: lucent那个struct的:
发信站: 虎踞龙蟠 (2004年11月04日15:23:20 星期四), 站内信件

struct CELL // Declare CELL bit field
{
unsigned character : 8; // 00000000 ????????
unsigned foreground : 3; // 00000??? 00000000
unsigned intensity : 1; // 0000?000 00000000
unsigned background : 3; // 0???0000 00000000
unsigned blink : 1; // ?0000000 00000000
} screen[25][80]; // Array of bit fields
问sizeof(CELL)的值
4
struct CELL // Declare CELL bit field
{
Char c;
} screen[25][80]; // Array of bit fields
则为1
由此说明sizeof按照最长的类型对齐,

用TCP协议建立Socket连接,如果客户端和服务器端的Buffer都是1K大小,客户端先发100字节,然后再发送100字节,问服务器端收到的有多少。
问完后盯着我笑,然后说我问的问题不一定有正确答案。
有可能是一次就收到200byte; 也有可能收到先收到100byte, 接着又收到100byte.
不管理怎样, 如果网络是正常的, 服务端最终肯定会收到200byte的。这是TCP表现为流形式。
如果是UDP则不同。

1。请实现一个类型,该类型只能在栈上分配,不能从堆上分配
2。请实现一个类型,该类型只能在堆上分配,不能从栈上分配
察看more effective c++
1。重载一个private的operator new

说明:new操作符变为私有,不能这样构造对象了:
CMyClass* pmyObj = new CMyClass(); // 堆上
只能这样:
CMyClass myObj;// 栈上

2。将ctor作为private,写一个public的static的CreateObject方法,在其中用new
创建object。

说明:ctor变为私有,不能这样构造对象了
CMyClass myObj;// 栈上
只能这样:
CMyClass* pmyObj = CMyClass::CreateObject();; // 堆上
如何实现路由跟踪
发一个TTL为1的包
发一个TTL为2的包
....
直到包能被对方接收为止

1。UNIX中调用bind 然后unlink 会出现什么情况,为何?

2。网络编程中,发送文件或接受文件出了问题,怎么处理,最好给出一个例子。

3。网络中,传输的数据如何识别数据传输结束,给个例子
另外常用的语句m_socket->Send((char*)&bitSize,sizeof(bitSize)+1); 加1是干吗的
1、bind和unlink似乎并不是有很密切的关系吧?除非你创建的socket使用的是Unix域协议(即socket的时候使用的是PF_LOCAL或者PF_UNIX)

常规的socket不知道你怎么unlink?unlink(2)的参数是const char*,而常规socket并没有什么const char*来标志的唯一识别形式……

2、这个也太宽泛了吧?可以让对方从断点重传,也可以让对方从头来过,还可以让对方什么都不管。

3、怎么看这个都像是M$风格的代码啊?是Unix的面试题么(怀疑m_socket指向了CSocket对象,然后通过->来调用虚函数的)?

1Q:The following function divides a by b and out put to c,returns -1 as error.
Int divide (int a,int b,int c)
List you test cases in a black-box testing.

1问:对 Int divide (int a,int b,int c)函数写出黑盒测试用例

2Q:Int a ctivity(int nage,bool bmale)
{if (nage<60)
return zoo;
else if(bmale)
return golf;
else return movie;
}
用cyclomatic complexity,共有多少条路径

3Q:The following function tests whether the three numbers can be the lengths of the three sides of a triangle.
Bool triangle(float a,float b,float c)
List you test cases in a black-box testing.
3问:也是让写黑盒测试用例,是一个三个数是否是三角形的三条边的测试

有双向循环链表结点定义为:
struct node
{ int data;
struct node *front,*next;
};
有两个双向循环链表A,B,知道其头指针为:pHeadA,pHeadB,请写函数将两链表中data值相同的结点删除(我问了一下,在效率和内存使用上没有要求。)

从键盘读入一个数,输出n*n数组
如:输入3
打印1 2 3
8 9 4
7 6 5
输入4
打印1 2 3 4
12 13 14 5
11 16 15 6
10 9 8 7
[align=left]void main() [/align]
[align=left]{ [/align]
[align=left] int n = 0, row = 0, col = 0, val = 1; [/align]
[align=left] int left = 0, right, top = 0, bottom, dir = RIGHT; [/align]
[align=left] int matrix[MAX][MAX]; [/align]
[align=left] cout << "تنبën: "; [/align]
[align=left] cin >> n; [/align]
[align=left] right = n - 1; [/align]
[align=left] bottom = n - 1; [/align]
[align=left] while( val <= n * n ) [/align]
[align=left] { [/align]
[align=left] switch( dir ) [/align]
[align=left] { [/align]
[align=left] case RIGHT: [/align]
[align=left] if( col <= right ) [/align]
[align=left] { [/align]
[align=left] matrix[row][col++] = val++; [/align]
[align=left] break; [/align]
[align=left] } else { [/align]
[align=left] top++; [/align]
[align=left] col--; [/align]
[align=left] row++; [/align]
[align=left] dir = DOWN; [/align]
[align=left] }; [/align]
[align=left] case DOWN: [/align]
[align=left] if( row <= bottom ) [/align]
[align=left] { [/align]
[align=left] matrix[row++][col] = val++; [/align]
[align=left] break; [/align]
[align=left] } else { [/align]
[align=left] right--; [/align]
[align=left] row--; [/align]
[align=left] col--; [/align]
[align=left] dir = LEFT; [/align]
[align=left] }; [/align]
[align=left] case LEFT: [/align]
[align=left] if( col >= left ) [/align]
[align=left] { [/align]
[align=left] matrix[row][col--] = val++; [/align]
[align=left] break; [/align]
[align=left] } else { [/align]
[align=left] bottom--; [/align]
[align=left] col++; [/align]
[align=left] row--; [/align]
[align=left] dir = UP; [/align]
[align=left] }; [/align]
[align=left] case UP: [/align]
[align=left] if( row >= top ) [/align]
[align=left] { [/align]
[align=left] matrix[row--][col] = val++; [/align]
[align=left] break; [/align]
[align=left] } else { [/align]
[align=left] left++; [/align]
[align=left] row++; [/align]
[align=left] col++; [/align]
[align=left] dir = RIGHT; [/align]
[align=left] }; [/align]
[align=left] }; [/align]
[align=left] }; [/align]
[align=left] [/align]
[align=left] for( row = 0; row < n; row++ ) [/align]
[align=left] { [/align]
[align=left] for( col = 0; col < n; col++ ) [/align]
[align=left] { [/align]
[align=left] cout << matrix[row][col] << " "; [/align]
[align=left] }; [/align]
[align=left] cout << endl; [/align]
[align=left] }; [/align]
[align=left]} [/align]
1 如何在不引入第三个变量的条件下交换变量a和b的值,三步完成?
a ^= b ^= a ^= b

2 一个单链表,不知道长度,如何快速找到中间节点的位置?
用两个指针吧,一个递增1,一个递增2,如果第二个到头了,第一个就是在中间结点上面了。
Link *temp1 = head;
Link *temp2 = head;
if(temp1 == NULL)
return NULL;
while(temp2 != NULL && temp2->next != NULL)
{
temp1 = temp1->next;
temp2 = temp2->next->next;
}
return temp1;

使用加号'+',减号'-',和等号'=',插入到1234567890中,使其等式成立.
为简单起见,只求解等号在最右边的情况.如:
1-2+34+56-7+8=90 符合要求
12-3+4+5+6-7-8-9=0 符合要求
12+3-4+5-6+7-8=9+0 不符合要求
程序代码规范,结果正确,要有必要的注释.输出所有可能的情况。
使用TC2.0,TC3.0,VC6.0,dec++ 编译器均可.

指出下面程序的错误。
int Func(volatile int *x)
{
return *x * *x;
}
volatile修饰的变量的意思就是告诉编译器这个变量的值随时都可能改变,因此每次使用它的值的时候都要重新从内存读取,编译器就不会为了提高效率而直接使用可能已经暂存到寄存器中值
这里x指针就在每次访问的时候都要重新从内存里面读取,确保x指向了其他变量也能够跟踪器变化,比如说,你那个函数中的return语句中,第一次获取x指向的内容是,他可能指向的变量a,第二次获取的时候,可能已经指向了b了,结果就返回了a*b,而不是a*a。
所以这个题关键看他是什么目的,如果仅仅是为了求平方,这样写就有问题了,要么把volatile去掉,要么就a=*x,return a*a

输入一个学生的分数(百分制),90~100 输出为A,80~89输出为B,70~79输出为C,60~69输出为D,其他输出为E。
用运行最快的程序来实现(用于比较的次数越少越好)。
(用switch语句并不是最快的)
char aa[] = "EEEEEDCBAA";
printf("%c",*(aa+a/10));

说有两个桶,一个装水,一个装油。用以勺子舀一勺油倒进水桶,然后搅拌均匀,在水桶里舀一勺倒进油桶,问:水桶里油多还是油桶里的的水多?
,这个问题应该是一样多
注意水和油是不会互溶的
所以舀一勺水到油桶,它会沉到最下面,然后舀一勺油到水桶,它也是完全的一勺油
所以水桶里的油和油桶里的水都是刚好一勺

如果这到题改成水和酒精(可互溶)
答案还是相同,但是解释就不是这样了,假设酒精是x升,勺子是1升
从水舀到酒精一勺,那么酒精中就有1升水,这时候酒精桶里的比例是x:1
再舀回一勺,其中的酒精是x/(x+1)升,水是1/(x+1)升
所以水桶里的酒精是x/(x+1),而酒精桶里的水,因为被舀回去1/(x+1),所以也是x/(x+1)

1、在子网210.27.48.21/30种有多少个可用地址?分别是什么?
1。210.27.48.21/30代表的子网的网络号是30位,即网络号是210.27.48.21 & 255.255.255.251=210.27.48.20,此子网的地址空间是2位,即可以有4个地址:210.27.48.20, 210.27.48.21, 210.27.48.22, 210.27.48.23。第一个地址的主机号(host number/id)是0,而主机号0代表的是multicast地址。最后一个地址的最后两位是11,主机号每一位都为1代表的是广播(broadcast)地址。所以只有中间两个地址可以给host使用。其实那个问题本身不准确,广播或multicast地止也是可以使用的地址,所以回答4也应该正确,当然问的人也可能是想要你回答2。我个人觉得最好的回答是一个广播地址,一个multicast地址,2个unicast地址。

2、TTL是什么?有什么用处,通常那些工具会用到它?(ping? traceroute? ifconfig? netstat?)

2。TTL是Time To Live,目前是hup count,当包每经过一个路由器它就会被减去一,如果它变成0,路由器就会把包丢掉。IP网络往往带有环(loop),比如子网A和子网B有两个路由器相连,它就是一个loop。TTL的主要目的是防止包在有回路的网络上死转,因为包的TTL最终后变成0而使得此包从网上消失(此时往往路由器会送一个ICMP包回来,traceroute就是根据这个做的)。ping会送包出去,所以里面有它,但是ping不一定非要不可它。traceroute则是完全因为有它才能成的。ifconfig是用来配置网卡的,netstat -rn 是用来列路由表的,所以都用不着它

3、路由表示做什么用的?在linux环境中怎么来配置一条默认路由?
路由表是用来决定如何将包从一个子网传送到另一个子网的,换局话说就是用来决定从一个网卡接收到的包应该送的哪一张网卡上的。路由表的每一行至少有目标网络号、netmask、到这个子网应该使用的网卡。当路由器从一个网卡接收到一个包时,它扫描路由表的每一行,用里面的netmask和包里的目标IP地址做并逻辑运算(&)找出目标网络号,如果此网络号和这一行里的网络号相同就将这条路由保留下来做为备用路由,如果已经有备用路由了就在这两条路由里将网络号最长的留下来,另一条丢掉,如此接着扫描下一行直到结束。如果扫描结束任没有找到任何路由,就用默认路由。确定路由后,直接将包送到对应的网卡上去。在具体的实现中,路由表可能包含更多的信息为选路由算法的细节所用。题外话:路由算法其实效率很差,而且不scalable,解决办法是使用IP交换机,比如MPLS。

在Linux上可以用“route add default gw <默认路由器IP>”来配置一条默认路由。
4、在网络中有两台主机A和B,并通过路由器和其他交换设备连接起来,已经确认物理连接正确无误,怎么来测试这两台机器是否连通?如果不通,怎么来判断故障点?怎么排除故障?
4。测试这两台机器是否连通:从一台机器ping另一台机器
如果ping不通,用traceroute可以确定是哪个路由器不能连通,然后再找问题是在交换设备/hup/cable等。

第一道

class bc
{
public:
void f()
{
cout<<"hello"<<endl;
}
}

void mf(const bc& x)
{
x.f();
}

这段简单的程序有编译期错误,请指出并改正

bc::f” : 不能将“this”指针从“const bc”转换为“bc &”
应该定义为void f() const
第二题

一只猴子x天吃了y个桃,每天n个(0<=n<=10)
求每天吃桃数目的所有可能性

我的朋友参加了CA的美国面试。有3个不会。
question 1:
There is a 3D point and a line segment(bounded 3D line)given by endpoints.
Assuming simple vector operations vecSub,vecAdd,vecDot,vecCross,
vecDist and vecLen are available,write a function that will compute the distance
from the point to the line segment?

question 2:
a_global_fuc(){
....
}

void myclass:my_fun(){
{
class b;
a_global_fun();
}
}
an instance of b is defined in a block that limits its visibility. the instance does not seem to be used in this block. why would one write code like this ?

question 3:
The following piece of code is an example of bad software design.pls find and fix bugs
class A
{
public:
Data data;
A* p1;
A* p2;
};

void toDoWhat(A** p)
{
(*p)->p1 =(*p)->p1->p2;
(*p)->p1->p2=(*p);
(*p)=(*p)->p1;
}

由键盘输入a1---a15十五个数字,再计算以下表达式,
a1
1+ -------------------
a2
1+ ---------------
a3
1+ ----------
a4
1+ ------
............
a14
1+ --------
a15

这样在一直算,,请问怎么写啊,分母不知道要怎么求,谢谢,应急之用。

double* (*a)[3][6];
cout<<sizeof(a)<<endl;
cout<<sizeof(*a)<<endl;
cout<<sizeof(**a)<<endl;
cout<<sizeof(***a)<<endl;
cout<<sizeof(****a)<<endl;
double* (*a)[3][6];
cout<<sizeof(a)<<endl; ----- 4 :a是一个指针,所以大小为4
cout<<sizeof(*a)<<endl;----- 72 :4*3*6 ,a指向一个2维数组,而数组中的元素也是指针
cout<<sizeof(**a)<<endl; ----- 24 :4*6,数组的第2维的大小
cout<<sizeof(***a)<<endl; ----- 4 :数组中元素的大小
cout<<sizeof(****a)<<endl;----- 8 :数组中元素指向内容为double,所以8

面试题:不申请变量和空间反转字符串,用一个函数实现

n个元素依次入栈,入栈后可以立即出栈,则有多少种可能的(正确的)出栈序列?
例如:123,只能有123,321,213,132,231
1/(n+1)*C(2n,n).
这题不是那么简单的,n个数,当第n个数最先出栈的时候,只有一种可能顺序:n,n-1,n-2,...1
同理当第x个数出栈的时候,除了比x先出栈的数外,其余小于x的数也只能按从大到小顺序排列了(中间可以插入比x大的数)

1.Are the following definitions valid? Why or why not?

const std::string hello = "Hello";
const std::string message = hello + ", world" + "!";

2.. Are the following definitions valid? Why or why not?

const std::string exclam = "!";
const std::string message = "Hello" + ", world" + exclam;

2是错误的
编译器报错:invalid operands of types `const char[6]' and `const char[8]' to binary `operator+'
因为"+"操作符的重载版本是:
string::operator+(char*)
所以,string类对象在前,char*在后是可以的,反过来就不行了!

autodesk
在类的普通成员函数中调用虚函数,情况是怎么样的?

具体来说,问题如下:

在类的普通成员函数fun1中调用了本类中的虚函数vfun2。 如果在外部有该类的对象指针pobj,或者对象obj,或者应用robj;

1 那么pobj-〉fun1();调用的是vfun2的虚函数(可能是派生类中的vfun2),还是说调用的是vfun2在本类中的定义?

2 那么obj.fun1();调用的是vfun2的虚函数(可能是派生类中的vfun2),还是说调用的是vfun2在本类中的定义?

3 那么robj.fun1();调用的是vfun2的虚函数(可能是派生类中的vfun2),还是说调用的是vfun2在本类中的定义?
对象的函数调用跟虚函数没有任何关系,编译时就知道调用哪个函数并生成一般的函数调用代码,是编译期的调用。虚函数机制只会在使用对象指针或引用时才会起作用,程序在运行时查找指针或引用所指向的真正的对象的虚函数表,并产生函数调用。所以无论是在哪里调用虚函数,实际都会调用指针或引用指向的真正的对象的虚函数(如果对象没有改写虚函数,则调用其基类相应的函数)。所以,pobj和robj真正指向的对象的虚函数会被调用。

应网友要求,发布 参考 答案或我题目的目的,请指教
1、估计一下广州有多少理发师,如果允许,你还需要那些调研工作?并给出你的推导过程。你认为你的 估算结果可信吗?
考查分析问题的能力
参考答案1:
根据广州总人口,每人的年理发费用,理发成本和理发师的年收入来计算
参考答案2:
根据本校的学生总数及理发师总数得出一个理发师的年客户人数,再根据广州总
人口估出答案

2、看过那些软件方面的书籍
考查对软件的兴趣和知识面(兴趣是最好的老师)

3、什么是软件,软件开发包括那些步骤,并说出你对这些步骤的理解
考查对软件过程的理解

4、OSI网络结构的七层模型分别是什么,并说出你认为划分为7层的理由。
考查对软件功能的划分,各模块功能的独立型。(高内聚低耦合)

5、软件过程中了解、使用过版本控制或建模工具吗?对你工作有什么帮助?
考查实际技能

6、软件过程中你都写过什么文档?分别是什么目的及其对你的帮助?
考查对软件过程的理解

7、我们知道,C++将内存划分为三个逻辑区域:堆、栈和静态存储,请说出它们的区别及你的理解。 http://www.nmzol.com/wlxy/rjkf/200507/5320.html
8、字符串A是由n个小写英文字母(a ~ z)构成的,定义为char A
。你能用更少的空间表示这个字符串吗?请写出从char A
到你的新的储存格式的转换函数。(请用C/C++编程,不允许上机操作)

12、对现在的Stack(栈)数据结构进行改进,加一个min()功能,使之能在常数,即O(1),时间内给出栈中的最小值。可对push()和pop()函数进行修改,但要求其时间复杂度都只能是O(1)。
要使pop,push,min,max这四个函数的时间复杂度全部为O(1):
stack在记录value的同时,必须还要记录所有最大值和最小值,最后,这个栈是这个样子:
value, max_value, min_value
比如,插入2,4,1,3,栈就是:
3, 4, 1
1, 4, 1
4, 4, 2
2, 2, 2
http://community.csdn.net/Expert/TopicView3.asp?id=4407616
9、C++构造函数为什么不能是虚函数?
虚函数需要虚指针,虚指针在构造时初始化。而且构造函数默认为内联函数

10、C++中virtual与inline的含义分别是什么?虚函数的特点;内联函数的特点;一个函数能否即是虚函数又是内联函数?
一个函数不能同时是虚函数和内联函数?

12、请列出实现C++代码你认为需要注意的一些问题。
接口的充分必要,功能独立,

11、你在原来的项目中有没有遇到什么困难,又是如何解决的?

嵌入式开发面试题:用查表算法计算一个字节里有多少位被置1
unsigned char mask[] = {1,2,4,8,16,32,64,128};
unsigned char val = 11;
unsigned char* p = mask;

int c = 0;
while(p < mask + 8)
{
if ( *p++ & val)
++c;
}

cout<<"num of 1's = " << c <<endl;
给定时间为X年X月X天X日X时X秒,输入一个数据N秒,判断N秒后为哪年哪天哪日哪时哪秒?

昨天阿里巴巴笔试题
两道编程题:
1请用最少的额外空间将一个M*N的矩阵旋转90度,写出算法描述和类c语言程序; http://topic.csdn.net/t/20051128/09/4422199.html 2完成如下函数,给定分子和分母,输出其小数表示形式,循环节用[]表示,例如给出分子
:13,分母19,输出为:0.[13]

原型:float setprecision(float n,int bits)// 按四舍五入将浮点小数的小数点后的位数设成bits位

1、 test.exe是一个判断1800-2000之间的某个年份是否为闰年的程序,请设计测试用例测试该程序。
A.输入一个负数看程序作出什么样的判断?
B.输入一个1~1799的年份看程序的输出结果如何?
C.输入一个2001~的年份看程序的输出结果如何?
D.输入年份1800,2000看程序是否能够作出正确的判断;
E.输入一个年份介入1800~2000看程序是否能够作出正确的判断; 。
f:特殊字符的输入(我把负号放在这里面测试)
g:其他特殊功能的输入(如年代自动补位)
h:安全性能测试,(启动多个程序test。exe)
j:部分黑盒测试(各个适用系统的测试)
i:画面测试(如果有的话)
其中f是必不可少的,其他都是有可能出现的,不过面试题么,说得越多越好
2、 一个传真调度程序。这段代码将从一个指定的文件名发传真到一个电话号码。其中有校验的要求:带区号的电话必须是这样的格式xnn-nnn-nnnn,其中x必须是在2到9之间,而n可以是从0到9的任何数字。以下的区域是预留的,现在还不是有效的区号:x11、x9n、37n、96n。
函数的原型是:
/*
Send the named file as a fax to the given phone number.
*/
public boolean sendFax(String phone,
String filename)
给定了这些需求,请设计测试用例
A.输入的X的值不为2~9,系统应该给出提示;
B.当输入的X的值正确时,判断整个字符串不为x11、x9n、37n、96n;
C.当指定的文件名不存在时,程序能够给出相应的提示;
D.当给定的号码不存在时,程序能够 给出相应的提示;
E.当指定的电话号码无应答时/忙时/不可到答时,程序能够给出相应的提示;
F.当传真的文件足够大时,系统是如何处理的
A:和1类似,也需要边界值得测试
B.当输入的X的值正确时,判断整个字符串不为x11、x9n、37n、96n;
我觉得应该是不以x11、x9n、37n、96n开头的字符串
E,F我觉得不是这个测试需要处理的
G:判断输入位数(长度)
H:健康性判断(输入其他字符,字符位置不一致)
如:2347-123-4567,2-12345-679
J;错误字符(/*+·#¥%—……)
I:双字节字符(中,日字符里面有占2字节的数字字符)

socket编程中bind的作用是什么? server client中bind是不是可以不使用,为什么?针对UDP TCP 两种情况
TCP的情况:
server必须bind并且让client知道,否则client怎么知道要连server的哪个端口呢?
client要看情况,如果是必须指定要在某个端口发送、接收数据的话,就要bind。另外,在多地址主机/多网口主机/路由器的情况下,要指定绑定到那个ip地址(网口)上去连接,否则操作系统会把数据发往第一个ip地址对应网卡。
UDP的情况:
如果是client同样可以不调用bind,直接sendto。
不分TCP和UDP,只要必须在某IP和端口用socket就bind,通常服务器都需要。客户端如果不关心自己的socket名字,就可以不调用bind,当然调用也可以

用户输入若干字符串,如果输入的是0000
表示结尾,对用户输入的字符串排序并输出到屏幕。

void main()
{
vector<string> SV;
string s;
while (cin >> s)
{
if (s == "0000") break;
SV.push_back(s);
}

sort(SV.begin(), SV.end());
ostream_iterator<string> OS(cout, "/n");
copy(SV.begin(), SV.end(), OS);
}

1、设一个IP主机192。168。5。121,子网掩码255.255.255.248,那么该主机的网络地址: d
A192.168.5.12 B192.169.5.121 C192.169.5.120 D192.168.5.120

2、TCP和UDP属于OSI模型哪一层: b
A Session B Transport C Network D DataLink

3、下面哪个协议操作在UDP上层? b
A ARP B DNS C Telnet D 全不是

4、在IPv4中,下面哪个是回馈地址: c
A 0.0.0.0 B 10.0.0.1 C 127.0.0.1 D 255.255.255.255

5、在BSD socket APIs中,设置UDP服务器需要那些函数; c
A socket() bind() listen() connect()
B socket() bind() listen() accept()
C socket() bind()
D socket() bind() listen()

6A类B网络有一个子网掩码维255.255.240.0,每个子网最多可拥有的主机数: c
A 240 B 255 C 4094 D 65534

1.If a process reports a "stack overflow" runtime error,what's the most possible cause?_______ c
A.Lack of memory
B.Write to an invalid memory space
C.Recursive function calling
D.Array indes out of boundary
2.Choose the statements you think it is right.______ a
A.#ifndef is equivalent to #if !defined.
B.malloc is a pure C function and can't be used in C++ because new has beenintroduced to fully replace it.
C.#include <filename.h> and #include "filename.h" work in same way,only in different expession.
D.Array can only be created on stack. 静态区
3.Which of the following mechanism CANNOT be used as inter-process communication way in the Linux operation system?__ c
A.Pipe/Message Queue
B.Share Memory
C.Global Variable
D.Berkeley Sockets
4.FIFO algorithm and LRU algorithm are two typical page replacement algorithm when a page fault occurs.A process has ownership of three memory pages,think about the page
access sequence of this processis 1321215123,if a is the fault number of use FIFO as page replacement algorithm,and b is the fault number of use LRU as page replacement
algorithm,what is the correct value of a:b ____________ b
A 4:3
B 3:2
C 1:1
D 2:1
E None of above
5.In the following inter-process communicationmechanisms ,which one is mainly used for exception handling:________ b
A.Shared memory
B.Signals
C.Semaphores
D.Message queues
E.Remote procedure calls
6.Which data structure is most frequently used in relational database to store data on disk?______ a
A.B+ tree
B.Syntax tree
C.Binary tree
D.Heap
7.If sorting the string "12345798",which of the following methods is fast? ____________ b
A. quick sort
B. bubble sort
C. merge sort
D. heap sort
8.Which of the following tools is NOT used as version controls?_____ d
A. Clearcase
B. CVS
C. Sourcesafe
D. Source Insight
9.What is function will output below in debug Mode in VC?_
Detected memory leaks!
Dumping objects ->
D:WVisialC++WCodeGuruWMemoryLeakWMemoryLeak.cpp(67):{60}normal block at 0x00324818,4 bytes long.
Data:<,> 2C 00 00 00
Object dump complete. d
A. _CrtSetDumpClient
B. _CrtMemDumpAllObjectsSince
C. _CrtCheckMemory
D. _CrtDumpMemoryLeaks
10.Which address below is the default address when we load a DLL in a process for the first time? ________ c
A.0x0100000
B.0x0200000
C.0x0400000
D.0x0800000
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: