P*******7 发帖数: 55 | 1 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回
馈。
背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时
间将本版1万
多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见
的题目:
推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出
这篇文
章的思路和难度。
Lock-free algorithms。推荐
http://www.ibm.com/developerworks/java/library/j-jtp04186/index.html
Bloomberg题目较容易,比如一个数组只有0,1两个数字,如何O(n)time, O(1)space排
序。但
同样思路的题目在facebook就变成一个数组有k个不同数字,假设k是常数,如何O(n)
time,
O(1)space排序,现场写出程序还是很麻烦。
另外小尾羊曾总结O(nlgn)的算法找出最长增长序列,面试中有遇到。
排序和binary sear |
h******3 发帖数: 351 | 2 牛人, 真是苦尽甘来.
请问有本Debug书的电子版么?
【在 P*******7 的大作中提到】 : 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回 : 馈。 : 背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时 : 间将本版1万 : 多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见 : 的题目: : 推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出 : 这篇文 : 章的思路和难度。 : Lock-free algorithms。推荐
|
t********t 发帖数: 5415 | |
s***e 发帖数: 793 | 4 congs
【在 P*******7 的大作中提到】 : 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回 : 馈。 : 背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时 : 间将本版1万 : 多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见 : 的题目: : 推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出 : 这篇文 : 章的思路和难度。 : Lock-free algorithms。推荐
|
w****u 发帖数: 367 | 5 Cong!
I think I know you. :)
did u decide where to go?
【在 P*******7 的大作中提到】 : 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回 : 馈。 : 背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时 : 间将本版1万 : 多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见 : 的题目: : 推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出 : 这篇文 : 章的思路和难度。 : Lock-free algorithms。推荐
|
P*******7 发帖数: 55 | 6 5点你还不睡?
【在 w****u 的大作中提到】 : Cong! : I think I know you. :) : did u decide where to go?
|
P*******7 发帖数: 55 | 7 CSDN上有
【在 h******3 的大作中提到】 : 牛人, 真是苦尽甘来. : 请问有本Debug书的电子版么?
|
P*******b 发帖数: 1001 | 8 牛人啊
【在 P*******7 的大作中提到】 : 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回 : 馈。 : 背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时 : 间将本版1万 : 多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见 : 的题目: : 推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出 : 这篇文 : 章的思路和难度。 : Lock-free algorithms。推荐
|
s******5 发帖数: 673 | 9
能稍微相信说一下面的都是什么position吗?
谢谢!
【在 P*******7 的大作中提到】 : 已面试facebook, bloomberg, linkedin三家,都拿到offer。在本版收益很多,特来回 : 馈。 : 背景:12月-4月找faculty全军覆没,5月份开始准备工业界面试,花了近1个月时 : 间将本版1万 : 多帖子过了一遍,发现绝大部分面试题都不出其中,非常有用。这里补充一些自己遇见 : 的题目: : 推荐“A Collection of Dice Problems”,面试facebook时遇到不少概率题,都不超出 : 这篇文 : 章的思路和难度。 : Lock-free algorithms。推荐
|
v***n 发帖数: 5085 | |
|
|
n*******9 发帖数: 1017 | 11 I can only say niu XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX |
i**9 发帖数: 351 | |
c*****h 发帖数: 166 | |
j*****g 发帖数: 223 | 14 For the sorting w/ k elements problem, it's easy to achieve O(n) time
complexity and O(1) space complexity by using counting/frequency sort:
step 0: initialize counting/freq array k, where k0 ... kn elements can be
indexed into 0 to n of the array. And array is initialized to be 0.
step 1: scan the array, and for each a[i] do k[a[i]]++;
step 2: rescan the array and put final sorted element back in.
count = 0;
for (i = 0; i < k; i++)
for (j = 0; j < k[i]; j++)
a[count++] = i;
(a bit simplified assumping k elements are in fact 0 to k - 1, but you get
the idea.
HOWEVER,
if k = 0 and 1 (your bloomberg problem), it can be done like this even more
simplified:
begin = 0; end = n - 1;
while (begin < end)
{
while (begin < end && a[begin] == 0) begin++;
if (begin < end) { swap (begin, end); end--; }
while (begin < end && a[end] == 1) end--;
if (begin < end) { swap (begin, end); begin++;}
}
this is bit like the partition step in the qsort. So it's really only ONE
linear scan, compared with frequency/counting sort's 2 linear scans.
WHICH prompts me to think is there any generic better way to solve th k-
element problem better than the counting/frequncy sorting algo?
hm..... |
P*******7 发帖数: 55 | 15 The dutch national flag problem.
be
【在 j*****g 的大作中提到】 : For the sorting w/ k elements problem, it's easy to achieve O(n) time : complexity and O(1) space complexity by using counting/frequency sort: : step 0: initialize counting/freq array k, where k0 ... kn elements can be : indexed into 0 to n of the array. And array is initialized to be 0. : step 1: scan the array, and for each a[i] do k[a[i]]++; : step 2: rescan the array and put final sorted element back in. : count = 0; : for (i = 0; i < k; i++) : for (j = 0; j < k[i]; j++) : a[count++] = i;
|
j*****g 发帖数: 223 | 16 靠!工作越久,脑子越僵。真理呀。。。
The same one scan partition algorithm run k - 1 times....//tears
【在 P*******7 的大作中提到】 : The dutch national flag problem. : : be
|
P*****o 发帖数: 294 | |