由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 来大家玩几道题
相关主题
FB 上周2电面请问这几道题的最优解法是什么?
hash_map 的遍历问题请问google电面coding方式
无名小公司 :: 软件设计工程师 :: 面经征解几道large scale的数字题
谁来解释下hashtable的iterator是怎么实现的请教一道题
LC的BST iterator到底要考察什么?How to turn a binary search tree into a sorted array?
树中序遍历,要求左子树用递归,右子树用iteration谁有较好的iterative后序遍历binary tree的代码?
问个经典问题的improvementO(N) sort integer array
Uber 面经贡献几道amazon电面题
相关话题的讨论汇总
话题: fish话题: do话题: measure话题: sorted话题: 道题
进入JobHunting版参与讨论
1 (共1页)
a*******y
发帖数: 1040
1
1. 一个array,sorted,你知道有一个数出现的次数no less than 51%, how to get
it?
2. if it is not sorted, how do you do it?
3. if given you 95% confidence to find that element, how do you find it?
4. a pond which is irregular, you cannot measure the volumn or area, but the
fish there is uniformly distributed, how do you measure how many fish are
there?
5. why SVM does not return you the hyperplane directlY?
l*****a
发帖数: 14598
2
你都不会吗?
还是想看最优解

get
the

【在 a*******y 的大作中提到】
: 1. 一个array,sorted,你知道有一个数出现的次数no less than 51%, how to get
: it?
: 2. if it is not sorted, how do you do it?
: 3. if given you 95% confidence to find that element, how do you find it?
: 4. a pond which is irregular, you cannot measure the volumn or area, but the
: fish there is uniformly distributed, how do you measure how many fish are
: there?
: 5. why SVM does not return you the hyperplane directlY?

a*******y
发帖数: 1040
3
哥哥,我是贴出来让大家玩玩,俺的店面题,基本都会

【在 l*****a 的大作中提到】
: 你都不会吗?
: 还是想看最优解
:
: get
: the

i*********7
发帖数: 348
4
第一题,取mid值即可。因为超过了51%,表示不管这个数字的起始点在哪里,必然过
arr[mid]。
第二题,
设立一个count.初始值为1.
设立一个初始值iter为arr[0]。
然后遍历数组,当遇到同样的数字的时候count++,否则count--
当count为0的时候,重置count为1。iter为当前遍历到的值。遍历完署组织后,iter就
是要返回的数。
第三题,其实和第二题做法类似,但是只需要遍历10%的数组长度(假设知道数组长度
)即可(个人猜想)。理由和第二题类似。
第四题,我不是很明白can not measure the volumn是啥意思。我的猜想是取一定量(
譬如10升)的水(和鱼一起)。看看10升水里面有多少鱼。然后把水抽干。看看总水量
,得到鱼的数目。
第五题。看不懂。。掠过。
a*******y
发帖数: 1040
5
你那个抽水太牛了
第三题说说你问什么要遍历10%的数组?怎么达到95%的confidence的,这题要利用
boost的思想

【在 i*********7 的大作中提到】
: 第一题,取mid值即可。因为超过了51%,表示不管这个数字的起始点在哪里,必然过
: arr[mid]。
: 第二题,
: 设立一个count.初始值为1.
: 设立一个初始值iter为arr[0]。
: 然后遍历数组,当遇到同样的数字的时候count++,否则count--
: 当count为0的时候,重置count为1。iter为当前遍历到的值。遍历完署组织后,iter就
: 是要返回的数。
: 第三题,其实和第二题做法类似,但是只需要遍历10%的数组长度(假设知道数组长度
: )即可(个人猜想)。理由和第二题类似。

i*********7
发帖数: 348
6
好吧,我理解错了。我以为你说的95%是指重复率95%。。我再想想。统计方面不是很熟
习。
另外,第四题求提示。

【在 a*******y 的大作中提到】
: 你那个抽水太牛了
: 第三题说说你问什么要遍历10%的数组?怎么达到95%的confidence的,这题要利用
: boost的思想

a*******y
发帖数: 1040
7
第四题从sampling入手

【在 i*********7 的大作中提到】
: 好吧,我理解错了。我以为你说的95%是指重复率95%。。我再想想。统计方面不是很熟
: 习。
: 另外,第四题求提示。

b***e
发帖数: 1419
8
量密度,打上一些鱼来,然后再量密度。

【在 a*******y 的大作中提到】
: 第四题从sampling入手
g*****i
发帖数: 2162
9
赞思路.
第二题就是majority voting,如果count > 剩下没看的总数也可以直接出结果了
坐等3,6正确答案

【在 b***e 的大作中提到】
: 量密度,打上一些鱼来,然后再量密度。
g******2
发帖数: 234
10
3. take k random samples of size m, form a empirical distrbution of the
median
4. sample twice. First time sample k fish, mark them. Second time, sample m
fish, calculate the ratio of the marked fish. k/ratio is a rough estimate.
5. no idea.
1 (共1页)
进入JobHunting版参与讨论
相关主题
贡献几道amazon电面题LC的BST iterator到底要考察什么?
问个编程题目树中序遍历,要求左子树用递归,右子树用iteration
Amazon onsite面经问个经典问题的improvement
贡献几道G家onsite题Uber 面经
FB 上周2电面请问这几道题的最优解法是什么?
hash_map 的遍历问题请问google电面coding方式
无名小公司 :: 软件设计工程师 :: 面经征解几道large scale的数字题
谁来解释下hashtable的iterator是怎么实现的请教一道题
相关话题的讨论汇总
话题: fish话题: do话题: measure话题: sorted话题: 道题