由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Amazon 三次电面面筋
相关主题
GOOG ONSITE 面试construct tree with preorder and inorder
zenefit 电面面经Amazon 电面
这个rebuild binary tree的问题[leetcode] Maximum Depth of Binary Tree
树中序遍历,要求左子树用递归,右子树用iteration问tree的iterative traversal
攒人品,amazon一面经历serialize tree可否用in order或者post order
如何判断两个BST的元素是一样的?请较一道面世题
大牛帮我看看这哪错了? iterative inorder traversal时隔一年再次得到Amazon电面机会
Find the node with given value in binary tree in in-orderGoogle第二次电面
相关话题的讨论汇总
话题: tree话题: api话题: html话题: iter话题: istr
进入JobHunting版参与讨论
1 (共1页)
D****6
发帖数: 278
1
第一次:
why Amazon
why good fit
find the min in an array. (coding, read to him)
find the first k smallest in an array.
how to implement arraylist
explain consistent hashing, what is the disadvantage
sth about how to grep some information from a log file, don't remember
details
第二次:
design a generic tree API
design html classes. how to use the tree API to create html tree
regexp to grep phone numbers from files
what is overwriting, overloading, inheritance, delegation, interface
what needs improveme
s********l
发帖数: 998
2
bless lz~
"serialize and re-construct binary tree. (coding, read to him)"
这个是 给个binary tree 然后变成link list 然后再重建原来的binary tree?
D****6
发帖数: 278
3
变成string, 就是很standard的binary tree serialize to preorder and inorder
strings, then re-create the tree from them
对了, 你怎么投的apple的??
谢谢

【在 s********l 的大作中提到】
: bless lz~
: "serialize and re-construct binary tree. (coding, read to him)"
: 这个是 给个binary tree 然后变成link list 然后再重建原来的binary tree?

f*********5
发帖数: 576
4
your background is JAVA?
or the requirement of postion is JAVA

【在 D****6 的大作中提到】
: 第一次:
: why Amazon
: why good fit
: find the min in an array. (coding, read to him)
: find the first k smallest in an array.
: how to implement arraylist
: explain consistent hashing, what is the disadvantage
: sth about how to grep some information from a log file, don't remember
: details
: 第二次:

s*********s
发帖数: 318
5
多谢。祝早日拿到offer.
s********l
发帖数: 998
6
哦~ 这样子~
我就是本着 投了总比不投好的原则 网投的~
其实 我是想去apple做cs 结果他们面我ee...

【在 D****6 的大作中提到】
: 变成string, 就是很standard的binary tree serialize to preorder and inorder
: strings, then re-create the tree from them
: 对了, 你怎么投的apple的??
: 谢谢

j**l
发帖数: 2911
7
Cong~, 俺去年7月第一轮的电面的第二题就问了serialize binary tree, 当时准备不
充分,挂了。我告诉他可以用Preorder + Inorder, 迅速反问我如何编写代码,我只好
说我知道这个结论可行,但是想不起来具体怎么操作了。然后给了一个只适合存储完全
二叉树的一维数组方法(参考堆的一维数组表示法), 结果人家又听不大懂这个方法,又
问复杂度,我鬼使神差的说是O(2^h), h是平均高度,其实应该直接说O(n),人家又以为
我说成了指数复杂度...
于是第二天就是客气的拒信,显然认为我不行。
j**l
发帖数: 2911
8
我就写个很简洁的从前序和中序序列重建二叉树的代码吧,以飨版友。
TreeNode* rebuild(char *pstr, char *istr, int n)
{
if (n <= 0)
return NULL;
TreeNode* root = new TreeNode;
root->data = *pstr;
char* iter;
for (iter = istr; iter < istr + n; iter++)
if (*iter == *pstr)
break;
int k = iter - istr;
root->left = rebuild(pstr + 1, istr, k);
root->right = rebuild(pstr + k + 1, iter + 1, n - k - 1);
return root;
}

【在 D****6 的大作中提到】
: 第一次:
: why Amazon
: why good fit
: find the min in an array. (coding, read to him)
: find the first k smallest in an array.
: how to implement arraylist
: explain consistent hashing, what is the disadvantage
: sth about how to grep some information from a log file, don't remember
: details
: 第二次:

D****6
发帖数: 278
9
这个复杂度是nlogn吗?

【在 j**l 的大作中提到】
: 我就写个很简洁的从前序和中序序列重建二叉树的代码吧,以飨版友。
: TreeNode* rebuild(char *pstr, char *istr, int n)
: {
: if (n <= 0)
: return NULL;
: TreeNode* root = new TreeNode;
: root->data = *pstr;
: char* iter;
: for (iter = istr; iter < istr + n; iter++)
: if (*iter == *pstr)

D****6
发帖数: 278
10
一直没投apple,因为我从没用过mac, 心理没底

【在 s********l 的大作中提到】
: 哦~ 这样子~
: 我就是本着 投了总比不投好的原则 网投的~
: 其实 我是想去apple做cs 结果他们面我ee...

相关主题
如何判断两个BST的元素是一样的?construct tree with preorder and inorder
大牛帮我看看这哪错了? iterative inorder traversalAmazon 电面
Find the node with given value in binary tree in in-order[leetcode] Maximum Depth of Binary Tree
进入JobHunting版参与讨论
D****6
发帖数: 278
11
yes. background is Java

【在 f*********5 的大作中提到】
: your background is JAVA?
: or the requirement of postion is JAVA

D***h
发帖数: 183
12
bless!
design html classes. how to use the tree API to create html tree
谁给说说?

【在 D****6 的大作中提到】
: 第一次:
: why Amazon
: why good fit
: find the min in an array. (coding, read to him)
: find the first k smallest in an array.
: how to implement arraylist
: explain consistent hashing, what is the disadvantage
: sth about how to grep some information from a log file, don't remember
: details
: 第二次:

y*c
发帖数: 904
13

html<->tree is just an example of marshaling/demarshaling tree.
From html to tree, when we see a tag <, insert this tag as a child to the
current top of a stack S and then push this tag. When we see a tag the stack.
Tree to html, a traversal.
For the API, just need AddEdge(treenode* parent, treenode* child)?

【在 D***h 的大作中提到】
: bless!
: design html classes. how to use the tree API to create html tree
: 谁给说说?

c******f
发帖数: 2144
14
Thanks
w*****1
发帖数: 245
15
衷心祝楼主早日拿到offer! 哈哈!
1 (共1页)
进入JobHunting版参与讨论
相关主题
Google第二次电面攒人品,amazon一面经历
面试被三哥黑了,如何去complaint如何判断两个BST的元素是一样的?
也发一个 F,L,G 电面大牛帮我看看这哪错了? iterative inorder traversal
问一道算法题Find the node with given value in binary tree in in-order
GOOG ONSITE 面试construct tree with preorder and inorder
zenefit 电面面经Amazon 电面
这个rebuild binary tree的问题[leetcode] Maximum Depth of Binary Tree
树中序遍历,要求左子树用递归,右子树用iteration问tree的iterative traversal
相关话题的讨论汇总
话题: tree话题: api话题: html话题: iter话题: istr