Redian新闻
>
几个月前有人贴的化妆前后人像对照图在哪里?
avatar
几个月前有人贴的化妆前后人像对照图在哪里?# PhotoGear - 摄影器材
c*5
1
昨天刚面的,今天知道挂了。。。
第一轮: 实现一个简化版的boggle game,给定一个dictionary,我用dfs做的
第二轮:给一个int array, 不用division,replace each element with the
multiplication of all elements other than that element
第三轮:给一个method char[] read(int n),读入n个字符,输出到数组中,让实现一
个String readline(),字符流以null结尾
第四轮:实现method: int getNthPrime(int n),找出第n个质数,n从0开始,这题没
打好,想错了,用了sieve of eratosthenes.
唉,感觉面试时一旦想错了如果面试官不提示的话,就万劫不复了。。。
avatar
d*a
2
就是有个女生,自己化妆
avatar
c*5
3
赞下ebay的recruiter,效率很高,态度也很好~~

【在 c******5 的大作中提到】
: 昨天刚面的,今天知道挂了。。。
: 第一轮: 实现一个简化版的boggle game,给定一个dictionary,我用dfs做的
: 第二轮:给一个int array, 不用division,replace each element with the
: multiplication of all elements other than that element
: 第三轮:给一个method char[] read(int n),读入n个字符,输出到数组中,让实现一
: 个String readline(),字符流以null结尾
: 第四轮:实现method: int getNthPrime(int n),找出第n个质数,n从0开始,这题没
: 打好,想错了,用了sieve of eratosthenes.
: 唉,感觉面试时一旦想错了如果面试官不提示的话,就万劫不复了。。。

avatar
s*y
4
说原因了么
avatar
f*7
5
会有更好的 加油!

【在 s***y 的大作中提到】
: 说原因了么
avatar
p*p
6
感谢分享,ebay老印多么
avatar
j*y
7
bless
感觉后面两轮的题目都很难阿
那个实现 readline, 需要独到 换行符吧,读 read(1), read(2), read(4)..., 每个
读的过程中需要寻找换行符。
getNthPrime 面试官需要什么样的算法阿, brute force ?

【在 c******5 的大作中提到】
: 昨天刚面的,今天知道挂了。。。
: 第一轮: 实现一个简化版的boggle game,给定一个dictionary,我用dfs做的
: 第二轮:给一个int array, 不用division,replace each element with the
: multiplication of all elements other than that element
: 第三轮:给一个method char[] read(int n),读入n个字符,输出到数组中,让实现一
: 个String readline(),字符流以null结尾
: 第四轮:实现method: int getNthPrime(int n),找出第n个质数,n从0开始,这题没
: 打好,想错了,用了sieve of eratosthenes.
: 唉,感觉面试时一旦想错了如果面试官不提示的话,就万劫不复了。。。

avatar
c*5
8
我问了下 recruiter是这么答复的 “It was mixed feedback but some of the
interviewers had concerns regarding your CS fundamentals. Overall I feel
like you performed well but just not the right fit for this opening.”
我估计主要是最后一题做挂了 是一个年级挺大的美国人面的 感觉也没啥提示引导啥的
就让你写。。

【在 s***y 的大作中提到】
: 说原因了么
avatar
c*5
9
我感觉还行 两轮电话面试 四轮skype 就一个老印 其它啥国家都有 我面的是Redmond
那边的office 好多面试官都是MS挖过去的。。

【在 p*****p 的大作中提到】
: 感谢分享,ebay老印多么
avatar
c*5
10
我感觉还行 我两轮电话面试+4轮skype 一共好像就一个老印 其它感觉各国都有 比较
平均 我面的是Redmond的office 好像里面有好多MS挖过去的人

【在 p*****p 的大作中提到】
: 感谢分享,ebay老印多么
avatar
c*5
11
恩 好的 谢谢~~ ^_^

【在 f*******7 的大作中提到】
: 会有更好的 加油!
avatar
c*5
12
readline这题 他的意思好像是每次读固定一串字符 比如read(100) 然后再去判断
getNthPrime这题 我也不知道他想要啥答案 我想错了 结果他也没啥提示的感觉。。。

【在 j*****y 的大作中提到】
: bless
: 感觉后面两轮的题目都很难阿
: 那个实现 readline, 需要独到 换行符吧,读 read(1), read(2), read(4)..., 每个
: 读的过程中需要寻找换行符。
: getNthPrime 面试官需要什么样的算法阿, brute force ?

