由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 分享下Google电面题
相关主题
Extension problem of finding intersection of two sorted arrayfind union for 2 arrays不准用Set怎么做
amazon 电面题Google电话面试题目
一道google题问个面试题
贡献两个Amazon的电话面试题find median for k sorted arrays
Find the intersection of two sorted arrays【扩展】问个Facebook 电面题
请教一个概率题目哪里有讲k-way merge的?
G's interview, 2 questions刷题刷到没自信了
请问一道面试题a[i] + b[j] = c[k] 的题有靠谱的答案不?
相关话题的讨论汇总
话题: reward话题: dice话题: toss话题: stop话题: expected
进入JobHunting版参与讨论
1 (共1页)
l******x
发帖数: 163
1
上周五面的
上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
感觉是内行。。。
接着3道题
1. A game between player A and B with a dice. Each time A toss it, B has two
options: stop or continue. If B asks to stop, he will get the reward equal
to number on the face of the dice. If B asks to continue, then A toss again
and B makes new decision. The question is what is the best strategy for B so
that B can make the highest reward.
2. Sorted arrays M and N with len m and n, find intersection of them.
Then ask if m >> n, how to do i
B*****t
发帖数: 335
2
for problems, how many times can A toss the dice?
if infinite times, why not B stop it when A tosses a face with the largest
number?
B****t
发帖数: 1982
3
同问

【在 B*****t 的大作中提到】
: for problems, how many times can A toss the dice?
: if infinite times, why not B stop it when A tosses a face with the largest
: number?

D******n
发帖数: 2836
4
then he can wait until 6 comes up...what is the catch?

will
B
A

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

B*****g
发帖数: 34098
5
不明白,让A continue就是了,直到搞出6

will
largest
B
A

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

l******x
发帖数: 163
6
I found a similar problem on the link below
http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true,page.1,css.print/issue.aspx
The problem sets a max value on total number of tosses.
Sorry for the confusion.

【在 B*****g 的大作中提到】
: 不明白,让A continue就是了,直到搞出6
:
: will
: largest
: B
: A

B*****t
发帖数: 335
7
我想题目1的意思可能是:假设A每次扔的点数是Xi(i>=1, 1<=Xi<=6), A可以一直扔下
去,B可以得到的利益时Yi=1/N*sum(Xi),问B的strategy,当N=?时,Yi为最大的值的概率最大。不过
这是一个数学问题吧!

two
equal
again
so

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

B****t
发帖数: 1982
8
学习了
http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true,page.1,css.print/issue.aspx
If you always stop with the first roll, for example, the winnable amount is
simply the expected value of a random variable that takes the values 1, 2, 3
, 4, 5, and 6 with probability 1/6 each. That is, one-sixth of the time you
will win 1, one-sixth of the time you will win 2, and so on, which yields
the expected value 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 7/2
. Thus if you a
d********e
发帖数: 132
9
请问第三道题是什么意思?没明白题意。

two
equal
again
so

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

y**i
发帖数: 1112
10
这个是可以一直继续,还是只能继续一次?

two
equal
again
so

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

相关主题
请教一个概率题目find union for 2 arrays不准用Set怎么做
G's interview, 2 questionsGoogle电话面试题目
请问一道面试题问个面试题
进入JobHunting版参与讨论
g*******y
发帖数: 1930
11
写的好长啊,简单一句话,不就是个递归的思路嘛

http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true
,page.1,css.print/issue.aspx
amount is
1, 2, 3
time you
yields
= 7/2
the

【在 B****t 的大作中提到】
: 学习了
: http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true,page.1,css.print/issue.aspx
: If you always stop with the first roll, for example, the winnable amount is
: simply the expected value of a random variable that takes the values 1, 2, 3
: , 4, 5, and 6 with probability 1/6 each. That is, one-sixth of the time you
: will win 1, one-sixth of the time you will win 2, and so on, which yields
: the expected value 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 7/2
: . Thus if you a

r****o
发帖数: 1950
12
Bless!
请问第2题的intersection是指什么? 是说在array M里面找到array N的元素的位置,
还是说在array M里面找到一个范围[m..n]能cover array N里面所有的数?
多谢。

two
equal
again
so

【在 l******x 的大作中提到】
: 上周五面的
: 上来问简历,很奇怪对我做的一个东西很赶兴趣,还问了一个常见的scheme
: 感觉是内行。。。
: 接着3道题
: 1. A game between player A and B with a dice. Each time A toss it, B has two
: options: stop or continue. If B asks to stop, he will get the reward equal
: to number on the face of the dice. If B asks to continue, then A toss again
: and B makes new decision. The question is what is the best strategy for B so
: that B can make the highest reward.
: 2. Sorted arrays M and N with len m and n, find intersection of them.

o****d
发帖数: 2835
13
n!的结尾的0的个数

【在 d********e 的大作中提到】
: 请问第三道题是什么意思?没明白题意。
:
: two
: equal
: again
: so

c*******n
发帖数: 112
14
what is the best solution for the second question. My solution require O(n +
m) in the worst case.
The last one is easy by counting how many 5 appears in n!.
k*n
发帖数: 150
15
just standard set intersection, I think.

【在 r****o 的大作中提到】
: Bless!
: 请问第2题的intersection是指什么? 是说在array M里面找到array N的元素的位置,
: 还是说在array M里面找到一个范围[m..n]能cover array N里面所有的数?
: 多谢。
:
: two
: equal
: again
: so

c******n
发帖数: 91
16
还剩两轮时的expected reward是4(1/6) + 5(1/6) + 6(1/6) + (1/2)(3.5) = 4.25容
易理解,但还剩三轮时的expected reward是多少文中没有提。应该也在4与5之间,不
然倒数第四
轮不会停在5或6.怎么我算出来是这个5(1/6) + 6(1/6) + (1/2)(4/6 + 5/6 + 6/6) +
(1/4)(3.5) = 3.96?

http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true
,page.1,css.print/issue.aspx
amount is
1, 2, 3
time you
yields
= 7/2
the

【在 B****t 的大作中提到】
: 学习了
: http://www.americanscientist.org/issues/id.5783,y.2009,no.2,content.true,page.1,css.print/issue.aspx
: If you always stop with the first roll, for example, the winnable amount is
: simply the expected value of a random variable that takes the values 1, 2, 3
: , 4, 5, and 6 with probability 1/6 each. That is, one-sixth of the time you
: will win 1, one-sixth of the time you will win 2, and so on, which yields
: the expected value 1(1/6) + 2(1/6) + 3(1/6) + 4(1/6) + 5(1/6) + 6(1/6) = 7/2
: . Thus if you a

1 (共1页)
进入JobHunting版参与讨论
相关主题
a[i] + b[j] = c[k] 的题有靠谱的答案不?Find the intersection of two sorted arrays【扩展】
优步面试,哎。。。请教一个概率题目
贡献几道CS电面题G's interview, 2 questions
一个特别的inplace merge two sorted arrays请问一道面试题
Extension problem of finding intersection of two sorted arrayfind union for 2 arrays不准用Set怎么做
amazon 电面题Google电话面试题目
一道google题问个面试题
贡献两个Amazon的电话面试题find median for k sorted arrays
相关话题的讨论汇总
话题: reward话题: dice话题: toss话题: stop话题: expected