intel 笔试:
1.单链表逆置,双向链表删除
2.层次遍历二叉树
3.rand4()生成rand9()
4.非常多的各种指针操作。
面试:完全的问项目
1.stl boost c++中的智能指针,以及其实现原理?
2.b 树的插入
3.代码实现stack 的排序,只能用stack 的基本操作
乐港面试:
服务器实时排名?(和完美世界一个样子)
为啥下午5点review code 的问题。
- // testofrecursive.cpp : 定义控制台应用程序的入口点。
- //
- #include "stdafx.h"
- #include "iostream"
- using namespace std;
- class A
- {
- int a;
- char c;
- public:
- void foo(){cout<<"a foo"<<endl;}
- virtual void fool(){cout<<"a fool"<<endl;}
- };
- class B:public A
- {
- int a;
- char c;
- public:
- void foo(){cout<<"b foo"<<endl;}
- void fool(){cout<<"b fool"<<endl;}
- };
- void func(int k)
- {
- if (k>0)
- {
- cout<<k;
- func(k-1);
- cout<<endl;
- func(k-1);
- //func(k-1);
- }
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- func(4);
- int size = sizeof(A);
- A *a = new A;
- B *b = new B;
- b->fool();
- b = (B *)a;
- a->foo();
- b->foo();
- b->fool();
- return 0;
- }
// testofrecursive.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "iostream"
using namespace std;
class A
{
int a;
char c;
public:
void foo(){cout<<"a foo"<<endl;}
virtual void fool(){cout<<"a fool"<<endl;}
};
class B:public A
{
int a;
char c;
public:
void foo(){cout<<"b foo"<<endl;}
void fool(){cout<<"b fool"<<endl;}
};
void func(int k)
{
if (k>0)
{
cout<<k;
func(k-1);
cout<<endl;
func(k-1);
//func(k-1);
}
}
int _tmain(int argc, _TCHAR* argv[])
{
func(4);
int size = sizeof(A);
A *a = new A;
B *b = new B;
b->fool();
b = (B *)a;
a->foo();
b->foo();
b->fool();
return 0;
}
完美世界笔试,面试:
1.c++强制类型转换:
http://www.cnblogs.com/alexqdh/archive/2011/06/09/2075713.html
2.inline函数优缺点:
面试:滑动窗口,服务器实时排名,为什么想做服务器后台开发?数组中第k大的数,阻塞和非阻塞
研究所:
说说你的规划,走技术路线,成为一个T字形的人才(这个回答应该会能impressive 面试官)
中移动物联网:
1T数据的高效传输方案
兆芯:
滴滴出行,编程题,要求找到数组中连续和等于0的,最长子数列:
- // testdidi.cpp : 定义控制台应用程序的入口点。
- //
- #include "stdafx.h"
- #include<iostream>
- using namespace std;
- int result[10000] = {1,2,3,4,-1,-2,-3,-3,1,2};
- int main()
- {
- int length = 10;
- int begin = 0;
- int end = 0;
- int max_length = 0;
- int sum = 0;
- for(int i = 0;i <length;++i)
- {
- sum = 0;
- for(int j = i;j <length;++j)
- {
- sum = sum + result[j];
- if ((sum == 0) && (max_length < j-i))
- {
- begin = i;
- end = j;
- max_length = end - begin;
- }
- }
- }
- for(int i = begin;i<=end;++i)
- {
- cout<<result[i];
- cout<<' ';
- }
- return 0;
- }
// testdidi.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
int result[10000] = {1,2,3,4,-1,-2,-3,-3,1,2};
int main()
{
int length = 10;
int begin = 0;
int end = 0;
int max_length = 0;
int sum = 0;
for(int i = 0;i <length;++i)
{
sum = 0;
for(int j = i;j <length;++j)
{
sum = sum + result[j];
if ((sum == 0) && (max_length < j-i))
{
begin = i;
end = j;
max_length = end - begin;
}
}
}
for(int i = begin;i<=end;++i)
{
cout<<result[i];
cout<<' ';
}
return 0;
}