求職經歷

求職記錄:

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沒的比,而且外語也可能不用了,但是我還是選擇了百度,因爲我只是簡單的認爲年輕時應該去百度看看,去百度鍛鍊下,可能我現在的想法不是很成熟,但是我會努力。

發佈了81 篇原創文章 · 獲贊 22 · 訪問量 36萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章