avatar
p*e
1
我的G家电面非常的非典型,没有啥coding,都是小题:
1. 什么是reference counting,主要用在哪儿
2. Given a file with a lot of fruit name, remove duplicates
E.G.
banana
orange
apple
orange
orange
pear


banana
orange
apple
pear
3. Given a file A with a lot of valid phone numbers (several million phone
numbers), and another file B with some phone numbers, find out whether the
phone number in B is in A also.
这个不要求写code,就说一下打算怎么做。我说了hash table,sorting,index table
(这个意思说到了,但keyword没说到), 最后又补充了一个trie。实在想不出其他方法
了。
4. You are in a social networking, and you want to share a picture to your
friends and your friends of friends. How can you find out your friends and
your friends and friends efficiently.
这个也是不需要写code。我只想到了最笨的breadth first search 的方法,O(n^2).然
后被问怎么能做到低于n^2。提示说是用friend relation的symmetry。我觉得即使用了
symmetry也还是O(n^2)啊。不懂,请大牛提示!
遇到这么非典型的电面心里着实没底啊。求bless!
avatar
k*t
2
耵聍就是耳屎。
如果孩子耳朵里面的耵聍太多了,去游泳的时候会被泡涨并且引发疼痛。
解决方法很简单,滴BB油,或者橄榄油
过几天耵聍会自己流出来
avatar
u*o
3
心随你动~~
这歌我也喜欢,祝福mm!
avatar
l*t
4
bless a bless
avatar
t*e
5
No. 3 can use Bloom Filter?
Bless
avatar
k*e
6
(3) 7 million放hashtable内存应该没啥问题吧。不够内存的话,用Trie应该是好方法
。还不够内存的话,就用9,999,999,999个bitmap,每一个bit存相应电话号码(1-
exists,0-nonexist)。
(4) 没理解为什么是O(n2)。friends+friends of friends每一个人过一遍,难道不是O
(N)吗?搞一个Set,一个个往里加不就行了吗?
avatar
m*s
7
Bless!

【在 p*****e 的大作中提到】
: 我的G家电面非常的非典型,没有啥coding,都是小题:
: 1. 什么是reference counting,主要用在哪儿
: 2. Given a file with a lot of fruit name, remove duplicates
: E.G.
: banana
: orange
: apple
: orange
: orange
: pear

avatar
c*e
8
bless
avatar
R*d
9
bless
avatar
p*e
10
我是这么想的:N is average number of friends per user. So you need to check
N friends of N friends. That is N^2.

是O

【在 k******e 的大作中提到】
: (3) 7 million放hashtable内存应该没啥问题吧。不够内存的话,用Trie应该是好方法
: 。还不够内存的话,就用9,999,999,999个bitmap,每一个bit存相应电话号码(1-
: exists,0-nonexist)。
: (4) 没理解为什么是O(n2)。friends+friends of friends每一个人过一遍,难道不是O
: (N)吗?搞一个Set,一个个往里加不就行了吗?

avatar
L*Y
11
有人有好的想法吗?

check

【在 p*****e 的大作中提到】
: 我是这么想的:N is average number of friends per user. So you need to check
: N friends of N friends. That is N^2.
:
: 是O

avatar
x*0
12
m
avatar
f*2
13
我也这么想的。还有更好的解法?

check

【在 p*****e 的大作中提到】
: 我是这么想的:N is average number of friends per user. So you need to check
: N friends of N friends. That is N^2.
:
: 是O

avatar
l*a
14
MARK
avatar
p*e
15
我的G家电面非常的非典型,没有啥coding,都是小题:
1. 什么是reference counting,主要用在哪儿
2. Given a file with a lot of fruit name, remove duplicates
E.G.
banana
orange
apple
orange
orange
pear


