求职经历

来源:互联网 发布:西部数据加密软件 编辑:程序博客网 时间:2024/04/29 06:20

求职记录:

9.8:华为(软开,操作系统),埃森哲,搜狗(云,搜索),网易有道(有点怪异,要论文?),大众点评技术培训生,百度,360


9.12:微软2012校园招聘 , 易安信(EMC)eBay百姓网2012校园招聘,创新工场(这两个不用网申,直接发简历),京东

9.13:趋势科技, 思科(system enigeer,emedded engineer),yahoo,IBM,google,淘宝网2012校园招聘-Taobao.com

9.14:  ebay paypal, marvell

9.16. Sonicwall(音墙网络)2012校园招聘,美国国家仪器,网易游戏(系统,web平台),网易(c++数据库,Java服务器端开发工)。

9.17:日本的jobtessio会社

9.19: 完美时空,启明星辰,亚马逊,IntelAMD2012,阿里云http://www.joinaliyun.com/aliyun_02.htm#

9.19:华为销服

9.27:nvidia(gpu architect)

10.2:腾讯 http://join.qq.com/index.php?mod=job&act=index, 支付宝,saphttp://alipay.ceping.com/OtherMessage/Index?otherMessage=1&TenantID=0(这个乱七八糟的),阿郎,盛大:http://xyzp.snda.com/index.html

10.5:微策略:http://campus.chinahr.com/2012/pages/mstr2012/intro.asp,Morgan Stanley,新浪微博:http://www.yingjiesheng.com/job-001-156-012.html

10.23:合合信息科技2012校园招聘。


面试记录

9.16:在百姓网面试,被bs了,做网站的还那么牛,无语啊。不过面试确实发现了很多问题。

准备问面试官的问题: 现在在外企做技术的都会遇到这样一个问题,就是核心技术不在中国,在外企做技术相当技术含量不高,您怎么看待这个问题。
                       对于一个应届生,您觉得第一份工作最重要的是什么,待遇,行业,工作环境,还是什么?
                       在IBM做一个研发人员,除了要把技术相关的工作做好,还需要在哪些方面多做些工作才能在IBM发展的更好
                       IBM的rational团队将来的发展方向是什么,有想做些最新的领域的技术吗?比如云计算,虚拟化等?
                       大家都说IBM是美国的国企,相对而言缺少活力,您觉得IBM缺少活力吗?
                       在IBM做任何事情都是基于流程的,所以很多人说在ibm工作只是做个螺丝刀,能接触到的东西不过,你是怎么看待这个问题的?
                       为什么有的人可以一直往上升,有的人不可以

9.26:interview with second line manager  in IBMsong ge, Maggie).
Just have a happy chat with her. she is very nice and do not ask me difficult problem and make me feel nervous.
the major retrieve from the chat with her is she told me I need finish my duty excellently and focus on different areas related with my own area. if i just focus on what i am doing now i will become a  screw in the big machine and i will not grow quickly.

The second point is maybe i can try different role in the company. front end, Backend, PMA, test. different role will have different view on the product and different view can deep our understand about the technique. Maggie herself also experience several roles in the corporation,including developer, tester, manager. do not reject new role it might lead me to the other path.

try to communicate with team members. learn from them, try to join in them. express my own idea. not just work self.
being happy it is one day and being unhappy it is also one day. why not being happy.

9.27:上午去面了中兴,不知道行不行,感觉什么都没问。感觉做的项目确实太烂的,没什么好讲。

9.27:上午面完中兴接了intel的电面,用英文面的,感觉一般,不知道在说什么。有点乱。
          问了自我介绍,兴趣爱好,工作经历。职业发展目标,最好的软件开发技术,个人的优缺点等。
my name is xiao chaojie and currently i am a graduate student in shanghai university,majoring in computer science and i will graduate in march 2012.
i have many hobbies including reading books, watching movies, playing basketball and traveling.
in the school My research interest includes network security. I will do some research on data mining and use the data mining algorithm to analyze the network status. so i am familiar with network.
I have internships in three companies. the first one is shengda network corporation. there i majorly focus on internet system development, including network middleware.
and second one is EMC. there my major work is concerned with storage product. I am responsible for fixing bugs for the product and adding some new features concerned with storage.
and the latest one is IBM. I work in the compiler team and I am an development intern who focus on backend in the compiler. My major work is about the optimization algorithm in the compiler

