由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 今天又被recuiter 鄙视了,大家来教育下我吧。
相关主题
这些找missing number的题是不是都不能用求和做?求问Jane Street一道面试题
Given an array of N integers from range [0, N] and one is missing. Find the missing number.bloomberg 店面
Find the first k smallest numbers in an array.amazon问题求教
问个问题 求missing numberG面试题
昨天面试的一道题,find k missing numbers问一道面世题
也问一个算法题一个电面题
Bloomberg 电面面经,EE专业问个amazon店面题
一道a家电面题目probably XOR problem
相关话题的讨论汇总
话题: array话题: missing话题: recuiter话题: xor话题: numbers
进入JobHunting版参与讨论
1 (共1页)
v*****u
发帖数: 406
1
今天突然接到一个recuiter电话。然后被问及几个问题。
Array里找missing value.我说用int i遍历。被鄙视。
问multi-thread编程的pattern design。当时我说不知道。
人家要我补一补cs基础知识。
另外就是一问到身份问题,就嘎然而止。
唉......大家来教育下我吧。
c***2
发帖数: 838
2
1) Array里找missing value:
Linear scan with the help of either a hash table or a bit vector
2) multi-thread编程的pattern design
Don't know either
l*****a
发帖数: 14598
3
1)
Use XOR if u know the scope of the numbers.

【在 c***2 的大作中提到】
: 1) Array里找missing value:
: Linear scan with the help of either a hash table or a bit vector
: 2) multi-thread编程的pattern design
: Don't know either

c***2
发帖数: 838
4
How to do it in o(n) using XOR?
Oh, XOR(all numbers in range and all numbers in array)?
this works if only one number is missing
won't work if multiple are missing?

【在 l*****a 的大作中提到】
: 1)
: Use XOR if u know the scope of the numbers.

j*****u
发帖数: 1133
5
array是连续的么?如果是连续找1个missing value的话可以扫一遍得到sum(注意溢出)
,min和max
missing=min + ... + max - sum
multi-thread的pattern deisign是啥,第一次听说这个名词

【在 v*****u 的大作中提到】
: 今天突然接到一个recuiter电话。然后被问及几个问题。
: Array里找missing value.我说用int i遍历。被鄙视。
: 问multi-thread编程的pattern design。当时我说不知道。
: 人家要我补一补cs基础知识。
: 另外就是一问到身份问题,就嘎然而止。
: 唉......大家来教育下我吧。

l*****a
发帖数: 14598
6
then could u tell me how will u solve it
if you don't know the scope of those numbers in the array
with bit sector.

【在 c***2 的大作中提到】
: How to do it in o(n) using XOR?
: Oh, XOR(all numbers in range and all numbers in array)?
: this works if only one number is missing
: won't work if multiple are missing?

c***2
发帖数: 838
7
"missing number" implies that the range of the array must be known.
Otherwise, this question won't make sense.
Suppose the range of the array is (min..max)
Then just use either a hashtable or bit vector with size of max-min+1.
j*****u
发帖数: 1133
8
why collection needed? missing = sum(min, max) - sum(array)
time O(n), space O(1)

【在 c***2 的大作中提到】
: "missing number" implies that the range of the array must be known.
: Otherwise, this question won't make sense.
: Suppose the range of the array is (min..max)
: Then just use either a hashtable or bit vector with size of max-min+1.

v*****u
发帖数: 406
9

对呀对呀。就是这样的。
当时recruiter也说到这个方法。我没有听明白。
你怎么能够知道呢?哪里书可以看到?

【在 j*****u 的大作中提到】
: why collection needed? missing = sum(min, max) - sum(array)
: time O(n), space O(1)

1 (共1页)
进入JobHunting版参与讨论
相关主题
probably XOR problem昨天面试的一道题,find k missing numbers
G家面经也问一个算法题
这样M家面试挂掉还需要等半年么Bloomberg 电面面经,EE专业
上一道题给你们休息休息一道a家电面题目
这些找missing number的题是不是都不能用求和做?求问Jane Street一道面试题
Given an array of N integers from range [0, N] and one is missing. Find the missing number.bloomberg 店面
Find the first k smallest numbers in an array.amazon问题求教
问个问题 求missing numberG面试题
相关话题的讨论汇总
话题: array话题: missing话题: recuiter话题: xor话题: numbers