banana
orange
apple
pear
3. Given a file A with a lot of valid phone numbers (several million phone
numbers), and another file B with some phone numbers, find out whether the
phone number in B is in A also.
这个不要求写code,就说一下打算怎么做。我说了hash table,sorting,index table
(这个意思说到了,但keyword没说到), 最后又补充了一个trie。实在想不出其他方法
了。
4. You are in a social networking, and you want to share a picture to your
friends and your friends of friends. How can you find out your friends and
your friends and friends efficiently.
这个也是不需要写code。我只想到了最笨的breadth first search 的方法,O(n^2).然
后被问怎么能做到低于n^2。提示说是用friend relation的symmetry。我觉得即使用了
symmetry也还是O(n^2)啊。不懂,请大牛提示!
遇到这么非典型的电面心里着实没底啊。求bless!
avatar
u*o
16
心随你动~~
这歌我也喜欢,祝福mm!
avatar
l*t
17
bless a bless
avatar
t*e
18
No. 3 can use Bloom Filter?
Bless
avatar
k*e
19
(3) 7 million放hashtable内存应该没啥问题吧。不够内存的话,用Trie应该是好方法
。还不够内存的话,就用9,999,999,999个bitmap,每一个bit存相应电话号码(1-
exists,0-nonexist)。
(4) 没理解为什么是O(n2)。friends+friends of friends每一个人过一遍,难道不是O
(N)吗?搞一个Set,一个个往里加不就行了吗?
avatar
m*s
20
Bless!

【在 p*****e 的大作中提到】
: 我的G家电面非常的非典型,没有啥coding,都是小题:
: 1. 什么是reference counting,主要用在哪儿
: 2. Given a file with a lot of fruit name, remove duplicates
: E.G.
: banana
: orange
: apple
: orange
: orange
: pear

avatar
c*e
21
bless
avatar
R*d
22
bless
avatar
p*e
23
我是这么想的:N is average number of friends per user. So you need to check
N friends of N friends. That is N^2.

是O

【在 k******e 的大作中提到】
: (3) 7 million放hashtable内存应该没啥问题吧。不够内存的话,用Trie应该是好方法
: 。还不够内存的话,就用9,999,999,999个bitmap,每一个bit存相应电话号码(1-
: exists,0-nonexist)。
: (4) 没理解为什么是O(n2)。friends+friends of friends每一个人过一遍,难道不是O
: (N)吗?搞一个Set,一个个往里加不就行了吗?

avatar
L*Y
24
有人有好的想法吗?

check

【在 p*****e 的大作中提到】
: 我是这么想的:N is average number of friends per user. So you need to check
: N friends of N friends. That is N^2.
:
: 是O

avatar
x*0
25
m
avatar
f*2
26
我也这么想的。还有更好的解法?

check

【在 p*****e 的大作中提到】
: 我是这么想的:N is average number of friends per user. So you need to check
: N friends of N friends. That is N^2.
:
: 是O

avatar
s*u
27
说一下题目4,感觉更像是一个图的搜索问题,从某人开始,搜索某人的朋友,某人的
朋友的朋友,考虑某人的朋友可能和某人的朋友A的朋友重合很多,朋友A的朋友可能
和朋友B的朋友重合很多,省略这些重合的部分,应该是面试官希望做到的事情。面试
官提到朋友的对称性,似乎可以理解为假设已经确认添加朋友C,可以划掉朋友C的朋
友圈中朋友们的名单上的C的名字,因为C已经添加了。
avatar
f*n
28
mark
avatar
f*r
29
Bless!
avatar
s*a
30
Bless!!
avatar
f*r
31
第四题 bfs的复杂度应该是O(V+E).
avatar
h*d
32
Bless!
avatar
l*u
33
bless

【在 p*****e 的大作中提到】
: 我的G家电面非常的非典型,没有啥coding,都是小题:
: 1. 什么是reference counting,主要用在哪儿
: 2. Given a file with a lot of fruit name, remove duplicates
: E.G.
: banana
: orange
: apple
: orange
: orange
: pear

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