My career object is first of all i will choose an industry that is useful and quickly developing, such as embedded system, cloud computing, storage, software tools, server system etc. which can provide lots of useful product to our business clients and IT industries.
the second one is I want to join a big company because in a big company i can retrieve lots of useful resources, lots of opportunities to work on the most advanced technology in the world and also i can work with the most talent people in the industries. I wish i can work in a company for more than 3 years when i graduate from school so that i can have a deep insight about one area in the computer science and accumulate some experience about one area.

best software skill is programming, c++,c, shell, linux, algorithm,data structure.

my biggest advantage is i have solid knowledge about computer science. I have done a good job in the school i think. additionally, I think i also have very good technique skill. I am good at programming. I also have lots of working experience and I know how to work in a team and make contribution. and the last one is i love technique work.

My biggest disadvantage is my soft skill is not very good. I should improve my communication skill. to learn how to communicate with others smoothly is one of my major work when i graduate from and join the work in the future.

project description:
1. inline assembly feature:
It is about the inline assembly feature in the compiler. We know that we can write assembly in c code. and compiler should support this feature. and what we do is to provide this feature in IBM XL compiler.
in this feature we majorly focus on three steps:
The first one is to parse the inline assembly in the c code and retrieve what we need, such as instructions, operands of the instructions.
after parsing the inline assembly we can generate the intermediate code for these instructions. in the compiler there is a relatively complicated data structure to store the intermediate code.
after this step we can go through the optimization of the compiler backend and reach the final step to generate object code for the powerpc architecture. and that is all what we do in this feature.

the difficulty i met in the project.
first of all, the most challenging difficulty in the project is i am lack of background knowledge about compiler, inline assembly, powerpc architecture, powerPC ISA. there are lots internal materials in the team i spend almost one months to read all the materials and try to catch up with other members in the team.

After join the feature I also met lots of specific problems. the first relatively difficult problem i met is I write an instructions called addc in inline assembly and this instruction might modify the condition register so if i want to check whether the instruction set the correct value in the condition register then i should read the condition register before the addc and after the addc and the compare the result of these two instructions. but after i compile the inline assembly code the second instruction that read the condition register is deleted. so i need find the root cause of the problem in the compiler code.the method is to read the intermediate code generated after each optimization algorithm.through the intermediate code i can know after which optimization algorithm the second instruction is deleted. so that i can read the corresponding code to find the problem. finally i find a algorithm that will delete the instruction. the principle is in the algorithm there is a table and the algorithm will record all the registers the instructions use. if algorithm reads a register that exists in the table it might think that it is duplicate and delete it.so what i do is do tell the compiler that the instruction addc will modify the condition register and remove the condition register from the table that record the register after the instruction addc so that the second instruction that read condition register will not be deleted.

of course i also met some other problems. for example, i have an instruction called sub a, b ,c and i specify that the operands are register. but compiler will do some optimization on the operand. one optimization algorithm called value numbering will change the register with the immediate value. it will cause error when i get the operands from the data structure because i need
a register operand but the result is an immediate value. of course the solution to this problem is prevent the algorithm to replace the register with the immediate value in the algorithm.

fix bug: stack offset problem. first of all i should run case and pass some parameters to the function. but during the run of the test, i found that if i change the order the parameters in the function, it will pass. but when i change to another order then it will fail. so i think it will be caused by the wrong offset in the stack. so that i follow this way to find the root cause of the problem. the root cause the alignment of float complex variant in the compiler.


2. snapshot: provide some application on samba vfs in the nas product. audit, recycle, snapshot.
the project is not very complicated. we provides three functions:
1. arrange the system log of samba and provide it to clients in a user-friendly way.
2. provide recycle functions
3. provide snapshot functions so that clients can recover the data stored at specific time point before. we also provide ACL to control the permission of recovery.

difficulties:
1. linux provides snapshot based on the volume not on the filesystem. so how to provides the filesystem level snapshot?  what we do is extract what we need from the snapshot to provides the snapshot for one file folder. for example, in one volume we have several share folders such as folder a, folder b,folder c. and we just want to provide snapshot for share folder a. what we do is to make a a snapshot for the whole volume and extract the snapshot information about folder a from the whole volume snapshot and mount it under the folder a. we have tried several methods. first of all, we try cannot use copy because even if we copy the file to the folder a, disk management do not know. it still write data to the original data. then we use soft link. because we cannot make a hard link for a directory. but the use of soft link also fails.because samba does not permit folder access the data outside its folder. and the last method is mount. i write a script to do this process automatically. The script can create snapshot for any folder in the any volume in the any volume pool (volume group). These methods are all not effective.only mount can work.

