面试经历 · 投稿记录

美团 · 客户端开发 · 校招 · 一面/二面 · 2023-12-03面经

美团客户端 一面 二面 面筋

美团 一面

实习:

  1. 日志库的替换是自己的想的吗,为什么会加快这么多
  2. 为什么使用protobuf作为压缩选择
  3. protobuf压缩的原理是什么

八股

  1. 线程和协程
  2. 进程通信的方式是什么
  3. 线程通信的方式是什么
  4. 死锁的条件是什么
  5. tcp和udp的差异
  6. HTTP中get和post的差异
  7. http如何实现断点续传,如果这个时候客户端收到一般就结束了的话
  8. https可以被中间人劫持吗
  9. C++源码到可执行文件
  10. 动态链接和静态链接
  11. 指针和引用的区别
  12. vector的扩容原理
  13. 如何在高德地图、美团地图、百度地图来回切换

代码题:

const int a;
int const a;
const int* a;
int* const a;
// 这些差别是什么
int *a;
float *b;
float c;
long long d;
// 这些sizeof是多少
struct A{
	int* a;
    char b[10];
    int c;
    float d
};
// 这个sizeof是多少
char *s[3][5] = {"a","c","grea"};
// sizeof(s)的大小是什么
#include <iostream>
using namespace std;

class Base { public: // virtual void makesound() { // cout << "Base is asking" << endl; // }

void makesound() {
    cout &lt;&lt; &quot;Base is asking&quot; &lt;&lt; endl;
}

};

class Derive : public Base { public: void makesound() { cout << "Derive is asking" << endl; } };

int main() { Base* b = new Derive(); b->makesound(); delete b; // Don't forget to release the allocated memory }

美团 地图 二面
  • 写一下拷贝构造函数
  • 写一下单例类

题外话:还是第一次这样考C++基础的,不错

正在加载讨论…