騰訊PCG(後臺開發) 校招

電話面試ios

1.  muduo網絡庫 定時器的實現 (set,順便將了一下 runinloop函數)c++

2. read recv 函數區別 返回值爲0 表示什麼面試

3. tcp三次握手 爲何是三次不是二次 ? 四次揮手爲何是四次不是三次?算法

4. 閒聊瀏覽器

 

騰訊視頻面試網絡

做爲一個小渣渣記錄一下,騰是我一直想進的公司,但其實準備的時間不是很長,也不是科班仍是存在很大的劣勢,記錄一下找工做的經歷。多線程

 

首先說一下,這是我第一次視頻面試,仍是蠻緊張的。不過面試官真的超好,不知道是否是由於我一面的面試官是個小姐姐的緣由。異步

一面:tcp

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的源碼,因此就扯了下這個。

相關文章
相關標籤/搜索