由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - A家面试题
相关主题
刚刚结束的linkedIn电面面试的时候可以用STL吗
一道onsite面试题Implement an web-based dictionary lookup
请教 Iterator 一题Expedia Hiring for SQL Server Developer (转载)
求问一道G家的题我们公司在招聘 Software Implementation engineer (转载)
Bloomberg phone interview 面经面试题
c++问题[合集] google 面试题
请教一个C++的题目,谢谢刚刚的MS面试
question 2: o(1) euque and dequeue?Another Bloomberg Phone Interview
相关话题的讨论汇总
话题: knows话题: names话题: celebrity话题: string
进入JobHunting版参与讨论
1 (共1页)
l**h
发帖数: 893
1
做手机的那个A,希望对同胞们有用。
每次都是两个人一起面,总共五六组,所以总共要见十个还是十二个。记得的问题:
1. Find the lonely celebrity(celebrity: everyone knows him, he knows no one)
. Given a function boolean knows(A, B), which tells you if A knows B.
Implement function: List getLonelyCelebrity(Set names).
2. You got 2^40 positive 4 byte integers on disk, 16M memory, how to find
the first missing integer.
3. Implement the merge of multiple inputs. (I assumed each input implements
hasNext(), next())
4. Reverse a byte array, Reverse a char array (variant length char)
5. A row of hosts, from left to right, find a method to calculate the total
number of hosts. Each host can invoke: isLeft, isRight, sendToLeft,
sendToRight.
6. On cellphone keyboard, each number corresponds to several chars. Given a
list numbers, e.g. 1224668332, find the longest valid word (dict is given).
7. Reverse a list in Java, complexity?
8. design: a remote service+DB to keep top 100 scores for a game. It's a
single player game, and played on mobile device. Requirement: every time an
user starts to play, show the current top 100 scores.
9. design: java process同步的问题, 一堆write process,一开始write process要共
同agree一个数,比如100,那么就产生100个文件。完了之后一堆read process开始,去
consume这些文件。
10. 一个permutation相关的问题,记不得细节了
b******7
发帖数: 92
2
celebrity的题最近很常见啊,
社会名流算法,练习下
vector getLonelyCelebrity(vector names)
{
vector celebrities;
if(names.empty()) return celebrities;
int i = 0, j = names.size()-1;
while(i < j)
{
if(knows(names[i],names[j]))
i++;
else
j--;
}
//check if i-th person is a celebrity
//1.he knows no one
for(int k = 0; k < names.size(); k++)
{
if(k != i && knows(names[i],names[k]))
return celebrities;//
}
//2.everybody knows him
for(int k = 0; k < names.size(); k++)
{
if(k != i && !knows(names[k],names[i]))
return celebrities;
}
celebrities.push_back(names[i]);
return celebrities;
}
r*******e
发帖数: 7583
3
既然返回值是vector,celebrity可能不止一个
你的做法是默认一个吧

