您的位置:首页 > 职场人生

经典面试题,大家帮忙解答!!

2010-07-20 20:10 281 查看
百度面试:
1。一个随机生成器,能能生成1到10000的数,请问怎么用这个随机数生成器生成10到20的随机数?
2。一个随机生成器,只能生成0到9单位数,请问怎么用这个生成器生成任意的N位整数?
3。系统中资源共享有几种方式?
4。TCP建立连接和释放连接的过程是怎样的?

Gameloft(手机游戏老大)
1. What numbers are considered “true” in c plus plus?
2. What are inline functions?
3. What is Memory Alignment?
4. Explain ‘passing by value’, ‘passing by reference’, ‘passing by pointer’?
5. What are the possible problems with implicit copy constructor?
6. Explain the need for “Virtual Destructor”?
7. What is the difference between ‘overloading’ and ‘overriding’?
8. Why pre Increment operator can be faster than after Increment?
9. Optimize the following expressions.
& logic and
| logic or
>> move right
<< move left
% 取余
/ 取整
(a) int a=b*4;
(b) int a=b*72;
(c) int a=b%1;
(d) int a=b%16;
(e) int a=(b+c)/2;
(f) int a=(b*3)/8;
(g) int a=(b%8)*4;
10.编写一个函数,完成以下功能,如AABBBCCCDEFF输出为2A3B3CDE2F。
String Compress(String text)
10. 颜色编码转化函数,RGB颜色编码占32位,四个字节,其中最高字节8位为空。现有十六位颜色编码,其中R占5位,G占6位,B占5位。
unsigned short ConvertRGB888toRGB565(unsigned int nSourceColor);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: