《数据科学面试40+真题讲解》,K神本年度最后一次开课


一亩三分地论坛

 找回密码
 Sign Up 注册获取更多干货
码农求职神器Triplebyte:
不用海投,内推你去多家公司面试
Airbnb 数据科学职位
in analytics and inference
天天打游戏、照样领工资,
你要不要来?
把贵司招聘信息放这里
查看: 1331|回复: 2
收起左侧

Microsoft college code competition

[复制链接] |试试Instant~ |关注本帖
3angFeng945 发表于 2014-10-2 12:02:25 | 显示全部楼层 |阅读模式

2014(10-12月) 码农类 硕士 全职@Microsoft - 校园招聘会 - 校园招聘会 |Fail

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看,没有帐号?Sign Up 注册获取更多干货

x
今天刚参加完微软career fair后的microsoft college code competition,虽然官方只说有奖品啥的,但是好像答的好会直接有interview,所以po在这个版,不知道合不合适。

一共六道题,难的三分,简单的一分,中等的两份,可以三个人组队参加,用任意语言,要把最终结果和代码上传,结果对就会给分。
第一题是三分题,有一种病毒,但是疫苗有限,要先给得病的概率高的人免疫,所以要计算得病概率,得病的概率是个人的基因跟病毒基因比较,看重复部分的长度有多长,跟总长度比较。输出接种的次序。. 涓浜-涓夊垎-鍦帮紝鐙鍙戝竷
第二题两分题,忘记了,
第三题两分,是unicode的一道题,不是太熟,就没做这个。. From 1point 3acres bbs
第四题两分,是用software实现vending machine, 感觉corner case挺多的。
第五题一分,是给出一个txt文档,每一行有两个字符串,判断他俩是不是anagram,并输出。这个记得career cup上有非常类似的题。当然实际做的时候输入输出的函数要自己写。
第六题一分,给出一段代码,有go to和next等命令,判断是否有死循环,compiler里的经典方法。

本人很水~得分不是很高,他这个下周在别的学校好像还有,感兴趣的小伙伴赶紧组队参加吧。
隐藏部分是第一个题的原题,感兴趣的同学可以看一下。
There is an outbreak of VirusX in Redmond. The local authorities have discovered a vaccine that protects against infection by VirusX. However, they can only produce so many vaccines per week. Your job is to figure out the best order in which people should be vaccinated. Everyone will get vaccinated, but the people more likely to be sick should be vaccinated first. You are more likely to get sick if the virus` DNA closely matches somewhere in your DNA.. 1point 3acres 璁哄潧

However, there is a catch: the virus can mutate. Over time, the virus can “cut” letters from its DNA. So it is possible that the AAAAG virus mutates into the AAAG, AAAA, …, A viruses. Removing letters is the only possible mutation: the virus cannot change any letter.

For example, if your DNA is GGGGGGGAAAAGGGGGG and the virus DNA is AAAAG, you have 1.0 probability of getting infected because all of the letters of the virus are found in the same order in your DNA. If your DNA was TTTTTTTAAAATTTTTT, then the virus only partially matches your DNA. For partial matches, we define the probability to get sick by the numbers of continuous letters of the virus’ DNA that matches your DNA divided by the total number of letters in the un-mutated virus’ DNA. With the example above, AAAA is the longest possible mutation that matches in your DNA, so your probability of getting sick is len(AAAA) / len(AAAAG): 0.8.

You are provided with the DNA of every inhabitant of Redmond and the virus’ DNA. For every inhabitant, you need to output the order in which he/she should get vaccinated. Everyone that has the same probability to get sick should get vaccinated in the same batch. For example, the order of vaccination for inhabitants with the following probability to get sick: [0.0, 0.5, 0.5, 0.0, 1.0] is: [3, 2, 2, 3, 1].

Tip. visit 1point3acres.com for more.

Here is a tip for how to get from the “Canonical Sample Input” to “Canonical Sample Output” (described below). Given the TAAT virus and its highest infection score possible mutation for persons 0 to 4, here are the longest matching mutations and the attached probability to get sick for every person:

Person #0: T, 0.250-google 1point3acres
Person #1: TAA, 0.750
Person #2: TT, 0.500
Person #3: TAAT, 1.000
Person #4: TA, 0.500
Therefore, person 3 has a 1.0 probability of getting sick, so he or she gets vaccinated first. Person 1 is the next highest, so he or she gets vaccinated second. We continue to vaccinate in batches of probability of getting sick, with person 0 getting vaccinated last because he or she has the least probability to get sick.

Note that what is described above is not the output you should generate, but a tip on how you can get to the desired output inside your code.
. From 1point 3acres bbs
Input description/format

The first line of the file contains three numbers: the number of citizens in Redmond, the length of the citizen’s DNA and the length of the virus’ DNA..鐣欏璁哄潧-涓浜-涓夊垎鍦
. Waral 鍗氬鏈夋洿澶氭枃绔,
This is followed by one sequence of DNA per line, representing in order the citizens’ DNA. The last DNA sequence of the file is the virus’ DNA.

You can assume that the virus’ DNA sequence is always shorter than the citizen’s DNA sequences.
.鏈枃鍘熷垱鑷1point3acres璁哄潧
Output description/format

The below example becomes clear if we give the “DNA match score” as well as the longest sequence of DNA matched.

Person #0: G, 0.333
. more info on 1point3acres.comPerson #1: GCC, 1.000 . 鐗涗汉浜戦泦,涓浜╀笁鍒嗗湴
Person #2: CC, 0.667
Person #3: GC, 0.667
Person #4: GC, 0.667

Person 1 has a 1.0 probability of getting sick, so he gets vaccinated first. Persons 2, 3, and 4 are the next highest probable to get sick, so they get vaccinated second. Person 0 has the least chance to get sick; he gets vaccinated last.

Example input
. visit 1point3acres.com for more.
5 10 3
AGGAAAAGAG
CGAGGCCAAC
GACAAAACCG
GCGACGCAGA
AACAGCGCAG.鏈枃鍘熷垱鑷1point3acres璁哄潧
GCC

Example output

Person #0: 3.
Person #1: 1.
Person #2: 2.
Person #3: 2.
Person #4: 2.
. from: 1point3acres.com/bbs
. From 1point 3acres bbs
头像被屏蔽
SUNYANGT 发表于 2014-10-4 01:00:28 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

aliyucun 发表于 2014-10-5 01:57:46 | 显示全部楼层
我也是拿了第一,但是还没有谁联系我...Orz.
不知道这种on campus的面试题大概是什么样子的难度?
回复 支持 反对

使用道具 举报

本版积分规则

关闭

一亩三分地推荐上一条 /5 下一条

手机版|小黑屋|一亩三分地论坛声明

custom counter

GMT+8, 2017-11-23 13:43

Powered by Discuz! X3

© 2001-2013 Comsenz Inc. Design By HUXTeam

快速回复 返回顶部 返回列表