another problem is still not fixed. we need freeze disk when we create snapshot so that no io can be operated on the disk. but if we transport one big file from windows to linux and during the transportation, if we want to make snapshot we should freeze the disk and it will cause the failure of the file transmission. we still do not have very good methods to deal with this problem.

3. apipool:
a network routing middleware. eliminate the use of sdk when publish some applications. we provides a uniform interface to our clients. the interface consists of service name, api, paramters, so clients just need to send requests that contains these information to the server and we will do some process on this request.
first of all  we should find the server where service is located according to the service name. after finding the server address we can transfer the request to the service server. services server will process the service request according to the method name and parameters contained in the request. when the process is over service server will make a package that contains the result and send it back to our middleware. we will find the request and then get the address of client and send back the result.

Difficulties:performance is the most important factor in the development of server. we met a problem when we have the pressure test. we have ten clients and send requests to the server as quickly as possible. the memory consumption of server will increase significantly. and finally the server is down. At first we think our process has memory leak but we go through all the code and print log when we call new and delete. and number of new and delete is the same. so we think our process does not have memory leak. so we discard the possibility of memory leaking.
the second method we use is profiling. the low level of our program is a queue that is used to store the network packages send by the clients. so if the high level of the program cannot process these packages quickly then the packages in the low-level queue will become more and more. finally they consume all the memory in the system. so we need find the functions that consume huge amounts of time. after profiling, we find the problem lies in the algorithm used to check the access frequency. our server the limit the access frequency of each ip. an ip only can access to our server 100 times in one second,for example. at first our algorithm will store the timestamp of every request into the list and check the number of timestamps locates within a specific time range.if the number is greater than a threshold then the access is forbidden. the time complexity of the algorithm is O(n^2). we changed this algorithm. the new algorithm is similar to sampling algorithm. For example, we want to limit the number of access in 1 minute. That is 60 seconds. so we just need 60 buckets. each time an request comes we just add it to the first bucket. that means the value of first bucket increment by one and the sum of each bucket also increment by one. if the sum is over one threshold then the request is forbidden. each time one second passes then we will discard the last bucket and add a new bucket to the head. of course we will update the sum of all the buckets. with this method we can reduce the time complexity to O(1).perfect.


9.28:拒掉了中兴。价格太低7300

9.29:去intel笔试+面试,一轮笔试+3轮面试。拿到口头的offer。
笔试相对简单,没有什么特别难的题目,都是c,c++,算法方面的题目,也有些操作系统,体系结构的题目。
然后就是面试了,基本上都是我说我做的东西,然后他们问,然后看你是不是能够说清楚。关键是有什么难点,有什么新的东西,有什么技术,在团队管理上有什么问题等等。

第一个人面试上来就问了我在学校做的事情,我说是搞数据挖掘算法用于检测网络流量的,我本来以为他没什么兴趣的,想不到他还挺感兴趣,一直在问。什么是决策树,什么是聚类,什么是模式识别,这个东西怎么用的,怎么定参数,会话流里面的统计信息怎么定,看过什么论文,参考过哪些人做的什么,问的挺多,然后论文发在哪里等等。
//需要把决策树和聚类的再看看,有点忘记了。自己看了哪些论文需要整理下再。会话流的统计信息的使用再整理。网格映射的概念,桶排序的概念再整理下。回去把流程图在画下。关键是整理思路,别人看你的表达不是看结果。

第二个人相当简单,基本没问什么,都是关于在学校的兴趣,课题,项目,怎么样学习,学习方法,怎么快速进入一个新的team,学校不好怎么办,各个公司的文化特点,自己的发展等等,基本都是聊天。

最后的应该是lead,上来就问我个比较tough的问题,在team里面有没有和其他member发生争执的事情?我举了个例子是做apipool是检测内存泄露的问题。我认为没有内存泄露,而team里面的lead认为有,然后我怎么证明的,通过对new和delete打日志,发觉new和delete的个数是一致的。所以我认为没有泄露。然后通过profiling,统计每个函数的使用时间,发觉有个函数特别慢,从而引起了底层队列的数据包不断增加,从而造成内存不断上升。最后我将算法改了后内存问题就没了。

之后问了两个问题都没回答好,一个是图论里面的最小距离问题,应该是dijkstra算法吧,好久不用了,忘记了。
dijkstra:和最小生成树差不多。一个集合s表示所有找到离源最近的节点。V-S表示剩余的节点。每次都是找到s到V-s中最小权重的边,然后把那个边对应的在V-s中的节点找到并放入S中,然后更新通过这个节点可以到达的所有节点的距离。如果比现有的更短,则更新距离。


