栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > C++面试题库

明基(BENQ)2012校园招聘笔试题之C++方向

明基(BENQ)2012校园招聘笔试题之C++方向

1. What’s overload function in C++?

 

2. A. What’s inline function in C++?

B. When would you use inline function?

C. Please write sample code.

 

3. Which of the following are legal? For those usages that are illegal, explain why.

const int buf;

int cnt = 0;

const int sz = cnt;

cnt++; sz++;

 

4. Please point out the errors in the following C++ code. And why?

switch ( ival )

{

case 1, 3, 5, 7, 9:

oddcnt++;

break;

case 2, 4, 6, 8, 10:

evencnt++;

break;

}

 

5. Given the following base and derived class definitions:

class base

{

public:

foo ( int );

protected:

int _bar;

double _foo_bar;

};

class Derived: public base

{

public:

foo ( string );

bool bar ( base *pb );

void foobar ();

protected:

string _bar;

};

Identify what is wrong with each of the following code fragments and how each might be fixed:

(a) Derived d; d.foo ( 1024 );

(b) void Derived :: foobar () { _bar=1024; }

(c) bool Derived :: bar { base *pb }

{ return _foo_bar = = pb->_foo_bar; }

 

6. A. Please list all the design patterns you known.

B. Please explain the pattern of “Factory” and give an example if you can.

 

7. A. Please list all the sorting algorithms you known.

B. Please use pseudo code to describe the algorithm of “Quick Sort”.

 

8. Please answer the following questions:

A. What’s process scheduling and list all scheduling algorithms you known.

B. What’s the “Race Condition”?

C. Please explain the diagram of process state change.

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/265696.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号