s***n 发帖数: 373 | 1 phone interview.
投的Software Development Intern
coordinator说要prepare to respond to behavioral questions.
会有什么behavioral问题呢?
|
p*****i 发帖数: 197 | 2 上次来我学校听同学说好像就两道coding 题:
1. find the depth of a tree
2. check whether a linked list is circular or not. |
n**4 发帖数: 719 | 3 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;
} |
m*****y 发帖数: 93 | 4 why ms
which product of ms do you like? why?
what's your biggest challenge
how to test a keyboard
【在 s***n 的大作中提到】 : phone interview. : 投的Software Development Intern : coordinator说要prepare to respond to behavioral questions. : 会有什么behavioral问题呢? :
|