電話面試
1. muduo網絡庫 定時器的實現 (set,順便將了一下 runinloop函數)
2. read recv 函數區別 返回值為0 表示什么
3. tcp三次握手 為什么是三次不是二次 ? 四次揮手為什么是四次不是三次?
4. 閑聊
騰訊視頻面試
作為一個小渣渣記錄一下,騰是我一直想進的公司,但其實准備的時間不是很長,也不是科班還是存在很大的劣勢,記錄一下找工作的經歷。
首先說一下,這是我第一次視頻面試,還是蠻緊張的。不過面試官真的超好,不知道是不是因為我一面的面試官是個小姐姐的原因。
一面:
1.二分查找算法,有重復的值,返回最左邊的索引,不存在返回-1。這是我寫的代碼,面試官指出找到的時候while循環那里存在問題,那里也可以繼續二分查找。
#include <iostream>#include <vector>
#include <algorithm> using namespace std; int BinarySearch(vector<int>& nums,int ojb); int main() { vector<int> eg1{1,2,2,3,3,4,5,7}; cout<<endl; cout<<BinarySearch(eg1,1)<<endl; cout<<BinarySearch(eg1,2)<<endl; cout<<BinarySearch(eg1,3)<<endl; cout<<BinarySearch(eg1,4)<<endl; cout<<BinarySearch(eg1,5)<<endl; cout<<BinarySearch(eg1,6)<<endl; cout<<BinarySearch(eg1,7)<<endl; cout << "Hello World!" << endl; return 0; } int BinarySearch(vector<int>& nums,int ojb){ //empty too small too big if(nums.empty()) return -1; sort(nums.begin(),nums.end()); int len=nums.size(); if(ojb<nums[0]&&ojb>nums[len-1]) return -1; //binary search int left=0,right=len-1; while(left<=right){ int mid=(left+right)/2; if(nums[mid]==ojb){ while(mid>=0&&nums[mid]==ojb) mid--; return mid+1; }else if(nums[mid]<ojb){ left=mid+1; }else{ right=mid-1; } } return -1; }
/*改if(nums[mid]==ojb)
if(mid==0||nums[mid]!=nums[mid-1]){ return mid; }else{ right=mid-1; } }
2.智能指針(四種)
3.auto關鍵字
4.對c++多態的理解
5.tcp揮手 close_wait time_wait
6.阻塞非阻塞 同步異步的理解
7.cpu占用100% 如何檢查 gbd的使用命令,是否用它調試過多線程
總結:一緊張說話邏輯有點亂,還是說的東西感覺 除非了解它的人,明白我說的是什么。換個非技術人 可能根本不明白我說什么。總之很感謝小姐姐的耐心聽我講,她還跟我介紹了一下他們現在主要是做什么業務的。繼續加油。希望接下來好運。
電話面試:
1.介紹學習后台開發經歷,項目經歷,看過什么書
2. epoll模型中 LE/ET模式有什么區別 選擇哪一個?
3.瀏覽器中輸入https://www.qq.com 會發生什么
4.參加過什么開源項目。我只看過muduo的源碼,所以就扯了下這個。