【在 b******7 的大作中提到】
: celebrity的题最近很常见啊,
: 社会名流算法,练习下
: vector getLonelyCelebrity(vector names)
: {
: vector celebrities;
: if(names.empty()) return celebrities;
: int i = 0, j = names.size()-1;
: while(i < j)
: {
: if(knows(names[i],names[j]))

x*******4
发帖数: 5
4
如果存在两个celebrity, 就与题目中要求(everyone knows him, he knows no one)
矛盾了

【在 r*******e 的大作中提到】
: 既然返回值是vector,celebrity可能不止一个
: 你的做法是默认一个吧

r*******e
发帖数: 7583
5
是的,默认应该是你这样理解
但是如果celebrity之间的关系不算的话,就不一样
只是觉得题目的返回值用vector有点奇怪

【在 x*******4 的大作中提到】
: 如果存在两个celebrity, 就与题目中要求(everyone knows him, he knows no one)
: 矛盾了

w******j
发帖数: 185
6
9怎么做? 什么pattern?
b******7
发帖数: 92
7
celebrity要么有一个,要么没有。给你这样的返回值可能是考察你是否想到这一点。

【在 r*******e 的大作中提到】
: 是的,默认应该是你这样理解
: 但是如果celebrity之间的关系不算的话,就不一样
: 只是觉得题目的返回值用vector有点奇怪

l*****a
发帖数: 14598
8
这个做手机的A还用java interview?

one)
implements

【在 l**h 的大作中提到】
: 做手机的那个A,希望对同胞们有用。
: 每次都是两个人一起面,总共五六组,所以总共要见十个还是十二个。记得的问题:
: 1. Find the lonely celebrity(celebrity: everyone knows him, he knows no one)
: . Given a function boolean knows(A, B), which tells you if A knows B.
: Implement function: List getLonelyCelebrity(Set names).
: 2. You got 2^40 positive 4 byte integers on disk, 16M memory, how to find
: the first missing integer.
: 3. Implement the merge of multiple inputs. (I assumed each input implements
: hasNext(), next())
: 4. Reverse a byte array, Reverse a char array (variant length char)

c*****a
发帖数: 808
9
2个人面,压力大啊
l**h
发帖数: 893
10
对, 是考点之一。

【在 b******7 的大作中提到】
: celebrity要么有一个,要么没有。给你这样的返回值可能是考察你是否想到这一点。
相关主题
c++问题面试的时候可以用STL吗
请教一个C++的题目,谢谢Implement an web-based dictionary lookup
question 2: o(1) euque and dequeue?Expedia Hiring for SQL Server Developer (转载)
进入JobHunting版参与讨论
l**h
发帖数: 893
11
他们service那一块的,几乎全是Java.

【在 l*****a 的大作中提到】
: 这个做手机的A还用java interview?
:
: one)
: implements

c********t
发帖数: 5706
12
多谢面经!
你面的时候确认了最多只有一个celebrity吗?

【在 l**h 的大作中提到】
: 对, 是考点之一。
c********t
发帖数: 5706
13
你说的这种情况也不难解决,如果是
celebrity: everyone knows him, he knows only other celebrities
就复杂了。

【在 r*******e 的大作中提到】
: 是的,默认应该是你这样理解
: 但是如果celebrity之间的关系不算的话,就不一样
: 只是觉得题目的返回值用vector有点奇怪

c********t
发帖数: 5706
14
5 能不能再解释一下, 不懂isRight, sendLeft要做什么。

one)
implements

【在 l**h 的大作中提到】
: 做手机的那个A,希望对同胞们有用。
: 每次都是两个人一起面,总共五六组,所以总共要见十个还是十二个。记得的问题:
: 1. Find the lonely celebrity(celebrity: everyone knows him, he knows no one)
: . Given a function boolean knows(A, B), which tells you if A knows B.
: Implement function: List getLonelyCelebrity(Set names).
: 2. You got 2^40 positive 4 byte integers on disk, 16M memory, how to find
: the first missing integer.
: 3. Implement the merge of multiple inputs. (I assumed each input implements
: hasNext(), next())
: 4. Reverse a byte array, Reverse a char array (variant length char)

l**h
发帖数: 893
15


【在 c********t 的大作中提到】
: 多谢面经!
: 你面的时候确认了最多只有一个celebrity吗?

l**h
发帖数: 893
16
isRight: 返回当前host是不是最右边的host
sendLeft: 发送一个消息给左边的host.
最后要通过消息传递来统计总host数

【在 c********t 的大作中提到】
: 5 能不能再解释一下, 不懂isRight, sendLeft要做什么。
:
: one)
: implements

1 (共1页)
进入JobHunting版参与讨论
相关主题
Another Bloomberg Phone InterviewBloomberg phone interview 面经
[合集] bloomberg的电面c++问题
刚刚电面完bloomberg,提供一些题目,供大家参考请教一个C++的题目,谢谢
job opening: 有数据库相关经验的在找工作或者换工作的请进question 2: o(1) euque and dequeue?
刚刚结束的linkedIn电面面试的时候可以用STL吗
一道onsite面试题Implement an web-based dictionary lookup
请教 Iterator 一题Expedia Hiring for SQL Server Developer (转载)
求问一道G家的题我们公司在招聘 Software Implementation engineer (转载)
相关话题的讨论汇总
话题: knows话题: names话题: celebrity话题: string