Akuna Capital Quant Developer OA 求评分~~~

原帖地址:一亩三分地

看了不少地里的面经,也该回馈社会了~
和以前的题一模一样,quant developer只能做Python的题,可以参考:http://www.1point3acres.com/bbs/thread-160494-1-1.html

选择题总共有三道:
第一道,问一段代码的时间复杂度,两个for循环,复杂度O(n^2)
第二道,问一段程序的output,敲下来执行以下直接出答案,224
def traverse(seq_len):
idx = 1
traversed = []
while len(traversed) < seq_len: traversed.append([idx,2*len(traversed)+1]) idx += 2 if idx > seq_len:
idx -= seq_len
sum = 0
for idx, i in traversed:
sum += (i*idx)
print(sum)

traverse(7)

第三道,关于multithreading和multi-processing的多选题,不是特别难
有个选项不太确定,Do both multi-threading and multi-processing take advantage of multi-core? 求大神解答!

三道编程题:
第一道:valid parentheses,leetcode原题,可参考:https://leetcode.com/problems/valid-parentheses/
第二道:给一个array_size,能否用一个三维数组表示,其实意思就是array_size 是否是三个整数比2大的整数的乘积。解法和prime number的挺相似的,用一个for 循环,找到factors,factors大于等于3,就return true
第三道:Quant Interview的经典brainteaser,只不过用coding实现。
brainteaser原题是:You can roll a 6-side dice up to 3 times. After the first or the second roll, if you get a number x, you can decide either to get x dollars or to choose to continue rolling, but once you decide to continue, you forgo the number you just rolled. If you get to the third roll, you’ll just get x dollars if the third roll is x and the game stops. What is the game worth and what s your strategy?在每一次roll的时候,如果当前的value > 接着roll的expected value,则accept;otherwise,continue rolling;从最后一次roll往前算,能推出来整个游戏的fair value,动态规划的思想

改成的Coding题:给定maximum number of rolls,算fair value,懂了原理就不是很难

祝大家offer多多!

另外,求大米啊!!!