由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Quant版 - CTC interview 2nd round phone interview
相关主题
[合集] a probability question一道有关risky bond survival probability 的面试题
出个coding难题【Probability】求pdf
[合集] Anybody know the best answer?(programming)求教一个random walk题
来一道题 (转载)old probability Q
问一个convergence of random variables的问题大家来做一道题吧
Risk Neutral probability[合集] 一道面试c程序题
一个概率题问一个dynamic programming 的问题
请教上周Credit Suisse的一个题(probability)shortest path algorithm(dijkstra)的变形
相关话题的讨论汇总
话题: line话题: outputing话题: readin话题: interview
进入Quant版参与讨论
1 (共1页)
a******u
发帖数: 66
1
It has to be the shortest interview that I've ever had, or will have.
tech头说他是被抓来问的,但是他知道我不是programing背景,就问我用什么编程,什
么语言,research用编程么(不
用),知道用script language么(不知道),知道data base么(不知道)。整个过程
很轻松,人很nice。就说要把决定
权给第一轮面我的FE leader。总共过程15分钟不到。
明天hr的人会给我答复,不知道是不是凶多吉少...
Anyway, 借贴问几个最近见到的题目:
1. Reorder a linked list in the order returned by a function. The function
is passed as a function pointer.
(不是很清楚题目的意思。。。)
2。How to change a pair of die so as to create the same probability for
every sum(印象中板上出现过这个题目,
不过找不到了。。)
3。Write a program to reverse the linked list.
(不担心空间和效率的话就直接放到大的vector里面然后逆序吧?)
4。Write an algorithm that reads through a file line by line, then prints
out a random line. It has to print each
line with equal probability. The catch is that you don't know how many lines
the file has ahead of time and you
can only make one pass over the file.
(也见过这个题目,不知道怎么做)
谢谢大家!不好意思这个面经很水。。。。。。。。。
Y***e
发帖数: 1030
2
我还有过7分钟的interview呢

【在 a******u 的大作中提到】
: It has to be the shortest interview that I've ever had, or will have.
: tech头说他是被抓来问的,但是他知道我不是programing背景,就问我用什么编程,什
: 么语言,research用编程么(不
: 用),知道用script language么(不知道),知道data base么(不知道)。整个过程
: 很轻松,人很nice。就说要把决定
: 权给第一轮面我的FE leader。总共过程15分钟不到。
: 明天hr的人会给我答复,不知道是不是凶多吉少...
: Anyway, 借贴问几个最近见到的题目:
: 1. Reorder a linked list in the order returned by a function. The function
: is passed as a function pointer.

Y******u
发帖数: 1912
3
2. is that possible? there are 36 combination and 11 numbers. Won't be even
distributed
3. use 3 pointer to reverse it in place
p*b
发帖数: 30
4
2. change one die so that it output some value with probability 1... don't
know if this counts as a solution
3. use 3 pointers to make it in one run
4. readin one line, keep it
readin the 2nd line, flip a fair coin, if head, keep the original line,
if tail, keep the new readin line
readin the 3rd line, flip a 2/3 coin, if head, keep the original line, if
tail, keep the new readin line
... (continue the procedure by fliping a 3/4, 4/5, ... coin)

【在 a******u 的大作中提到】
: It has to be the shortest interview that I've ever had, or will have.
: tech头说他是被抓来问的,但是他知道我不是programing背景,就问我用什么编程,什
: 么语言,research用编程么(不
: 用),知道用script language么(不知道),知道data base么(不知道)。整个过程
: 很轻松,人很nice。就说要把决定
: 权给第一轮面我的FE leader。总共过程15分钟不到。
: 明天hr的人会给我答复,不知道是不是凶多吉少...
: Anyway, 借贴问几个最近见到的题目:
: 1. Reorder a linked list in the order returned by a function. The function
: is passed as a function pointer.

Y******u
发帖数: 1912
5
Your solution 4 doesn't work. I wrote a program to test.

if

【在 p*b 的大作中提到】
: 2. change one die so that it output some value with probability 1... don't
: know if this counts as a solution
: 3. use 3 pointers to make it in one run
: 4. readin one line, keep it
: readin the 2nd line, flip a fair coin, if head, keep the original line,
: if tail, keep the new readin line
: readin the 3rd line, flip a 2/3 coin, if head, keep the original line, if
: tail, keep the new readin line
: ... (continue the procedure by fliping a 3/4, 4/5, ... coin)

p*b
发帖数: 30
6
why not?
the probability of outputing line 1 would be 1/2 * 2/3 * 3/4 *...*(N-1)/N =
1/N
the probability of outputing line 2 would be the same as above.
the probability of outputing line 3 would be 1/3 * 3/4 *...*(N-1)/N = 1/N
....
the probability of outputing line k would be 1/k * k/(k+1)*...*(N-1)/N = 1/N
...

【在 Y******u 的大作中提到】
: Your solution 4 doesn't work. I wrote a program to test.
:
: if

a******u
发帖数: 66
7
how did it turn out?

【在 Y***e 的大作中提到】
: 我还有过7分钟的interview呢
a******u
发帖数: 66
8
thanks! It works!

if

【在 p*b 的大作中提到】
: 2. change one die so that it output some value with probability 1... don't
: know if this counts as a solution
: 3. use 3 pointers to make it in one run
: 4. readin one line, keep it
: readin the 2nd line, flip a fair coin, if head, keep the original line,
: if tail, keep the new readin line
: readin the 3rd line, flip a 2/3 coin, if head, keep the original line, if
: tail, keep the new readin line
: ... (continue the procedure by fliping a 3/4, 4/5, ... coin)

Y******u
发帖数: 1912
9
sry, made a mistake in algo. It works

=
/N

【在 p*b 的大作中提到】
: why not?
: the probability of outputing line 1 would be 1/2 * 2/3 * 3/4 *...*(N-1)/N =
: 1/N
: the probability of outputing line 2 would be the same as above.
: the probability of outputing line 3 would be 1/3 * 3/4 *...*(N-1)/N = 1/N
: ....
: the probability of outputing line k would be 1/k * k/(k+1)*...*(N-1)/N = 1/N
: ...

1 (共1页)
进入Quant版参与讨论
相关主题
shortest path algorithm(dijkstra)的变形问一个convergence of random variables的问题
interview question (brainteaser)Risk Neutral probability
Ordering a sequence (2) (转载)一个概率题
两道面试题 (UBS)请教上周Credit Suisse的一个题(probability)
[合集] a probability question一道有关risky bond survival probability 的面试题
出个coding难题【Probability】求pdf
[合集] Anybody know the best answer?(programming)求教一个random walk题
来一道题 (转载)old probability Q
相关话题的讨论汇总
话题: line话题: outputing话题: readin话题: interview