Redian新闻
>
watchung vs warren (转载)
avatar
watchung vs warren (转载)# Living
y*1
1
mountain view 两周前面的,今天电话来hiring committee没过。
(1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
(2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
goog2, go2le.........). return all string from dictionary that can be
matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
方法,但一直不满意复杂度。
(b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包
括所有字典词和coding string.不是很明白。。。凭感觉写了个。
(3) 阿三, 非常拽。。。 给一个dictionary, 一个string,找出dict 里能全部用
string里的letter 表示的所有最长的词。给了算法,死活不满意,不让我写code. 估
计被黑了。
(4)阿三。 design google calendar . 要求分析如何存data, 如何invoke user
created events, 如何handle 100000events per second, 然后要写了一部分thread
safe 的code 实现如何invoke event.
(5)年轻白人: (a)leetcode 上的coin 题, 用DP. (b)给你一个password 假定6位,
有个function 每call 一次就给你一个triplet 是password 里的随即三位,order不变
。比如google, 可能返回, ggl, goe, oog, ool, ........
问如何最有效破译这个密码,写code.
下周Facebook onsite, 求bless
avatar
L*3
2
今天好像zhne逆市而行,能进点吗?你对它最熟。
avatar
i*E
3
【 以下文字转载自 NewJersey 讨论区 】
发信人: iWIFE (Newest product for 果粉), 信区: NewJersey
标 题: watchung vs warren
发信站: BBS 未名空间站 (Mon Apr 22 08:47:26 2013, 美东)
感觉好多watchung的房子很久都没卖掉,warren走的快一点,是不是warren比watchung
好卖一点;好象是同一个高中,为什么有这个差别
avatar
c*m
4
第四个invoke event什么意思? 是说同一个event同时给用户发提醒吗?这个是只读不
写吧?除了记录用户是否收到?
avatar
g*4
5
No, please don't touch it till the end of this month.
avatar
l*a
6
bless
谢谢分享

化。
goo3,

【在 y***1 的大作中提到】
: mountain view 两周前面的,今天电话来hiring committee没过。
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
: (2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
: goog2, go2le.........). return all string from dictionary that can be
: matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
: 方法,但一直不满意复杂度。
: (b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包

avatar
L*3
7
thanks

【在 g********4 的大作中提到】
: No, please don't touch it till the end of this month.
avatar
t*7
8
BLESS
avatar
M*a
9
2(b)基本就是提示2a应该用trie来解了吧
密码题里面要是字母不重复还可以,有重复比较复杂
avatar
r*e
10
密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
s*x
11

是不是跟那个 连续 4个数字(0000-9999)的密码锁类似?
for google, you need xxg, xgo, goo, oog, ogl, gle?
not sure how many circles are there yet.
好像不对 。。。

【在 r*****e 的大作中提到】
: 密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
x*m
12
看起来不简单呀
avatar
c*r
13
bless
Mark
avatar
K*g
14
一个想法:
大量调用function之后算字母出现的概率。
可以算出前四位字母出现在结果首位的概率比例为C(5,2):C(4,2):C(3,2):C(2,2)=10:6
:3:1
拿google为例,g和o出现在首位比例应为11:9
因为11>10,首字母为g,剩下g:o=1:9,同理可算出后续字母为o,o,g
实际算法可能还需要考虑一些极端情况

【在 r*****e 的大作中提到】
: 密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
y*1
15
面试官说这题用图来做, 我觉得可以用toplogical sort

【在 K*******g 的大作中提到】
: 一个想法:
: 大量调用function之后算字母出现的概率。
: 可以算出前四位字母出现在结果首位的概率比例为C(5,2):C(4,2):C(3,2):C(2,2)=10:6
: :3:1
: 拿google为例,g和o出现在首位比例应为11:9
: 因为11>10,首字母为g,剩下g:o=1:9,同理可算出后续字母为o,o,g
: 实际算法可能还需要考虑一些极端情况

avatar
h*d
16
bless
avatar
m*r
17
Bless楼主,fb顺利!
请问这个怎么优化?
(1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化
avatar
l*i
18
密码那道题,可以利用一个节点建立初始6度选择树. 26**6个分叉. 第一个输入共有最
多C(6, 3) * 26 * 26 * 26 选项400k个分叉, 然后一个个输入剪枝,开始应该剪得很多
. You might need to prune the whole node if nothing below.
Traverse each leaf, to save time, take input xyz as a regular expression. *X
*Y*Z, make it 6 steps to walk down and match in lenear time.
Until the last path left, that is the solution.
avatar
z*h
19
这个算纯暴力流吧

*X
★ 发自iPhone App: ChineseWeb 7.8

【在 l****i 的大作中提到】
: 密码那道题,可以利用一个节点建立初始6度选择树. 26**6个分叉. 第一个输入共有最
: 多C(6, 3) * 26 * 26 * 26 选项400k个分叉, 然后一个个输入剪枝,开始应该剪得很多
: . You might need to prune the whole node if nothing below.
: Traverse each leaf, to save time, take input xyz as a regular expression. *X
: *Y*Z, make it 6 steps to walk down and match in lenear time.
: Until the last path left, that is the solution.

avatar
A*c
20
bless lz!

化。
goo3,

【在 y***1 的大作中提到】
: mountain view 两周前面的,今天电话来hiring committee没过。
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
: (2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
: goog2, go2le.........). return all string from dictionary that can be
: matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
: 方法,但一直不满意复杂度。
: (b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包

avatar
y*1
21
mountain view 两周前面的,今天电话来hiring committee没过。
(1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
(2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
goog2, go2le.........). return all string from dictionary that can be
matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
方法,但一直不满意复杂度。
(b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包
括所有字典词和coding string.不是很明白。。。凭感觉写了个。
(3) 阿三, 非常拽。。。 给一个dictionary, 一个string,找出dict 里能全部用
string里的letter 表示的所有最长的词。给了算法,死活不满意,不让我写code. 估
计被黑了。
(4)阿三。 design google calendar . 要求分析如何存data, 如何invoke user
created events, 如何handle 100000events per second, 然后要写了一部分thread
safe 的code 实现如何invoke event.
(5)年轻白人: (a)leetcode 上的coin 题, 用DP. (b)给你一个password 假定6位,
有个function 每call 一次就给你一个triplet 是password 里的随即三位,order不变
。比如google, 可能返回, ggl, goe, oog, ool, ........
问如何最有效破译这个密码,写code.
下周Facebook onsite, 求bless
avatar
c*m
22
第四个invoke event什么意思? 是说同一个event同时给用户发提醒吗?这个是只读不
写吧?除了记录用户是否收到?
avatar
l*a
23
bless
谢谢分享

化。
goo3,

【在 y***1 的大作中提到】
: mountain view 两周前面的,今天电话来hiring committee没过。
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
: (2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
: goog2, go2le.........). return all string from dictionary that can be
: matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
: 方法,但一直不满意复杂度。
: (b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包

avatar
t*7
24
BLESS
avatar
M*a
25
2(b)基本就是提示2a应该用trie来解了吧
密码题里面要是字母不重复还可以,有重复比较复杂
avatar
r*e
26
密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
s*x
27

是不是跟那个 连续 4个数字(0000-9999)的密码锁类似?
for google, you need xxg, xgo, goo, oog, ogl, gle?
not sure how many circles are there yet.
好像不对 。。。

【在 r*****e 的大作中提到】
: 密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
x*m
28
看起来不简单呀
avatar
c*r
29
bless
Mark
avatar
K*g
30
一个想法:
大量调用function之后算字母出现的概率。
可以算出前四位字母出现在结果首位的概率比例为C(5,2):C(4,2):C(3,2):C(2,2)=10:6
:3:1
拿google为例,g和o出现在首位比例应为11:9
因为11>10,首字母为g,剩下g:o=1:9,同理可算出后续字母为o,o,g
实际算法可能还需要考虑一些极端情况

【在 r*****e 的大作中提到】
: 密码那道题有什么思路吗?感觉如果有重复可能永远也猜不出来
avatar
y*1
31
面试官说这题用图来做, 我觉得可以用toplogical sort

【在 K*******g 的大作中提到】
: 一个想法:
: 大量调用function之后算字母出现的概率。
: 可以算出前四位字母出现在结果首位的概率比例为C(5,2):C(4,2):C(3,2):C(2,2)=10:6
: :3:1
: 拿google为例,g和o出现在首位比例应为11:9
: 因为11>10,首字母为g,剩下g:o=1:9,同理可算出后续字母为o,o,g
: 实际算法可能还需要考虑一些极端情况

avatar
h*d
32
bless
avatar
m*r
33
Bless楼主,fb顺利!
请问这个怎么优化?
(1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化
avatar
l*i
34
密码那道题,可以利用一个节点建立初始6度选择树. 26**6个分叉. 第一个输入共有最
多C(6, 3) * 26 * 26 * 26 选项400k个分叉, 然后一个个输入剪枝,开始应该剪得很多
. You might need to prune the whole node if nothing below.
Traverse each leaf, to save time, take input xyz as a regular expression. *X
*Y*Z, make it 6 steps to walk down and match in lenear time.
Until the last path left, that is the solution.
avatar
z*h
35
这个算纯暴力流吧

*X
★ 发自iPhone App: ChineseWeb 7.8

【在 l****i 的大作中提到】
: 密码那道题,可以利用一个节点建立初始6度选择树. 26**6个分叉. 第一个输入共有最
: 多C(6, 3) * 26 * 26 * 26 选项400k个分叉, 然后一个个输入剪枝,开始应该剪得很多
: . You might need to prune the whole node if nothing below.
: Traverse each leaf, to save time, take input xyz as a regular expression. *X
: *Y*Z, make it 6 steps to walk down and match in lenear time.
: Until the last path left, that is the solution.

avatar
A*c
36
bless lz!

化。
goo3,

【在 y***1 的大作中提到】
: mountain view 两周前面的,今天电话来hiring committee没过。
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
: (2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
: goog2, go2le.........). return all string from dictionary that can be
: matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
: 方法,但一直不满意复杂度。
: (b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包

avatar
l*d
37
用 topological sort 来做这道题,感觉还是不知道如何下手。请问有大牛有思路吗?
avatar
T*u
38
起点和重点同时搜?

【在 m**r 的大作中提到】
: Bless楼主,fb顺利!
: 请问这个怎么优化?
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化
: 。

avatar
T*u
39
HMM?

【在 s**x 的大作中提到】
:
: 是不是跟那个 连续 4个数字(0000-9999)的密码锁类似?
: for google, you need xxg, xgo, goo, oog, ogl, gle?
: not sure how many circles are there yet.
: 好像不对 。。。

avatar
f*n
40
mark
avatar
l*u
41
bless

化。
goo3,

【在 y***1 的大作中提到】
: mountain view 两周前面的,今天电话来hiring committee没过。
: (1) 中年白人: 先在手机上演示了一个game, 就是一个球从起点开始沿着通道,看
: 能不能滚到终点。不过有限制, 每次球一走到底要不到边界,要不到障碍物,中间不
: 能停留。 可以上下左右走,然后让写个function 给定起点, 终点,和图,判断是不
: 是solvable. 写出来了, 就是用BFS,有个小bug被指出。然后问复杂度, 问如何优化。
: (2) 韩国人: a) 给一个dictionary, 再给一个set of coding string (g5, goo3,
: goog2, go2le.........). return all string from dictionary that can be
: matched with the coding string. 要求尽量减少dictionary look up 次数。给了个
: 方法,但一直不满意复杂度。
: (b)如何用Trie, 把问题(a)解决,要求写code 建一个Trie包

avatar
s*i
42
密码那题如果不限制字母重复次数的话是必须指定概率来做了。比如六个a组成的密码
,你永远不可能100%确定密码就是六个a。
google 有可能100%确定
ggoole 不可能100%确定
gogole 有可能100%确定
avatar
f*r
43
多谢lz,bless
avatar
x*i
44
多谢!
bless!
avatar
f*n
45
mark
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。