s*n
2 楼
phone interview.
投的Software Development Intern
coordinator说要prepare to respond to behavioral questions.
会有什么behavioral问题呢?
投的Software Development Intern
coordinator说要prepare to respond to behavioral questions.
会有什么behavioral问题呢?
p*i
4 楼
上次来我学校听同学说好像就两道coding 题:
1. find the depth of a tree
2. check whether a linked list is circular or not.
1. find the depth of a tree
2. check whether a linked list is circular or not.
n*4
5 楼
just a little practice
1) find the depth of a tree
struct node {
int val;
node * firstChild;
node * nextSibling;
}
int depth(node * tree) {
int maxDepth=0;
node * p;
if (tree==NULL) return 0;
p = tree->firstChild;
while (p) {
maxDepth = max(depth(p),maxDepth);
p=p->nextSibling;
}
return maxDepth;
}
// time complexity: O(N) N the node number of the tree
// space complexity: O(1)
2) check whether a linked list is circular or not.
struct node {
int val;
node * next;
}
bool detectCircular(node * list) {
node * p1=list, * p2=list;
if (!list || !list->next) return false;
while (p2->next) {
p1=p1->next;
p2=p2->next->next;
if (p1==p2) return true;
}
return false;
}
1) find the depth of a tree
struct node {
int val;
node * firstChild;
node * nextSibling;
}
int depth(node * tree) {
int maxDepth=0;
node * p;
if (tree==NULL) return 0;
p = tree->firstChild;
while (p) {
maxDepth = max(depth(p),maxDepth);
p=p->nextSibling;
}
return maxDepth;
}
// time complexity: O(N) N the node number of the tree
// space complexity: O(1)
2) check whether a linked list is circular or not.
struct node {
int val;
node * next;
}
bool detectCircular(node * list) {
node * p1=list, * p2=list;
if (!list || !list->next) return false;
while (p2->next) {
p1=p1->next;
p2=p2->next->next;
if (p1==p2) return true;
}
return false;
}
相关阅读
Re: 今天拿了ibm的offer对上司很媚的人对下属就很苛刻,这概率太高了狗家assistant组怎么样?为了不让面试官以貌取人,你得这么穿大妈请教一下前辈怎么有效刷题Lyft自动驾驶组内推(自己招人)老中在美国地位就是各种短板效应的集合在公司遭遇不平等对待了,不知如何抗议40左右做不到管理或专家,失业找不到工作了今天收了个特别随意的求reference的信G家拒了offer,以后需要重新面试吗又一个野鸡大学:硅谷科技大学倒下了M家的面试流程怎样的各种binary search的边界条件怎么确定的感觉今年h1b又凉了Exxonmobil 平均收入16万马工都是死活不愿意换单位的人密歇根州工作求内部推荐想集中看看,网上找的都是零零散散的offer比较:脸书vs苹果