之后面试也在此更新    背景       985本硕,slam研究方向,无论文,达摩院自动驾驶实习           投递时间       20210815    一面 20210827                             面试官准时到,总共面试时间一小时二十分钟,一面主要问基础知识                       C++                                                                          vector resize和reserve区别                                            返回值优化                                            缓存命中率                                            map 和 unordered map区别,空间很多时间很紧,选择哪一个                                            map里面[]和at有什么区别                                                                                   aMap是map类的对象,通过aMap[key]取值和通过aMap.at(key)取值的区别如下:                                                             aMap[key]如果key不存在会添加key,不会抛出异常;                               aMap.at(key)会检查key,如果不存在会抛出异常。                                                                               如果在vector中写一个第k小的元素,find_kth函数,该怎么构建?                                                                                   和快排思路很像,快排是怎么实现的?                                                                                                                             随机取一个值,然后左右指针遍历,比这个值大的放右边                                                                                                                         find_kth思路和快排很相似:                                                        这种方法时间复杂度是多少?                                                                                                                             O(2n)                                                                                                          多视图题目                                           对级线和对级点是什么关系?对级约束具体的物理意义是什么?                                            如果相机是平移运动,那么对级线是什么样子?                                                                                      视觉算法题                                           给出一个三角形的三个点的坐标,该三个点构建一个三角形,写一个函数,可以输出三角形内随机的一个点的位置。                                             解答:分解到两条边上random,然后两条边random系数之和小于1                                   代码题                          给定一个矩形的左下角坐标点以及右上角坐标点,同时给出圆圆心的位置以及半径,判断有没有重叠区域。                               bool Intersect(double x_bl, double y_bl, double x_tr, double y_tr, double xc, double yc, double r) {    // 获得矩形描述    double width = x_tr - x_bl;    double height = y_tr - y_bl;    double rect_mid_x = x_bl + width / 2;    double rect_mid_y = y_bl + height / 2;    // change circle center to First region    double new_xc, new_yc;    // 2 region    if(xc > rect_mid_x && yc < rect_mid_y){        new_xc = xc;        new_yc = yc + (rect_mid_y - yc) * 2;    }     else if (xc < rect_mid_x && yc < rect_mid_y){        new_xc = xc + (rect_mid_x - xc) * 2;        new_yc = yc + (rect_mid_y - yc) * 2;    }    else if (xc < rect_mid_x && yc > rect_mid_y) {        new_xc = xc + (rect_mid_x - xc) * 2;        new_yc = yc;    }    else {        new_xc = xc;        new_yc = yc;    }        // get distance;    double u = GetNearestDistance(x_tr - rect_mid_x, y_tr - rect_mid_y,                                  new_xc- rect_mid_x, new_yc - rect_mid_y);    if(u < r)        return true;        return false;    }double GetNearestDistance(double x, double y, double x_p, double y_p) {    double dx = x_p - x;    double dy = y_p - y;       double distance = sqrt(pow(max(dx, 0), 2) + pow(max(dy, 0)));    return distance;} https://www.zhihu.com/question/24251545/answer/27184960                                更新 20210905 问hr挂掉了 因为coding和c++不行
点赞 9
评论 4
全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务