微软暑期实习招聘笔试题目_第1页
微软暑期实习招聘笔试题目_第2页
微软暑期实习招聘笔试题目_第3页
微软暑期实习招聘笔试题目_第4页
微软暑期实习招聘笔试题目_第5页
已阅读5页,还剩10页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

第页共页微软暑期实习招聘笔试题目微软暑期实习招聘笔试题目总共20道选择题,全部不定项,微软暑期实习招聘笔试题目。总分100分,时间75分钟。去年时间是90分钟的。。1~8,做对3分,半对2分,错误-2分,不做0分9~18,做对5分,半对3分,错误-3分,不做0分19~20,做对13分,半对7分,错误-7分,不做0分1、关于支持不定数量参数的方法(supportvariableparameters)有哪些?(cdecl,stdcall,pascal,fastcall)cdecl只有这一个。2、以下代码输出的结果是:[cpp]viewplaincopyprint?1.classA2.{3.public:4.virtualvoidf5.{6.cout<<“A::f”<7.}8.voidfconst9.{10.cout<<“A::fconst”<11.}12.};13.14.classB:publicA15.{16.public:17.virtualvoidf18.{19.cout<<“B::f”<20.}21.voidfconst22.{23.cout<<“B::fconst”<24.}25.};26.27.voidg(constA*a)28.{29.a-》f;30.}31.32.intmain33.{34.A*b=newB;35.b-》f;36.g(b);37.return0;38.}答案为:[cpp]viewplaincopyprint?1.B::fA::fconst第一个b-》f为动态绑定,输出B::f没问题,第二个,目前还没弄明白,感觉是由于函数g的参数有const,所以调用成员函数也是调用const版本,但是const版本的不是虚函数,不存在动态绑定,所以输出A::fconst。3、linkedlist和array的区别,链表与数组的区别。Whatisthedifferencebetweenalinkedlistandanarray?(3Points)A.SearchplexitywhenbotharesortedB.Dynamicallyadd/removeC.RandomaccessefficiencyD.Datastoragetype4、线程Thread和进程Process的区别(以下关于...和...说法正确的选项是?)好似是指明了windows下的。AbouttheThreadandProcessinWindows,whichdescription(s)is(are)correct:(3Points)A.OneapplicationinOSmusthaveoneProcess,butnotanecessarytohaveoneThreadB.TheProcesscouldhaveitsownStackbutthethreadonlycouldsharetheStackofitsparentProcessC.ThreadmustbelongstoaProcessD.ThreadcouldchangeitsbelongingProcess5、更奇葩的:[cpp]viewplaincopyprint?1.inti=10,j=10;2.i=i++;3.j=++j;4.cout<问输出结果:使用g++编译,直接警告这是未定义的。。。当然也给出了结果11,11.使用vc编译,没有任何警告,结果也是11,11.6、给一个二维数组,求数组的[x][y]是多少(x,y是确定的数字)?Java/C#下的ForthefollowingJavaorC#code(3Points)[java]viewplaincopyprint?1.int[][]myArray3=2.newint[3][]{3.newint[3]{5,6,2},4.newint[5]{6,9,7,8,3},5.newint[2]{3,2}};WhatwillmyArray3[2][2]returns?A.9B.2C.6D.overflow答案是D越界。7、关于constintx和constint*x和intconstx的注释表述是否正确。Pleasechoosetherightstatementaboutconstusage:(3Points)A.constinta;//constintegerB.intconsta;//constintegerC.intconst*a;//apointerwhichpointtoconstintegerD.constint*a;//aconstpointerwhichpointtointegerE.intconst*a;//aconstpointerwhichpointtointegerAB选项忘记初始化了,但是描绘正确的选项是ABC,自己查查资料吧。8、以下代码输出的结果是:[cpp]viewplaincopyprint?1.classC2.{3.public:4.longa;5.};6.7.classD:publicC8.{9.public:10.longb;11.};12.13.voidseta(C*data,intindex)14.{15.data[index].a=2;16.}17.18.intmain19.{20.Ddata[4];21.cout<22.for(inti=0;i<4;++i)23.{24.data[i].a=1;25.data[i].b=1;26.seta(data,i);27.}28.for(inti=0;i<4;++i)29.{30.cout<31.}32.return0;33.}答案:22221111.这个做错了。。。觉得不可能这么简单,果然有猫腻。seta中,参数是基类C类型的指针,然后挪动指针取对象并赋值,但是main中往函数seta中传递的是派生类的对象,所以对象被截取了。。再按照基类去取对象,只取出了一局部自己渐渐体会吧。。9、1000瓶中有1瓶毒药,喂老鼠,问至少多少只老鼠,才能识别毒药?1of1000bottlesofwaterispoisonedwhichwillkillaratin1weekiftheratdrunkanyamoutofthewater.Giventhebottlesofwaterhavenovisualdifference,howmanyratsareneededatleasttofindthepoisonedonein1week?(5Points)A.9B.10C.32D.Noneoftheabove(2n》1000),n=10即可,资料共享平台《微软暑期实习招聘笔试题目》(s://..)。10.以下代码输出值为1的是?(其中选项有return1-7,return“ab”==“ab”)Whichofthefollowingstatement(s)equal(s)value1inCprogramminglanguage?(5Points)B.return(7-1)C.char*str=“microsoft”;returnstr==“microsoft”D.return“microsoft”==“microsoft”E.Noneoftheabove1-7=1;____c下会对“ab”==“ab”警告:比拟字面值是未定义的行为。但是结果也给出1.还有一项为哪一项:char*s=“abc”;returns==“abc”;测试发现一般编译器都会优化,但是g++会警告。。但。。。。但是,这是微软的笔试。。11、32位有符号数x,x/2不等于x》》1的情况?Ifyouputed32bitsignedintegersFandGfrom32bitsignedXusingF=X/2andG=(X》》1),andyoufoundF!=G,thisimpliesthatA.ThereisapilererrorB.XisoddC.XisnegativeD.F-G=1E.G-F=112、3*4的表格grid,可能找出多少个方框?(60)Howmanyrectanglesyoucanfindfrom3*4grid?A.18B.20C.40D.60E.Noneofaboveiscorrect13、一条直线可以将平面(surface)分2局部,2条可以分4局部,问100条可以分多少局部?Onelinecansplitasurfaceto2part,2linecansplitasurfaceto4part.Given100lines,notwoparallellines,notreelinesjoinatsamepoint,howmanypartscan100linesplit?A.5051B.5053C.5510D.5511自己画画吧,我当时没读懂题意,空着。。微软的`surface。。split。。被自己切n多片儿(感谢您飞侠桑提供~)14、稳定的排序方法?(冒泡排序、____、堆排序、希尔排序、归并排序)Whichofthefollowingsortingalgorithm(s)is(are)stablesorting?A.bubblesortB.quicksortC.heapsortD.mergesortE.Selectionsort15、关于MVC中M、V、C的职责描绘Model-View-Controller(MVC)isanarchitecturalpatternthatfrequentlyusedinwebapplications.Whichofthefollowingstatement(s)is(are)correct:A.ModelsoftenrepresentdataandthebusinesslogicsneededtomanipulatethedataintheapplicationC.Acontrolleristhelinkbetweenauserandthesystem.ItacceptsinputfromtheuserandinstructsthemodelandaviewtoperformactionsbasedonthatinputD.ThemonpracticeofMVCinwebapplicationsis,themodelreceivesGETorPOSTinputfromuseranddecideswhattodowithit,handingovertocontrollerandwhichhandcontroltoviews(HTML-generatingponents)E.Noneoftheabove16、二叉树的复原(必需要有中序,外加其他的任一一个)wecanrecoverthebinarytreeifgiventheoutputofA.PreordertraversalandinordertraversalB.PreordertraversalandpostordertraversalC.InordertraversalandpostordertraversalD.Postordertraversal17、n长度的string,求它substring子串的个数。Givenastringwithncharacters,supposeallthecharactersaredifferentfromeachother,howmanydifferentsubstringsdowehave?A.n+1B.n2C.n(n+1)/2D.2n-1E.n!请弄清楚substring的定义。好似我错了。。18、sql执行,影响的结果条数?(涉及in、group、sum、having关键字)Giventhefollowingdatabasetable,howmanyrowswillthefollowingSQLstatementupdate?(5Points)updatebookset

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论