公司了解
主要是做无人矿车的,面试邀请发的公司名称是北京慧拓智能有限公司,刚好慧拓也是做矿车相关的业务的,因此可能是慧拓的子公司。
笔试情况
这家公司的笔试题,不是在线做,在自己的电脑上离线做。是通过邮件发给了我,让24小时内回复啥时间参加面试。有点奇怪,而且面试也没问。面试时问了面试官,说让把做完的题发送给HR。
总体题目较为简单。先把题目以及自己的答案共享出来,由于水平有限,有错的地方,请大家指正。
1、考察动态规划。
题目描述:
一只猫 每天吃 1-3只 老鼠 求解 t天 吃 n 只老鼠 的最多吃法。
函数 CountRat():
Input:
int t: 时间 t 天内
int n: 吃 n 只老鼠
return:
int: 做多的吃法
具体代码
int CountRat(int t, int n)
{
vector<vector<int> > dp(n + 1 ,vector<int> (t + 1,0)); // dp[i][j] 表示 在j天 内 吃i只老鼠的最多方法
if (t > n ) return 0; // 猫要饿死。
if ((t == 1 && n <= 3)||(t == 2 && n ==2)||(t == 3)&&(n == 3)) return 1; // 特殊情况
if(t==2 && n==3) return 2;
for (int i = 1; i <= 3; ++i) {
dp[i][1] = 1;
}
dp[2][2] = 1;
dp[3][3] = 1;
dp[3][2] = 2;
for (int i = 3; i != n + 1; ++i) {
for (int j = 2; j != t + 1; ++j) {
dp[i][j] = dp[i - 1][j - 1] + dp[i - 2][j - 1] + dp[i - 3][j - 1];/* 递推公式 在j天吃i只老鼠的方法等于 j-1天吃i-1
+ j-1 吃 i-2 个 + j-1 天 吃 i-3个 种方法 */
}
}
return dp[n][t];
}
int main()
{
std::cout << CountRat(3, 5) << std::endl;
}
2、考察双指针
题目描述
//给你单链表的头节点 head ,请你反转链表,并返回反转后的链表。
//
//示例 1:
//输入:head = [1,2,3,4,5]
//输出:[5,4,3,2,1]
//
//示例 2:
//输入:head = [1,2]
//输出:[2,1]
//示例 3:
//
//输入:head = []
具体代码
采用了两种方法,最容易想到的方法以及双指针法
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(nullptr) {}
};
// 1 -> 2 -> 3 -> 4 -> 5
ListNode *RotateList_simple(ListNode *List) {
vector<int> temp;
while(List){
temp.push_back(List->val);
List = List->next;
}
int length = temp.size();
ListNode *tail = new ListNode(temp[temp.size()-1]);
ListNode *result = tail;
for (int i = length - 1 ; i != 0; --i ) { // 取不到0,所以 应该使用temp[i-1] 进行索引。
tail->next = new ListNode(temp[i-1]);
tail = tail->next;
}
return result;
}
ListNode *RotateList_double_pointers(ListNode *List){
ListNode *temp;
ListNode *cur = List;
ListNode *pre = NULL;
while(cur){
temp = cur->next; //保存cur 的下一个节点指针 ,因为后面改变了cur的指向。
cur->next = pre;
// 更新 pre,cur
pre = cur; // 当前节点保存成pre。
cur = temp; // 下一个节点保存成当前节点。
}
return pre;
}
int main()
{
ListNode *Head = new ListNode(1);
ListNode *ListTemp = Head;
ListTemp->next = new ListNode(2); ListTemp = ListTemp->next;
ListTemp->next = new ListNode(3); ListTemp = ListTemp->next;
ListTemp->next = new ListNode(4); ListTemp = ListTemp->next;
ListTemp->next = new ListNode(5); ListTemp = ListTemp->next;
//ListTemp = RotateList_double_pointers(Head);
ListTemp = RotateList_simple(Head);
while (ListTemp) {
cout << ListTemp->val << endl;
ListTemp = ListTemp->next;
}
}
3、考察C++基本知识
题目描述
// 获取英文文段中单词的数量,重复单词出现几次算几次,单词中只会出现’a’-‘z’和’A’-‘Z’
具体代码
//ASCII码 A-Z 65-90 a-z 97-122 0的ASCII为 48
int Words_Num(std::string str) {
int sum_word = 0;
for (int i = 0 ; i != str.size(); ++i){
int temp = str[i] - '0';
if((temp >= 17 && temp <= 42)||(temp >= 49 && temp <= 74)){
++sum_word;
}
}
return sum_word;
}
int main()
{
std::string strText = "In developing driver support systems, it is important to prevent the system from intervening with the driver in the middle of corrective action because the driver support system requires a cooperative operation between controllers and drivers.";
std::cout << Words_Num(strText) << std::endl;
}
面试情况
1、自我介绍
首先是自我介绍部分,根据我自己的简历,稍微说了一下,时间大概不到一分钟。
2、介绍项目
1) 本科毕设的Lattice算法是怎么做的呢?输入是啥?
2) 简要介绍一下Lattice的算法?
3) 在读研期间,是否将算法实际落地过?简要介绍。
4) 是否遇到过在采样过程中,出现轨迹结果不合理的情况,应当怎么进行修改?
5)在将SL坐标系转化到UTM大地坐标系的情况下,有没有遇到曲率爆炸的情况,是怎么解决的?
6)项目里面的全局规划是怎么做的?
7) 曲率的求解是怎么求的?
8)如何利用QP优化的全局路径,怎么构建的目标函数。
9)对C++了解么,有没有做过相关的项目?
10)有没有想了解的问题?
3、总结反思
1、需要多多关注 优化轨迹的曲率的相关方法。
2、 C++需要深入做一个项目,让自己更全面一点。
3、面试官没有对语言进行考察,也没有问语言相关的知识点,也没让自己手撕算法题,有点不太正常。
4、面试结果
挂掉了,原因不详,又可能自己做过的东西也都是非常老的,赶不上现在的潮流了,掌握的技术对公司来说,比较落后。
博主分享了在北京慧拓智能子公司笔试经历,涉及动态规划算法解决猫吃老鼠问题,双指针反转链表,以及C++基础知识测试。面试环节涵盖自我介绍、项目经验及技术挑战。最终反思技术更新的重要性。
320

被折叠的 条评论
为什么被折叠?



