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 | |
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...
|
|
|
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 | |
w*****1 发帖数: 245 | |