然后是关于优化的问题。
if a == b + 3
   c = d + b *2
else
   d = c + a * 2
怎么样用+,-,*,/,=来表示上述的代码?
完全不懂啊,悲剧啊。考察抗压能力,主要是面对完全没有头绪的东西是不是能抗压,而不是很快放弃。

1. 怎么判断一个大于>=0的数是不是等于0,不能用if,==?
2- (a+2)/(a+1)    //无语啊,怎么就能想到?
但是如果a是可能小于0的呢?

2. 如果一个数是0,那么0%2=0,如果一个数是1,那么1%2=1.这个可以用来判断是*0,还是乘以1.

虽然第三个面的太烂,但是那个人说可能给我offer,现在只是个口头的offer,具体的offer得10月份才能定下来。

总结:
回来要多准备下数据挖掘方面的和论文方面的东西,继续看算法,c++,c,要是可能看些编译原理优化算法的东西。
一定要诚实回答问题,不要老是想对方怎么想,自己表达自己的意思就可以了
考题的答案不是重点,关键考察思路。
需要更加努力。

10.8. microsoft phone interview. just ask basic information about me. have a english interview.

10.10,interview by charles yan. 简单的聊天。关键点是:1.做喜欢的事情,要有passion。2. 做事情讲究方法,要有效率,要把精力放在最重要的地方,客户,executive最关心的地方。要参与到最热闹的地方,要做最核心的东西,提出自己的想法,而不是别人让你做什么就做什么。

10.11,淘宝笔试。烂七八糟的,无语,大家坐在一起,乱的很。有道题目还行,memmove的。
memmove,考虑内存重叠问题。
char * memmove(char * dest,char * src,int n){
    if(dest <src){    //只要dest小于src的都可以直接拷贝,否则要考虑反向问题
        for(int i = 0 ;i< n;++i){
            dest[i]  =src[i];
        }
    }
    else{
        char * p = dest + n -1;
        char * q = src + n -1;
        for(int i = 0;i<n;i++){
            *p = *q;
        }
    }
    return dest;
}

10.11.oracle面试。
基本上问c++的,那个人好牛。搞java的竟然c++那么熟悉。
问道个函数对象的问题。和函数指针差不多,为什么要函数对象,因为函数对象是对象,可以在构造时传参数,而函数指针不行。详见c++ primer
函数调用就是调用一个函数的地址,该地址是编译时确定的。
apipool的包结构等信息,有点忘了。
c++和java的最大区别是java的平台无关的。
deadlock。用一个锁去锁两个资源,这样就可以保证两个资源被一个线程获得,而不是两个线程各自占用一个资源。
c++中padding是padding在每个元素中间的。即
struct S{
    char a;        //padding是在a后面。
    int b;
}

多重继承中的成员二义性:比如程序
class Test
{
    public:
        int a;
};

class T2:public Test
{
};


class T3:public Test
{
};

class T4:public T2,public T3
{
};

如果有个int main(){
    T4 t;    
    t.a = 1;    //如果加上这句话编译失败,不加编译通过。
}
需要在T2,T3继承时加上virtual,而且两个必须都加,只加一个没用。

10.11网易题目:
2个集合,元素都为int,每个集合占内存2GB,先在内存总共4G,求两个集合的交集。可以用磁盘文件。
我的方法:两个集合A,B,先把B写到文件里面,从内存释放。创建一个bitmap(B1)保存2^32bit的数组。(大小为512MB)。然后把扫描集合A,并设置B1相应的位。然后把A移到硬盘上。把B读入内存,然后再创建个bitmap(B2)(512MB),同样扫描B,设置B2相应的位。结束后扫描B1和B2,如果相同的位两个bitmap都被设置了则是交集。

10.11,淘宝笔试
题目不难,有个memmove的题目,挺好
最后个做好友列表,用list比较好,节约空间。

10.14:
google笔试有个求组合排列的题目:
一共是780个假定abc为一个单位共有1个abc,2个a,4个b和1个c一共8个单位进行含有相同元素的全排列共有8!/1!/2!/4!/1!=840种方法含有相同元素的全排列算法总元素个数的阶乘依次除以每种元素相同元素的阶乘比如这里的共有1个abc,2个a,4个b和1个c一共8个单位进行含有相同元素的全排列总元素个数的阶乘8!依次除以每种元素相同元素的阶乘abc:1!,a:2!,b:4!,c:1!结果就是8! /1! /2! /4! /1!=840其中仍然有重复的就是出现了两个abc的情况共有2个abc,1个a和3个b一共6个单位进行含有相同元素的全排列共有6!/2!/1!/3!=60种方法840-60=780
用100,50,20,10,5,1元组合成小于1000000(10^6)的钱币。求组合数。

