Re: 美校滥招生:读博的悲剧 (转载)# Joke - 肚皮舞运动
k*t
1 楼
题目其实很简单,自己摆乌龙了。细节如下。
虽然连on-site都没拿到,个人感觉,作为第一次电面,基本达到操练面试的目的。自
我介绍,项目表达要言简意赅。Coding要冷静,不紧张,确保看清题目,自我检查code
要细。
与大家分享面经/经历。也希望大家给comment。Code是我从collabedit上直接贴过来的
。欢迎comment,帮我提高。谢谢。
一电面:老美。
前半部分是简历上Performance Tuning的各种Projects的细节;
后半部分是Website Performance的各种问题。
基本对答如流,获面试人认同。并说我们网站增长快,急需你这样有Performance方面
经验的人。Highly recommend for the next step.
二电面:老印。题目其实很简单,自己摆乌龙了。
开始讲Projects,老印问了一个简历上Resource Leakage Finding的东西。
回答不够简洁清晰,偏冗长。老印试图澄清,最后彻底澄清。花了一些时间。
后半个小时,两道Coding题:
1。判断string是否数字?如1.2。并写TestCase。
用C写了一个,处理了前缀space/tab, 负号'-',小数点'.'和正常数字;
面试人让我边walk through了边写code;
然后我给出大约8类test case, 最后一个是对程序中每个if/else的每种分支都产
生一个test case去cover。
面试人给了个test case让我walk through code, "1 a"。
被点出一个乌龙:判断数字时&&写成了||,a[i] <= '0' || a[i]>='9'。但面试人说,"
Your test case will catch it."。听似友好。
自己看到middle/ending space/tab没有处理,就加了处理的三四行。
面试人又让处理'e',比如2e20表示2x10^20。我看时间可能不够,就加了个第一次e的
判断,并递归调用原函数。然后说,不能全部cover,但再加些限制即可。
2。面试人开始问第二道题。reverse words in a string。
乌龙二:他本意是“hello world" ==> "world hello",我以为是“hello world"==〉
"olleh dlrow"。迅速用C写了程序。
面试人说coding问题结束再来一个网站性能测试题。(我在面试结束后,才看到面试人
在collabedit有给出题目和“world hello"的例子。给recruiter发了个email,说明情
况,并说在我的程序上再加一行,先reverse整个字串,即可。recruiter回复说会把
email加到review notes上。)
网站测试问题是:如何测网站性能?我从没测过网站,这时只有几分钟了,我说可以
measure page view latency,可以在client端fork许多threads测并行处理性能等等。
面试人说,如果latency明显偏小,比如5ms,首先检查什么?我说有可能是cache了,
或者结果测试程序或数据统计程序有问题,给出错的结果。他说,首先看什么?我无语
。(man, 可以看的东西很多:))他说,Don't you have to first check whether the
returned page is correct/valid?
让我问了一个问题即平淡结束。面试人说nice to talk to you。感觉不好。
三天后,收到据信。
附据信:
=====================================================================
Hi XYZ: thanks so much for taking the time to interview with us. Although
the interview team felt you had great skills and experience, they've
decided to continue to interview additional candidates who will more closely
match their requirements. So at this point, we won't be moving further
with your candidacy.
Please don't take this as a reflection of your expertise, but rather an
indication of our business needs. I will, however, keep your file active
and consider you for any additional positions.
I wish you success in your job search.
===================================================
//1.2
// -, ., number
bool isNumber (char *in, int n) {
bool isSign=false, isDot=false;
// skip spaces/tab in the beginning of the string
int first = 0;
if (!in) return false;
while (in && in[first] && (in[first]==' ' || in[first]=='\t')) ++first;
if (!in[first]) return false;
for (int i = first; i < n; ++i ) {
if (in[i]=='-' && i==first) continue;
if (in[i]=='.') {
if (isDot) return false;
else isDot=true;
continue;
}
if (in[i]>='0' && in[i]<='9')
continue;
if (in[i]==' ' || in[i]=='\t') {
while (in[i]) {
if (in[i]!='\t' && in[i]!=' ')
return false;
else i++;
return true;
}
if (in[i]=='e') {
return isNumber(in+i+1, n-i); // incomplete
}
return false;
}
return true;
}
// test case;
1, null string;
2, integer: with/without non-number
3, negative numbers: multiple negative signs
4. decimal: multiple dots
5. float with e: multipe e
6. heading/trailing spaces
7. spaces in the middle
8. null input string pointer, diff from 1
9. all same number: 1111111, 999999
10. for each condition in if/while, make sure every branch is executed
Reverse the order of words in a string; for example, "hello, world" should
be transformed to "world hello,".
void revword (char *s, char *e) {
while (s char t = *s;
*s=*e;
*e=t;
s++; e--;
}
}
void reverse (char *in) {
char *p, *q;
if (!in || !in[0]) return;
revword(in, in+strlen(in)-1); // the only line to add in my original
answer <=============
p = 0; q=p;
while (in[p]) {
if (in[p]==' ') {
p++;
continue;
}
q=p+1;
while(in[q] && in[q]!=' ') q++;
revword (p, q-1);
p = q+1;
}
}
虽然连on-site都没拿到,个人感觉,作为第一次电面,基本达到操练面试的目的。自
我介绍,项目表达要言简意赅。Coding要冷静,不紧张,确保看清题目,自我检查code
要细。
与大家分享面经/经历。也希望大家给comment。Code是我从collabedit上直接贴过来的
。欢迎comment,帮我提高。谢谢。
一电面:老美。
前半部分是简历上Performance Tuning的各种Projects的细节;
后半部分是Website Performance的各种问题。
基本对答如流,获面试人认同。并说我们网站增长快,急需你这样有Performance方面
经验的人。Highly recommend for the next step.
二电面:老印。题目其实很简单,自己摆乌龙了。
开始讲Projects,老印问了一个简历上Resource Leakage Finding的东西。
回答不够简洁清晰,偏冗长。老印试图澄清,最后彻底澄清。花了一些时间。
后半个小时,两道Coding题:
1。判断string是否数字?如1.2。并写TestCase。
用C写了一个,处理了前缀space/tab, 负号'-',小数点'.'和正常数字;
面试人让我边walk through了边写code;
然后我给出大约8类test case, 最后一个是对程序中每个if/else的每种分支都产
生一个test case去cover。
面试人给了个test case让我walk through code, "1 a"。
被点出一个乌龙:判断数字时&&写成了||,a[i] <= '0' || a[i]>='9'。但面试人说,"
Your test case will catch it."。听似友好。
自己看到middle/ending space/tab没有处理,就加了处理的三四行。
面试人又让处理'e',比如2e20表示2x10^20。我看时间可能不够,就加了个第一次e的
判断,并递归调用原函数。然后说,不能全部cover,但再加些限制即可。
2。面试人开始问第二道题。reverse words in a string。
乌龙二:他本意是“hello world" ==> "world hello",我以为是“hello world"==〉
"olleh dlrow"。迅速用C写了程序。
面试人说coding问题结束再来一个网站性能测试题。(我在面试结束后,才看到面试人
在collabedit有给出题目和“world hello"的例子。给recruiter发了个email,说明情
况,并说在我的程序上再加一行,先reverse整个字串,即可。recruiter回复说会把
email加到review notes上。)
网站测试问题是:如何测网站性能?我从没测过网站,这时只有几分钟了,我说可以
measure page view latency,可以在client端fork许多threads测并行处理性能等等。
面试人说,如果latency明显偏小,比如5ms,首先检查什么?我说有可能是cache了,
或者结果测试程序或数据统计程序有问题,给出错的结果。他说,首先看什么?我无语
。(man, 可以看的东西很多:))他说,Don't you have to first check whether the
returned page is correct/valid?
让我问了一个问题即平淡结束。面试人说nice to talk to you。感觉不好。
三天后,收到据信。
附据信:
=====================================================================
Hi XYZ: thanks so much for taking the time to interview with us. Although
the interview team felt you had great skills and experience, they've
decided to continue to interview additional candidates who will more closely
match their requirements. So at this point, we won't be moving further
with your candidacy.
Please don't take this as a reflection of your expertise, but rather an
indication of our business needs. I will, however, keep your file active
and consider you for any additional positions.
I wish you success in your job search.
===================================================
//1.2
// -, ., number
bool isNumber (char *in, int n) {
bool isSign=false, isDot=false;
// skip spaces/tab in the beginning of the string
int first = 0;
if (!in) return false;
while (in && in[first] && (in[first]==' ' || in[first]=='\t')) ++first;
if (!in[first]) return false;
for (int i = first; i < n; ++i ) {
if (in[i]=='-' && i==first) continue;
if (in[i]=='.') {
if (isDot) return false;
else isDot=true;
continue;
}
if (in[i]>='0' && in[i]<='9')
continue;
if (in[i]==' ' || in[i]=='\t') {
while (in[i]) {
if (in[i]!='\t' && in[i]!=' ')
return false;
else i++;
return true;
}
if (in[i]=='e') {
return isNumber(in+i+1, n-i); // incomplete
}
return false;
}
return true;
}
// test case;
1, null string;
2, integer: with/without non-number
3, negative numbers: multiple negative signs
4. decimal: multiple dots
5. float with e: multipe e
6. heading/trailing spaces
7. spaces in the middle
8. null input string pointer, diff from 1
9. all same number: 1111111, 999999
10. for each condition in if/while, make sure every branch is executed
Reverse the order of words in a string; for example, "hello, world" should
be transformed to "world hello,".
void revword (char *s, char *e) {
while (s
*s=*e;
*e=t;
s++; e--;
}
}
void reverse (char *in) {
char *p, *q;
if (!in || !in[0]) return;
revword(in, in+strlen(in)-1); // the only line to add in my original
answer <=============
p = 0; q=p;
while (in[p]) {
if (in[p]==' ') {
p++;
continue;
}
q=p+1;
while(in[q] && in[q]!=' ') q++;
revword (p, q-1);
p = q+1;
}
}