贡献个facebook电话interview# JobHunting - 待字闺中
z*y
1 楼
前些日子面的,尽管code都写出来了 但那个面试官好像很不喜欢Java,我的code都用
Java写的
最后也没给下一轮
1) Locate a substring within a string. (Find the first occurance of
needle in haystack, or return null.)
char* strstr(char* haystack, char* needle) {
}
mention了一下KMP算法,然后用那个最直接的方法写的code. 他该不会是想让我把KMP
算法在interview里敲出来吧
2)/*
* Given an array and a value, remove all instances of that
* value in place and return the new length. The order of
* elements can be changed. It doesn't matter what you leave
* beyond the new length.
*/
size_t remove_elem(T* array, size_t len, T elem) {
}
这个题目他是想让用quick sort 类似的方法 从两头同时开始找,然后换,尽量减少交
换的次数
Java写的
最后也没给下一轮
1) Locate a substring within a string. (Find the first occurance of
needle in haystack, or return null.)
char* strstr(char* haystack, char* needle) {
}
mention了一下KMP算法,然后用那个最直接的方法写的code. 他该不会是想让我把KMP
算法在interview里敲出来吧
2)/*
* Given an array and a value, remove all instances of that
* value in place and return the new length. The order of
* elements can be changed. It doesn't matter what you leave
* beyond the new length.
*/
size_t remove_elem(T* array, size_t len, T elem) {
}
这个题目他是想让用quick sort 类似的方法 从两头同时开始找,然后换,尽量减少交
换的次数