avatar
x*0
13
mark
avatar
s*u
14
挖个坟,这个readline的题目,搜了一下,好像应该是这个意思吧:
用一个buffer来存字符流,如果中间有换行,那么将这一行返回成一个字符串输出,但
是这个buffer里面的东西继续保留,下次readline()再输出;
如果一行非常长,那么可能需要用到几次read(),来拼出这个完整的line。
/*Implement a function char* readLine(); which returns single lines from a
buffer.
To read the buffer, you can makes use of a function int read(char* buf, int
len) which fills buf with upto len chars and returns the actual number of
chars filled in. Function readLine can be called as many times as desired.
If there is no valid data or newline terminated string available, it must
block. In order to block, it can use read function which in turn will block
when it doesn't have anything to fill the buf.
*/
#define MAX_LEN 4096
int read(char* buf, int len);
char *readLine(){

static bool EOF = false;
char *str = NULL;
int i, size = 0;

static int currentPos = MAX_LEN;

static char* buffer = new char[MAX_LEN];

while(!EOF || currentPos != MAX_LEN ){

// buffer is not empty, handle buffer first
if(currentPos != MAX_LEN){

for(i = currentPos; i < MAX_LEN; i++)
if( buffer[i] == '\0' || buffer[i] == '\n' ){
i++;
break;
}

int oldsize = (str == NULL)? 0: strlen(str);

//resize the size of str;
size += i - currentPos;
str = (char*) realloc(str,sizeof(char)*(size + 1));

//copy the buffer into str;
memcpy(s + oldsize,buffer + currentPos,i - currentPos);
str[size] = '\0';
currentPos = i;

if( buffer[i-1] == '\0' || buffer[i-1] == '\n' )
return str;
}else{

int size = read( buf, MAX_LEN);
currentPos = 0;
if( size < MAX_LEN )
EOF = 1;
}
}

return str;
}
avatar
z*8
15
找素数的能有什么好方法?
avatar
s*u
16
我自己写的:
list findNthPrime( int N ){
int prime = 2;
int num = 3;

list primes;
primes.push_back(2);

while( primes.size() < N){


for( listiterator:: it = primes.begin(); it != primes.end() &&
*it <= (int) sqrt( num ); it++ ){

if( num%(*it) == 0 ){
num += 2;
it = primes.begin();
}
}

primes.push_back(num);

num += 2;
}

return primes;
}

【在 z*********8 的大作中提到】
: 找素数的能有什么好方法?
avatar
D*d
17
find the n th prime without using divide or multiple: complexity O(n^2)
int getNthPrime(int n){// n should >= 1
vector Prime(1,2), MaxNumPrime(1,2);
int CurInt = 3;
while(Prime.size() < n){
bool IsPrime = true;
for(int i = 0; i < Prime.size(); ++i){
if(CurInt == MaxNumPrime[i] + Prime[i]){
MaxNumPrime[i] = CurInt;
IsPrime = false;
}
}
if(IsPrime){
Prime.push_back(CurInt);
MaxNumPrime.push_back(CurInt);
}
++CurInt;
}
return Prime.back();
}
avatar
h*3
18
楼主是什么专业的?
Recruiter不是已经说出来原因了吗?就是some of the interviewers had concerns
regarding your CS fundamentals.

【在 c******5 的大作中提到】
: 我问了下 recruiter是这么答复的 “It was mixed feedback but some of the
: interviewers had concerns regarding your CS fundamentals. Overall I feel
: like you performed well but just not the right fit for this opening.”
: 我估计主要是最后一题做挂了 是一个年级挺大的美国人面的 感觉也没啥提示引导啥的
: 就让你写。。

avatar
b*e
19
How about second question? take log use plus? This seems cheating.
avatar
z*8
20
calculate prefix product and suffix product for each index

【在 b*******e 的大作中提到】
: How about second question? take log use plus? This seems cheating.
avatar
b*e
21
got it..
avatar
J*a
22
extra space need to save prefix product and suffix product for each index?

【在 z*********8 的大作中提到】
: calculate prefix product and suffix product for each index
avatar
z*h
23
getNthPrime用sieve of eratoshenths真的错了吗?哪位牛牛给个正解?
avatar
l*h
24
这不是把所有的奇数都选进去了?
我看错了吗?

【在 D**********d 的大作中提到】
: find the n th prime without using divide or multiple: complexity O(n^2)
: int getNthPrime(int n){// n should >= 1
: vector Prime(1,2), MaxNumPrime(1,2);
: int CurInt = 3;
: while(Prime.size() < n){
: bool IsPrime = true;
: for(int i = 0; i < Prime.size(); ++i){
: if(CurInt == MaxNumPrime[i] + Prime[i]){
: MaxNumPrime[i] = CurInt;
: IsPrime = false;

avatar
S*6
25
多谢分享
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。