f(n)表示选择n个5元可以有的组合方式。
当5元个数是2的倍数时,可以由1个10元代替。
当5元个数是4的倍数时,可以由1个20元代替,是10的倍数可以由1个50元待遇,是20倍数可以由1个100代替。

f(n) = n/2+1+n/4+1+n/10+1+n/20+1;    if n >=100
f(n) = n/2+1+n/4+1+n/10+1                 if n>=50
...
f(n) = n/2+1                                      if n>=2
f(0) = 1, f(1) = 1

int f(n){
if(n == 0)return 1;
if(n == 1)return 1;
int cnt = 0;
int nums[5]={2,4,10,20};
for(int i = 0;i<4;++i){
    if(n>=nums[i])
        cnt += n/nums[i] + 1;
    else
        break;
    return cnt;
}


int g(N){
int k = N/5;    //N可以由多少个5组成。
int num = 0;
for(int i = 0;i<=k;i++){
num+=f(i);        //选择0-k个5时不同的组合数求和
}
return num;
}

貌似文件系统一部分是运行在内核态,一部分是用户态。

2011.10.14:
面淘宝,被鄙视了。一棵二叉树怎么求中位数?    通过中序遍历将二叉树变成链表进行排序然后找中位数。http://blog.csdn.net/hhygcy/article/details/4654305
linux服务器的并发数的限制:打开文件数,端口数。http://hi.baidu.com/zzxap/blog/item/ab3f2aedbe6c3b5978f05587.html
select的文件数有限(1024),poll可以大于1024,但是用轮询慢,epoll对大量fd且存在热点fd时情况较好。
分数0-100,小数精确到0.5,用一个char,前面7位保存0-100的整数,最后位保存0.5。
保存海量中文,每个中文保存一次,对于人名里面只要保存
字符串hash,http://blog.csai.cn/user3/50125/archives/2009/35638.html
好友关系可以用图保存,出度为好友,入度为别人加自己为好友。

结果是被鄙视了。海量数据不懂。

可以用trie树保存每个字符串的前缀信息。

2011.10.15qq笔试:
题目不难,都是比较基本的,算法,图,数据结构,网络,os。
执行一个文件夹下的某一个可执行文件,这个文件夹不需要可读权限,只要可执行权限即可。
ls一个文件夹下面的内容需要可读权限。
私有IP地址范围:   A: 10.0.0.0~10.255.255.255 /8  B:172.16.0.0~172.31.255.255 /16  C:192.168.0.0~192.168.255.255 /24
初始数据集的排列顺序对算法的性能无影响的是B、堆排序

图的最小生成树貌似不能求tsp问题,即旅行商问题。中国邮递员问题。
哎,貌似又被bs了。

2011.10.16:百度笔试
vector的push_back的内存申请?两倍于原始内存大小当内存不够
vector的clear方法。clear调用每个对象的析构函数,如果是指针则不调用。并将size置为0.内存并没有释放。
要把vector的内存释放的方法是用swap,如
std::vector aVector;
//do something here.
aVector.swap( std::vector() );    //更改了aVector的内存。

用rand(s,t)在半径为R的园内随机取n个点。先用rand(0,360)取个角度A,在rand(0,R)去个长度Z,得到一个x=ZcosA,y=ZsinA.这样得到一个点。

无限长得流,随机在流中取m个元素。蓄水池算法。每个元素取到的概率是m/i。见http://wansishuang.iteye.com/blog/443902

大量request,需要用hash保存request,一台机器不够,需要用n台。我认为是一致性hash的题目,见http://blog.csdn.net/sparkliang/article/details/5279393

2011.10.16:qq面试第一轮
上来说apipool的项目:
client与server是用tcp连接。每个tcp连接有个netid,client每发一次request(servicename,api,param),这个netid会保存在这个request里面,然后用这个request去申请个fcgirequest,这个fcgirequest会保存request的指针。这个fcgirequest会带一个seqno,并保存在一个map<seqno,fcgirequest>里面,用seqno作为key,fcgirequest作为value,到服务端处理完fcgirequest后把seqno放在result包中传回来,server通过seqno在map<seqno,fcgirequest>里面找到对应的fcgirequest,然后创建个response包,根据fcgirequest里面的request指针找到request里面的netid,通过netid找到对应的客户端tcp连接,把response发送回去。

第二个是读程序:
int kk;

int *a(){
    int kk = 2;   
    return &kk;    //貌似返回局部地址可以
}

int *b(){
    static int kk = 2;    //静态没问题
    return &kk;
}

int *c(){
    kk = 3;
    return &kk;    //全局可以
}

int *d(){
    int *kk;    //kk指向的地址不定。
    *kk = 4;    //可以空指针,非法内存访问。segment fault
    return &kk;
}


int main(){
    printf("%d\n",*a());printf("%d\n",kk);
    printf("%d\n",*b());printf("%d\n",kk);
    printf("%d\n",*c());printf("%d\n",kk);
    printf("%d\n",*d());printf("%d\n",kk);
}
 
第二题是10万个struct的数组,sizeof(struct)512字节。struct里面有个weight,要根据weight求出最大的500个struct。
用最小堆,每个节点保存weight,以及10万个struct数组中对应的下标。这样保存保存最大的500个weight。

第三题是给定两个int集合A,B,判断B是否属于A。即交集。
两个集合A,B排序,用归并排序的归并方法求交集。
可以直接用个hash表保存A里面的元素,然后再遍历B,对每个B判断是否在hash表中。

2011.10.18:百度面试(1,2,3轮)
1. 第一轮不难,简单说下项目,把apipool的和p2p流量检测说下,然后说下dbscan的聚类算法的原理。
判断两个链表是否相交,找到交点,不用比较长度的方法,我当时说的方法是用个hash表记录第一个链表的每一个节点的地址,然后再在第二个链表里面一个个找,第一个被找到是交点。

2. 第二轮开始难了:
A。上来给个系统设计题目。每个site里面有个js tag,然后一个client访问了某个site就可以触发这个site里面的js tag,这个js会发送一个log到后台服务,然后后台服务会统计这个log,要求获得的信息是每个site的pv,每个site的独立访问ip数量。
我的想法是用两个hash,一个记录hash<site,pvcnt>,每个site的pv量。另一个hash是指hash<site,set<ip>>。//晚上更新(20.50),貌似这边可以用到bloomfilter来记录这个set,这样可以减少空空间。然后增加个hash<site,uniqueipcnt>,如果site对应的bloomfilter不包含这个ip,则uniqueipcnt+1,否则不变。

B.第二个题目是证明任何一个整数可以用3^k以及+-法组合得到,比如4=3+1,5=9-3-1,证明N可以用3^k以及+-法组合,每一个3^k只能出现一次。
这道题目完全不懂,放弃。悲剧。面试官提示是任何一个数可用二进制表示,那任何一个数可以用三进制表示。但是貌似不对。比如三进制的5=12,那么3+2=5,但是2不是3^k,所以需要把2给换掉,2=3-1,所以所有的2都被换成2=3-1。然后将所有相同的3^k合并,但是问题是多个3^k合并不一定是等于3^k',可能只是3的倍数而已,比5=3+2=3+3-1=6-1,6不是3的k次方,这个时候需要将6写成9-3,可以证明,任何一个2个3^k都可以写成3^(k+1) - 3^k,比如2*3=3^2-3,又如2*3^3 = 3^4 - 3^3,所以如果相同的3的k次方有2个则可以用另外两个不相同的3^k来表示,如果是4个则其中3个可以用一个连表示,另一个则可以自己表示。这样就完全可以证明了N可以用3^k以及+-来表示。

C.常规题目,m个数里面求最大的k个数,编程之美上有,举出多个解法。我说了几个,排序,select模型,最小堆,桶排序等等。

3. 第三轮,那更难了。
第一题:上来做个游戏题目,甲乙两人,每个人可以报数1,2,4.每人保一个数,然后这个数会累加到总数上,比如甲报1,乙报2,则总数为3,现在谁先报到100则谁输了。
上来题目比较难,但是只要找到方法就不难了,这个和编程之美上的nil游戏很像。谁先到100谁输了,则在99时报数的人一定输,98报数的时候一定赢,97报数的时候也一定赢,96报数一定输,95,94报数一定赢,93报数一定输,这样两个win,一个lose,所以只要我使对方报数是总和是3的倍数,即3,6,9,。。。93,96,99即可,所以对方报1,我报2,对方报2我报1或4,对方报4我报2,即和3的倍数即可。这样就有必胜的策略。(我竟然做出来了,无语啊)

第二题:做个存储系统。有多个爬虫在爬数据,现在要保存每个url的html,以及每个site的url数量。
用两个hash,一个是hash<url,html>,一个是hash<site,set<url>>。通过这边可以用bloomfilter来表示set,更加节省内存。
关键是怎么保存,我开始使用memcache,根据url和site的hash值散列到不同的memcache上面。后来面试官的问题是这个全部用memcache太浪费内存,成本我不能接受。
我提出了使用mongodb的方案,一种nosql的数据库,可以使用文件持久化保存key,value形式的数据。可以通过cache的缓存4g的数据,加快数据的读写速度。但是面试官的问题又来了,说为什么要用cache,原因是什么,我说cache目的是延迟写操作,不用频繁读写文件。但是面试官不是很同意我的想法。他觉得没用必要使用cache。因为一个html一般都10m,20m,4g根本存不下什么东西。所以更加偏向于使用文件。让我设计个文件系统,保存这些数据。
我的想法是每个site建立一个文件夹,以site为文件夹名字。然后这个site里面的文件保存key,value形式的数据,key是url,然后value就是html,通过一个辅助的数据结构记录key所在的文件偏移量。这样就可以快速找到key对应的文件偏移从而读出html值。同样的只要遍历找到key的个数就可以知道每个site的url数量。最后又问了文件太大,怎么样做分割,我说通过时间,通过内容,等方法进行分割。问道了文件的大小,我说利用L1,L2cache来提高性能,L1一般512字节,L2一般2M。所以文件的话一个2M会比较好。或者2的k次方大小。

最后就开始瞎聊了,实习啦,offer啦,为什么选择百度,为什么不选择google,为什么不选择腾讯等等的烂问题。哥很坚定的选择百度的因为钱多啊。因为百度有眼光,看中了我这个牛人。
不知道我最后的回答怎么样,但愿能给offer,我已经尽力了。

2011.10.21.华为面试:
今天去华为面技术服务。 其实开始并不是很想去面技术服务的。开始觉得只是想去非洲,想去国外,但是真的让我去我能去吗?只是抱着玩玩的心态去的。到了那里,人是那个多啊,好多人都穿了正装在那边,我感到压力了。到了那边就有点不自在。不一会就被叫去面试了,面的销服那块,很没底,怕一上来就被刷掉。面试官也没问什么,都是学校里面的东西,做的项目,估计他也不感兴趣,看看我的表达而已。面了一会就结束了,出去等下一轮。出去了就吃了个饭,然后就开始做网上测评。比较简单,也过了。面了两轮开始觉得有点意思了,开始进入状态了,然后进入了群面,我最不擅长的。群面我也没讲什么话,被面试官点名了,让我总结下真个team的结论等等,总结是我的强项啊,乱说了一堆反正,然后面试官问我为什么讨论时话不多,我说因为我不同意他们的意见,但是为了真个团队的继续运作,所以我觉得还是以团队合作为重,不提出反对意见。之后又说了很多乱七八糟的东西,就结束了群面。群面结束后被刷了一个人,我以为是我,想不到不是我。晕。之后是综面,一个面试官对着两个人,一个我,还有个女生,面的技术服务职位,我放在还是那样,乱说,基本不问技术的。乱聊天。就这么过了,最后是英语测评,感觉做的不好,好多时间没有上机做英语测试了,很不习惯,做的不好。接下来就是等通知了,要两周,慢慢等吧。


2011.10.22:emc总算面完了。
emc结束了,所有的笔试面试准备都是为了emc。以前是那么想进的地方,现在已经没有了概念。面试不是太难,关键是数学不是特别的好,第一个面试官问了个求积分的题目,要用到二分法。不是特别的懂。问了scp怎么在脚本中进行不交换操作。现在想想貌似可用重定向出入,将ssh的public的key传到server上去。
为什么 函数重载的返回值不同不算重载,面试官的答案貌似是因为返回值在调用时可能不用,比如int func();void func(); func(); //which one? 所以返回值不能算法在重载里面。哎,有错了一题。

第二个面试官面的是括号的匹配。用个栈做应该对的,看到左括号入栈,右括号出栈,如果看到右括号时栈为空则错误,如果最后结束了栈不空错误。
用链表写个栈。说下优先队列的构成,堆的复杂度,特点。二分查找的测试用例。不懂,看来对二分查找还是没有深入了解,下面两个是二分查找的相关资料。
http://blog.csdn.net/drzhouweiming/article/details/1562717
http://blog.163.com/zl_dream1106/blog/static/84286020105295433915/

最后个面试官是俞洁,她基本上都是聊天,说sam给我说了很多好话,呵呵。聊了很多英文,聊了些工作,职业发展,学校,爱好,对emc的了解,team等等。
总体上发挥还行,有几道题目做的不是很好,希望能够进吧。


2011.10.23:思科笔试。
思科的笔试很无语,我竟然是system engineer的职位,竟然考的是java而不是c/c++,我太无语了,题目除了第一部分的unix/linux外,都不是我擅长的,有网络,都是路由方面的,有java不是很熟,有云计算的简单概念。不知道怎么搞的,反正放弃了。

有几个和linux相关的题目:
well known port是放在/etc/services 下的。

在某个时间允许程序可以用at命令。

mount时加上noauto表示不能自动挂载,需要explicitly mount。

/etc/host.deny 表示禁止的ip地址。

linux中文件默认的权限是0666,如果umask是022那么默认权限变成了0644

列出当前文件夹中所有文件,包括子文件夹里面的:find . 或者 ls -aR .

文件夹的rwx的说明:r表示可以列出文件夹中的目录项。x表示shell的路径中可以进入文件夹的目录中,即可以访问目录(cd可以进入,但让不能ls。)。w的话是要写了,那样必须先有x权限,因为先要能够进入这个文件夹。
简单的说如果仅仅要执行文件夹下的某个可执行文件,那么只要有x权限即可。如果要ls文件夹下面的目录项,那么需要r权限。需要写文件,那么需要wx权限。
具体说明见:http://blog.csdn.net/cb_121/article/details/4312876

update on 2011.11.28:
一共投了不知道多少简历。
笔试:intel,淘宝,腾讯,百度,google,微软,emc,思科,中兴
面试:oracle,intel,淘宝,腾讯,百度,微软,emc,中兴,华为,百姓网
被据:淘宝(二面),腾讯(一面),google(笔试),百姓网(二面),微软(一面)
offer:oracle,intel, 百度,emc,华为。
面试没去的:marvell(成都职位),摩根。

被据原因:
淘宝:二面海量数据不懂,直接被bs。
腾讯:一面不难,不知道为什么被据
google:笔试被据,不是很难,但是估计得全对才行。水平不够
百姓网:业务不是特别对口,做网站不擅长。

微软:那次面试谈乱了,一直想着百度的电话,面的不好。


offer原因:
oracle有车的内部推荐,方便很多,而且确实不是特别的难。
intel:只要是c/c++的考试成绩比较好,面试不是特别难,没有做什么题目,加上运气也不错,口头offer。

EMC:在里面实习过,可能sam帮我说了很多好话,如果没有实习过估计也没戏,不过面试确实不怎么难。

华为:貌似只要还行华为都要

百度:意料之外的offer,开始找工作完全没想到去百度,去百度面试是我所有面试中发挥最好的,可以说超长发挥了。可以说百度激发了我的潜能。

面试没去的:marvell(成都职位),摩根。
marvell是成都的,有点没够成熟,明知道自己不会去成都还投成都,有点不好。而且回复了面试短信又不去,做的很差劲。以后不能这样,要果断点。
摩根:摩根确实有点过了,只是不投不爽,但是真的让我去面试,明知道不可能进得地方,我就不想去面了。发了邮件说时间问题去不了,hr说能换时间,但是没下文了。这种公司以后还是不要投了。明智点。

后来有参加了摩根的店面,他又让我去onsite的面试,不想去了,摩根不适合我。

总结:外企看重人的基础,综合素质,英语,更加看重一个人的潜力,而不是现在能做什么。
民企看重人的实际能力,更像是社招,需要有相关背景的多些,比如淘宝,百姓网,腾讯等。


最终offer选择:

外企:INTEL,ORACLE,IBM,EMC。四个典型的外企,只选择了emc,因为其他三个太大,大老了,不够有活力,而且EMC的发展趋势好。

民企:百度,华为。华为就不考虑了,只是玩玩的。百度很好。

最终在百度和emc之间纠结,一个外企,一个民企,风格完全不同,发展路线也不同,都是很好的公司,从企业文化,发展前景,国际化氛围,emc更好,但是我觉得emc不适合我,因为我喜欢能够学习更多的技术,有更多的机会参与的项目中,能够更快的成长,这点民企可能更适合我,虽然可能会很累,要经常加班,性价比和emc没的比,而且外语也可能不用了,但是我还是选择了百度,因为我只是简单的认为年轻时应该去百度看看,去百度锻炼下,可能我现在的想法不是很成熟,但是我会努力。