c*********e 发帖数: 252 | 1 第一个面试官是个中国人,女的。
开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。
编程题
given a character string, print the number of occurence of each charcater in
order. ie. if the string is "ceabcw", then you should print something like:
a 1 b 1 c2 e 1 w 1.
she asked the possible data strucutre to approach. I gave array, hashtable,
and BST. she asked me to use BST, and using no recursive. Also how to handle unicode.
然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也
觉得基本没戏了。
第二个是个印度人。编程题:
given a mat |
g*********n 发帖数: 441 | |
g*******y 发帖数: 1930 | |
N*D 发帖数: 3641 | 4 第一题BST怎么弄?array就完了,a-z的话就是O(26)space,算上A-Z就是O(52),ascii
做相应扩展,Unicode就用Hash,BST是没法做,她存心刁难你呢,当然你给了她机会。
二三也是正常题目倒看不出刁难的地方来。
Bless。。。
第一个面试官是个中国人,女的。
开始想同她套套近乎,也不知道是不是套错了,反正感觉她不喜欢我。
编程题
given a character string, print the number of occurence of each charcater in
order. ie. if the string is "ceabcw", then you should print something like:
a 1 b 1 c2 e 1 w 1.
she asked the possible data strucutre to approach. I gave array, hashtable,
and BST. she asked me to use BST, and using no recursive. I tried a
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
c*********e 发帖数: 252 | 5 BST应该也可以做的,就是很麻烦,用递归也挺麻烦。主要她一直追问,所以我说了。
谁给解答一下overflow怎么处理?
this interview is fte, currently work as contractor |
w********p 发帖数: 948 | 6 是google面试吗?
如果是,难度算合理。 不然的话,呵呵
第三题,如果是top公司的话,没考虑overflow就算白做了。它的关键是 overflow的处
理。
我也fail在这题上了。不过当时我是昏头了。因为平时工作中,经常做的。
牛牛们注意了,一般上来就用难题招呼的,基本上是看你不顺眼。
我也找死过一次,在某不大的公司英语不佳的面试人骄傲的样子。结果别人就用我从没
听没见过的题招呼我,惨败。不过当时也没太准备。
和面试官不用套近乎,用同事或下属的身份和他交流就好了。
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
g*******y 发帖数: 1930 | 7 检测OF还是很容易的,我校园面试遇到过,思想不外乎就是用已知最大的正数(MAX_INT
)对某个可能产生OF的运算做个逆运算,然后比较大小。
BST那个我觉得你该指出复杂度,明显不如hash类的方法。另外,一个不考虑平衡的BST
,要实现search/insert也不难啊?实现一个非递归的traversal也是标准难度的面试题。
。感觉她
【在 c*********e 的大作中提到】 : BST应该也可以做的,就是很麻烦,用递归也挺麻烦。主要她一直追问,所以我说了。 : 谁给解答一下overflow怎么处理? : this interview is fte, currently work as contractor
|
c*********e 发帖数: 252 | 8 呵呵呵,是微软。我也没有想到一上来就这么麻烦的,所以很受打击。
【在 w********p 的大作中提到】 : 是google面试吗? : 如果是,难度算合理。 不然的话,呵呵 : 第三题,如果是top公司的话,没考虑overflow就算白做了。它的关键是 overflow的处 : 理。 : 我也fail在这题上了。不过当时我是昏头了。因为平时工作中,经常做的。 : 牛牛们注意了,一般上来就用难题招呼的,基本上是看你不顺眼。 : 我也找死过一次,在某不大的公司英语不佳的面试人骄傲的样子。结果别人就用我从没 : 听没见过的题招呼我,惨败。不过当时也没太准备。 : 和面试官不用套近乎,用同事或下属的身份和他交流就好了。 :
|
c*********e 发帖数: 252 | 9 好像不是。面试官提到过一个名词,好像是float maths什么的,说实话我的基本功可
能差点。另外那个BST非递归她要求不用额外内存。
如果用递归可以做的,但是还是有点麻烦的,而且开始纠缠半天时间不够了。我基本做
出来了,但是她说时间不够了。
INT
BST
题。
【在 g*******y 的大作中提到】 : 检测OF还是很容易的,我校园面试遇到过,思想不外乎就是用已知最大的正数(MAX_INT : )对某个可能产生OF的运算做个逆运算,然后比较大小。 : BST那个我觉得你该指出复杂度,明显不如hash类的方法。另外,一个不考虑平衡的BST : ,要实现search/insert也不难啊?实现一个非递归的traversal也是标准难度的面试题。 : : 。感觉她
|
c*********e 发帖数: 252 | 10 关于Unicode就用Hash,这个如果要求按顺序打印如何处理呢?
ascii
in
like:
【在 N*D 的大作中提到】 : 第一题BST怎么弄?array就完了,a-z的话就是O(26)space,算上A-Z就是O(52),ascii : 做相应扩展,Unicode就用Hash,BST是没法做,她存心刁难你呢,当然你给了她机会。 : 二三也是正常题目倒看不出刁难的地方来。 : Bless。。。 : : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正感觉她不喜欢我。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like:
|
|
|
g*******y 发帖数: 1930 | 11 不是?我微软校园面试的时候,那个面试官confirm了说这个方法detect OF是对的啊。
BST非递归traversal还不能用额外内存,看来你只有往node里面上附加额外信息了(
parent pointer etc)。
【在 c*********e 的大作中提到】 : 好像不是。面试官提到过一个名词,好像是float maths什么的,说实话我的基本功可 : 能差点。另外那个BST非递归她要求不用额外内存。 : 如果用递归可以做的,但是还是有点麻烦的,而且开始纠缠半天时间不够了。我基本做 : 出来了,但是她说时间不够了。 : : INT : BST : 题。
|
w********p 发帖数: 948 | 12 detect OF 的方法是open的,不必非的哪种。只要对就ok
geniusxsy 的方法是对的。
搂主的面试,有点像越考越简单,不是好的sign.
好的面试大体上应是越考越难
【在 g*******y 的大作中提到】 : 不是?我微软校园面试的时候,那个面试官confirm了说这个方法detect OF是对的啊。 : BST非递归traversal还不能用额外内存,看来你只有往node里面上附加额外信息了( : parent pointer etc)。
|
H*M 发帖数: 1268 | 13 u guys 详细说说那个detect overflow的方法?link?
overflow一直是我一块心病,总想着什么时候搞一下,今天终于碰到关于这得题目了。
还有什么signed, unsigned, size_t之类的。我老是不知道什么时候该用什么(一般用
int)。compile的`时候总是有warning。
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
H*M 发帖数: 1268 | 14 第一题怎么用bst呢? 不是很明显array么?
bitmap?没用过,可以不可以assume是int**, 或者vector>?这个打印on不
就是过一遍?有什么trick?
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
k***e 发帖数: 556 | 15 搂主是onsite interview?
第一题,非递归用个while加marknode就行了啊. 即使不能mark也还在版面上讨论过
第三题是说检测overflow还是处理任意常输入?不然要自己搞了vector实现基本算术
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
m*****f 发帖数: 1243 | 16 我对这题有点不明白
given a matrix(assume it is a bitmap), print all cells that is on.
是用一个map存储1的个数然后一个byte一个byte的读入吗? |
B*****g 发帖数: 34098 | 17 赞贴题
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
a****l 发帖数: 8211 | 18 overflow有什么难处理的?32/64/128位,计算机能算的就能算,超过了某数就不能算,除
非你自己实现大数的计算.也就是多加一个if.当然,这个if怎么加倒是很可以讨论的.
【在 w********p 的大作中提到】 : 是google面试吗? : 如果是,难度算合理。 不然的话,呵呵 : 第三题,如果是top公司的话,没考虑overflow就算白做了。它的关键是 overflow的处 : 理。 : 我也fail在这题上了。不过当时我是昏头了。因为平时工作中,经常做的。 : 牛牛们注意了,一般上来就用难题招呼的,基本上是看你不顺眼。 : 我也找死过一次,在某不大的公司英语不佳的面试人骄傲的样子。结果别人就用我从没 : 听没见过的题招呼我,惨败。不过当时也没太准备。 : 和面试官不用套近乎,用同事或下属的身份和他交流就好了。 :
|
v****s 发帖数: 1112 | 19 第一题如果字母都是ascii,用一个 counter[currentchar - 'a']++ 不就可以了么?
复杂度为O(N).为啥要bst?解释一下谢谢!
另外,怎么处理OF? 是不是
if( tmp >= MAX_INT ) { return;}
谢谢share 题目!
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
M******g 发帖数: 1179 | 20 bless
you still have chance.
bles us all by the way
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
|
|
c*********e 发帖数: 252 | 21 requested by the interviewer
【在 v****s 的大作中提到】 : 第一题如果字母都是ascii,用一个 counter[currentchar - 'a']++ 不就可以了么? : 复杂度为O(N).为啥要bst?解释一下谢谢! : 另外,怎么处理OF? 是不是 : if( tmp >= MAX_INT ) { return;} : 谢谢share 题目! : : in : like: : , : guys
|
c*********e 发帖数: 252 | 22 多谢,但是第一轮下来我就知道没戏了
【在 M******g 的大作中提到】 : bless : you still have chance. : bles us all by the way : : in : like: : , : guys
|
l*o 发帖数: 117 | 23 第一题如果是char range太大不能用array,用C++的map就可以吧。数据自动按key排序
。最后顺序打印map就行了。map实现了BST,没必要自己写。
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
l**********r 发帖数: 335 | 24 list the name here so we all know who the f.. is that.
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
d********e 发帖数: 132 | 25
INT
能详细展开说一下这个检测OF的方法吗?Thx.
【在 g*******y 的大作中提到】 : 检测OF还是很容易的,我校园面试遇到过,思想不外乎就是用已知最大的正数(MAX_INT : )对某个可能产生OF的运算做个逆运算,然后比较大小。 : BST那个我觉得你该指出复杂度,明显不如hash类的方法。另外,一个不考虑平衡的BST : ,要实现search/insert也不难啊?实现一个非递归的traversal也是标准难度的面试题。 : : 。感觉她
|
c*********e 发帖数: 252 | 26 有人说第一个面试官最不重要,我现在觉得第一个面试官最重要。因为他决定了你的基
调。其实后面2个题目都不难,但是受了打击后自己的思维好像就不对了,态度也变得
比较消极。 |
c*********e 发帖数: 252 | 27 谁说一下不用extra memory, no using recursion, how to insert a node
to a BST? |
r***e 发帖数: 21 | 28 多谢分享面经,其实面试感觉不好,也不一定结果不好,继续加油啦。
不考虑树的平衡,贴个简陋的伪代码,欢迎拍砖,
// 返回root节点指针
Node *insert_BST(Node *pT, Node *pInserted) {
Node *p1 = pT;
Node *p2 = 0;
while( p1 ) {
p2 = p1;
if ( pInserted->key < p1->key )
p1 = p1->leftChild;
else
p1 = p1->rightChild;
}
// if Node has parent pointer
pInserted->parent = p2;
if ( !p2 ) { // empty tree
return pInserted;
} else {
if ( pInserted->key < p2->key )
p2->leftChild = pInserted;
else
p2->rightChild =
【在 c*********e 的大作中提到】 : 谁说一下不用extra memory, no using recursion, how to insert a node : to a BST?
|
p*******e 发帖数: 763 | 29 祝福
回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉错误)。
in
like:
,
guys
【在 c*********e 的大作中提到】 : 第一个面试官是个中国人,女的。 : 开始想同她套套近乎,也不知道是不是套错了,反正当时感觉她不喜欢我(其实后来回头想想,可能不是她不喜欢我,她就是那样说话的态度,是我感觉不对)。 : 编程题 : given a character string, print the number of occurence of each charcater in : order. ie. if the string is "ceabcw", then you should print something like: : a 1 b 1 c2 e 1 w 1. : she asked the possible data strucutre to approach. I gave array, hashtable, : and BST. she asked me to use BST, and using no recursive. Also how to handle unicode. : 然后问了一些测试题,让我测试她们的一个产品。细节忘了,总之她对我不满意。我也 : 觉得基本没戏了。
|
b******n 发帖数: 552 | 30 作为MSFT interview第一题,你的表现决定后来interviewer出题的难度和方向。
bool InsertNodeToBST(TreeNode *root, int value)
{
TreeNode *p=root, *q;
while(p)
{
q=p;
if(valuedata)
p=p->left;
else if(value>p->data)
p=p->right;
else
{
cout<<"Found duplicate";
return false;
}
}
TreeNode *temp=new TreeNode();
temp->data=value;
temp->left=null;
temp->right=null;
if(!root) root=temp;
else
{
if(valuedata) q->left=temp;
else q->right=temp;
}
r
【在 c*********e 的大作中提到】 : 谁说一下不用extra memory, no using recursion, how to insert a node : to a BST?
|
|
|
u***i 发帖数: 489 | |
c*********n 发帖数: 1057 | 32
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~其实我一直不太理解这个的定义,变量总可以用吧?
【在 c*********e 的大作中提到】 : 谁说一下不用extra memory, no using recursion, how to insert a node : to a BST?
|
c*********n 发帖数: 1057 | 33 是不是还要处理下pInserted->key的值已经在tree里的情况?
【在 r***e 的大作中提到】 : 多谢分享面经,其实面试感觉不好,也不一定结果不好,继续加油啦。 : 不考虑树的平衡,贴个简陋的伪代码,欢迎拍砖, : // 返回root节点指针 : Node *insert_BST(Node *pT, Node *pInserted) { : Node *p1 = pT; : Node *p2 = 0; : while( p1 ) { : p2 = p1; : if ( pInserted->key < p1->key ) : p1 = p1->leftChild;
|
M*****0 发帖数: 850 | 34 Mark, running review when i have time |
w********p 发帖数: 948 | 35 搂主没有必要太介意。
1。面试本来就是你找喜欢的工作和环境,公司找他们喜欢的人。因为没有彼此认可,
而拿不到面试,是面试中非常常见的事。
2。 初次面试不中不是坏事,你可以,发现自己的很多缺点,从面试行为,自我个性,
准备方方面面,英语语言能力,展示能力,技术的每一个方面等等,不断的提高,自我
反省,不断努力会把你推到你更理想的工作上。 从搂主的表达来看有些方面还有成长
的空间。
3。任何人如果一次失败的面试的结论只是别人的不对的话,我会担心你遏制了自己提
高的可能。
赛翁失马,焉知非福 |
c*********e 发帖数: 252 | 36 多谢你的肺腑之言,受益匪浅,呵呵。
你说得很对,不管怎么还是我自己实力不够。的确从这次面试当中还是学到不少东西的。
【在 w********p 的大作中提到】 : 搂主没有必要太介意。 : 1。面试本来就是你找喜欢的工作和环境,公司找他们喜欢的人。因为没有彼此认可, : 而拿不到面试,是面试中非常常见的事。 : 2。 初次面试不中不是坏事,你可以,发现自己的很多缺点,从面试行为,自我个性, : 准备方方面面,英语语言能力,展示能力,技术的每一个方面等等,不断的提高,自我 : 反省,不断努力会把你推到你更理想的工作上。 从搂主的表达来看有些方面还有成长 : 的空间。 : 3。任何人如果一次失败的面试的结论只是别人的不对的话,我会担心你遏制了自己提 : 高的可能。 : 赛翁失马,焉知非福
|