微软2013年校园实习生招聘笔试题及答案

原文:

http://www.wangkaimin.com/2013/04/07/%e5%be%ae%e8%bd%af2013%e5%b9%b4%e6%a0%a1%e5%9b%ad%e5%ae%9e%e4%b9%a0%e7%94%9f%e6%8b%9b%e8%81%98%e7%ac%94%e8%af%95%e9%a2%98%e5%8f%8a%e7%ad%94%e6%a1%88/#more-195

1. Which of following calling convension(s) support(s) supportvariable-length parameter (e.g.printf)? (3 Points)

A. cdecl

B. stdcall

C. pascal

D. fastcall

2. What’s the output of following code? (3 Points)

class A
{public:virtual void f(){cout << “A::f()” << endl;}void f() const{cout << “A::f() const” << endl;}
};
class B:public A
{public:void f(){cout <<”B::f()” << endl;}void f() const{cout << “B::f() const” << endl;}
};void g(const A* a)
{a->f();
}int main()
{A* a = new B();a->f();g(a);delete a;
}

A. B::f() B::f() const

B. B::f() A::f() const

C. A::f() B::f() const

D. A::f() A::f() const

3. What is the difference between a linked list and an array? (3 Points)

A. Search complexity when both are sorted

B. Dynamically add/remove

C. Random access efficiency

D. Data storage type

4. About the Thread and Process in Windows, which description(s) is(are) correct:(3 Points)

A. One application in OS must have one Process, but not a necessary to have one Thread

B. The Process could have its own Stack but the thread only could share the Stack of its parent Process

C. Thread must belongs to a Process

D. Thread could change its belonging Process

5. What is the output of the following code? (3 Points)

{int x = 10 ;int y = 10 ;x = x++ ;y = ++y ;printf("%d, %d\n",x,y);
}

A. 10, 10

B. 10, 11

C. 11, 10

D. 11, 11

6. For the following Java or C# code(3 Points)

{int [][] myArray3 =new int[3][]{new int[3]{5,6,2},new int[5]{6,9,7,8,3},new int[2]{3,2}};
}

What will myArray3[2][2]

returns?

A. 9

B. 2

C. 6

D. overflow

7. Please choose the right statement about const usage:(3 Points)

A. const int a; //const integer

B. int const a; //const integer

C. int const *a; //a pointer which point to const integer

D. const int *a; //a const pointer which point to integer

E. int const *a; // a const pointer which point to integer

8. Given the following code:(3 Points)

#includeclass A{public:long a;
};class B : public A
{public:long b;
};void seta(A* data, int idx)
{data[idx].a = 2;
}int _tmain(int argc, _TCHAR *argv[])
{B data[4];for(int i=0; i<4; ++i){data[i].a = 1;data[i].b = 1;seta(data, i);}for(int i=0; i<4; ++i){std::cout << data[i].a << data[i].b;}return 0;
}

What is the correct result?

A. 11111111

B. 12121212

C. 11112222

D. 21212121

E 22221111

B data[4];连开64个字节空间 传进函数后强转成A*也就是加法操作每次移动的是sizeof(A)也就是8个字节 而B本身是16个字节 就相当于四次把前两个B的32个字节的值全都赋成了2 于是22221111

9. 1 of 1000 bottles of water is poisoned which will kill a rat in 1 week if the rat drunk any amout of the water. Given the bottles of water have no visual difference, how many rats are needed at least to find the poisoned one in 1 week?(5 Points)

A. 9

B. 10

C. 32

D. None of the above

海明码校验位的原理,2^r>=n+1即可

10. Which of the following statement(s) equal(s) value 1 in C programming language?(5 Points)

A. the return value of main function if program ends normally

B. return (7&1)

C. char *str=”microsoft”; return str==”microsoft”

D. return “microsoft”==”microsoft”

E. None of the above

11. If you computed 32 bit signed integers F and G from 32 bit signed integer X using F = X/2 and G = (X >> 1), and you found F != G, this implies that (5 Points)

A. There is a comlier error

B. X is odd

C. X is negative

D. F – G = 1

E. G – F = 1

12. How many rectangles you can find from 3*4 grid?(5 Points)

A. 18

B. 20

C. 40

D. 60

E. None of above is correct

13. One line can split a surface to 2 part, 2 line can split a surface to 4 part. Given 100 lines, no two parallel lines, no tree lines join at same point, how many parts can 100 line split?(5 Points)

A. 5051

B. 5053

C. 5510

D. 5511

14. Which of the following sorting algorithm(s) is(are) stable sorting?(5 Points)

A. bubble sort

B. quick sort

C. heap sort

D. merge sort

E. Selection sort

15. Model-View-Controller(MVC) is an architectural pattern that frequently used in web applications. Which of the following statement(s) is(are) correct:(5 Points)

A. Models often represent data and the business logics needed to manipulate the data in the application

B. A view is a (visual) representation of its model. It renders the model into a form suitable for interaction, typically a user interface element

C. A controller is the link between a user and the system. It accepts input from the user and instructs the model and a view to perform actions based on that input

D. The common practice of MVC in web applications is, the model receives GET or POST input from user and decides what to do with it, handing over to controller and which hand control to views(HTML-generating components)

E. None of the above

16. we can recover the binary tree if given the output of(5 Points)

A. Preorder traversal and inorder traversal

B. Preorder traversal and postorder traversal

C. Inorder traversal and postorder traversal

D. Postorder traversal

17. Given a string with n characters, suppose all the characters are different from each other, how many different substrings do we have?(5 Points)

A. n+1

B. n^2

C. n(n+1)/2

D. 2^n-1

E. n!

看对substring怎么理解了。如果理解成subsequence就是D。不然是C

18. Given the following database table, how many rows will the following SQL statement update?(5 Points)

微软2013年校园实习生招聘笔试18题

A. 1

B. 2

C. 3

D. 4

E. 5

19. What is the shortest path between node S and node T, given the graph below? Note: the numbers represent the lengths of the connected nodes.(13 Points)

微软2013年校园实习生招聘笔试19题

A. 17

B. 18

C. 19

D. 20

E. 21

20. Given a set of N balls and one of which is defective (weighs less than others), you are allowed to weigh with a balance 3 times to find the defective. Which of the following are possible N?(13 Points)

A. 12

B. 16

C. 20

D. 24

E. 28

1 A
2 B
3 ABC
4 C
5 D
6 D
7 ABC
8 -//没答案,应该是22221111
9 B
10 B
11 C
12 D
13 A
14 AD
15 AC
16 AC
17 C
18 B
19 D
20 ABCD

tongji.gif

转载于:https://www.cnblogs.com/passby/p/3385230.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/274123.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Android 第七课 4种基本布局之FrameLayout和百分比布局

FrameLayout&#xff08;帧布局&#xff09;&#xff0c;她没有方便的定位方式&#xff0c;所有的控件都会默认摆放在布局的左上角。 修改activity_main.xml中的代码&#xff0c;如下&#xff1a; <?xml version"1.0" encoding"utf-8"?> <Frame…

mongodb 群集图_群集和重叠条形图

mongodb 群集图为什么和如何 (Why & How) 1.- Clustered Bar Charts1.- 集群条形图 AKA: grouped, side-by-side, multiset [bar charts, bar graphs, column charts]AKA &#xff1a;分组&#xff0c;并排&#xff0c;多组[条形图&#xff0c;条形图&#xff0c;柱形图] …

Android 第八课 创建自定义控件

常用控件和布局的继承结构&#xff0c;如下图&#xff1a; &#xff08;待续。。。。&#xff09; 所有的控件都是直接或间接继承自View的&#xff0c;所用的所有布局都是直接或间接继承自ViewGroup的&#xff0c;View是Android中最基本的一种UI组件&#xff0c;它可以在屏幕上…

figma下载_搬到Figma对我意味着什么

figma下载A couple of years ago, amidst the boom of new design and prototyping software, I was pretty reluctant to fight on the Figma/Sketch cold war. I was working on a relatively small design team and, after years helping to design products, well sold on …

Android 第九课 常用控件-------ListView

ListView允许用户通过手指上下滑动的方式将屏幕外的数据滚动到屏幕内&#xff0c;同时屏幕上原有数据将会滚动出屏幕。 1、ListView简单用法 如何将ListView将你要显示的大量内容关联起来呢&#xff1f;这是个很重要的问题。 1、首先我们必须先将数据提供好&#xff0c;因为你的…

浅析SQL Server 2005中的主动式通知机制

一、引言 在开发多人同时访问的Web应用程序&#xff08;其实不只这类程序&#xff09;时&#xff0c;开发人员往往会在缓存策略的设计上狠下功夫。这是因为&#xff0c;如果将这种环境下不常变更的数据临时存放在应用程序服务器或是用户机器上的话&#xff0c;可以避免频繁地往…

Android 第十二课 使用LitePal操作数据库(记得阅读最后面的注意事项哦)

一、LitePal简介 1、(新建项目LitePalTest)正式接触第一个开源库---LitePalLitePal是一款开源的Android 数据库框架&#xff0c;它采用了对象关系映射&#xff08;ORM&#xff09;的模式。2、配置LitePal&#xff0c;编辑app/build.gradle文件&#xff0c;在dependencies闭包中…

解决关于登录校园网显示不在IP段的问题方案(要看注意事项哦!)

有时&#xff0c;登录校园网&#xff0c;账号和密码都显示正确&#xff0c;但是却显示出“账号只能在指定IP段登录”的问题。 那我们就提供了一个解决方案&#xff1a; 使用WinR,并在输入框&#xff0c;输入cmd命令&#xff1a;&#xff08;如下&#xff09;接着输入&#xff1…

页面返回顶部(方法比较)

下面就说下简单的返回顶部效果的代码实现&#xff0c;附注释说明。 1. 最简单的静态返回顶部&#xff0c;点击直接跳转页面顶部&#xff0c;常见于固定放置在页面底部返回顶部功能 方法一&#xff1a;用命名锚点击返回到顶部预设的id为top的元素 html代码 <a href"#top…

微信公众平台的服务号和订阅号

微信公众平台 服务号 订阅号 作者&#xff1a;方倍工作室 地址&#xff1a;http://www.cnblogs.com/txw1958/p/ServiceNumber-subscriptionNumber.html 什么是服务号&#xff1f; 服务号给企业和组织提供更强大的业务服务与用户管理能力&#xff0c;帮助企业快速实现全新的公众…

Android 第十七课 碎片的简单用法及动态添加碎片

Fragment(碎片)是一种可以嵌入在活动当中的UI片段&#xff0c;它可以让程序更加合理和充分的利用大屏幕的空间。碎片和活动太像了&#xff0c;同样都包含布局&#xff0c;都有自己的声明周期&#xff0c;可以将碎片理解为一种迷你型的活动。 新建FragmentTest项目。假设项目已经…

在Linux下禁用键盘、鼠标、触摸板(笔记本)等输入设备

在Linux系统下禁用键盘、触摸板、鼠标等输入设备&#xff0c;可以通过xinput命令来实现&#xff1a;主要涉及&#xff1a;#xinput list#xinput list-props list-number#xinput set-prop list-number func-number 1/0具体操作如下&#xff1a;step1&#xff1a;查看系统中有那些…

委托又给我惹麻烦了————记委托链的取消注册、获取返回值

今天改bug碰到了一个问题&#xff0c;有多个方法注册到了一个事件里去&#xff0c;而这些方法本身又有点儿互斥&#xff0c;因而造成了bug&#xff0c;哥调试半天才发现&#xff0c;郁闷至极&#xff0c;遂复习了以前的知识并进行适当延伸&#xff0c;再将成果记录及分享之&…

Android 第十八课 强大的滚动控件 RecyclerView

步骤&#xff1a; 一、添加依赖库compilecom.android.support:recyclerview-v7:26.1.0 二、在activity_mian.xml中&#xff0c;添加RecyclerView控件&#xff0c;并占据整个页面。 三、把你要在RecyclerView中展示的内容&#xff0c;设置成一个实体类Fruit&#xff0c;接着为Re…

ios即时通讯客户端开发之-mac上安装MySQL

一、安装 到MySQL官网上http://dev.mysql.com/downloads/mysql/&#xff0c;下载mysql可安装dmg版本 比如&#xff1a;Mac OS X ver. 10.7 (x86, 64-bit), DMG Archive 下载完的文件为&#xff1a;mysql-5.6.10-osx10.7-x86_64.dmg 1.点击&#xff0c;安装包里的 2.点击安装 安…

dbus 和 policykit 实例篇(python)

dbus 和 policykit 实例篇&#xff08;python&#xff09; 使用policykit 的程序一般都有一个dbus daemon程序来完成相关操作&#xff0c;这个dbus daemon 会在系统注册一个system bus 服务名&#xff0c;用于响应要求root privileged的操作&#xff0c;当dbus请求到达时会先验…

和菜鸟一起学linux之DBUS基础学习记录

转自&#xff1a;http://blog.csdn.net/eastmoon502136/article/details/10044993 D-Bus三层架构 D-Bus是一个为应用程序间通信的消息总线系统, 用于进程之间的通信。它是个3层架构的IPC 系统&#xff0c;包括&#xff1a; 1、函数库libdbus &#xff0c;用于两个应用程序互…

Android 第二十课 广播机制(大喇叭)----发送自定义广播(包括发送标准广播和发送有序广播)

广播分为两种类型&#xff1a;标准广播和有序广播 我们来看一下具体这两者的具体区别&#xff1a; 1、发送标准广播 我们需要先定义一个广播接收器来准备接收此广播才行&#xff0c;否则也是白发。 新建一个MyBroadcastReceiver,代码如下&#xff1a; package com.example.broa…

八大排序算法

概述 排序有内部排序和外部排序&#xff0c;内部排序是数据记录在内存中进行排序&#xff0c;而外部排序是因排序的数据很大&#xff0c;一次不能容纳全部的排序记录&#xff0c;在排序过程中需要访问外存。 我们这里说说八大排序就是内部排序。 当n较大&#xff0c;则应采用…

Android 第二十一课 RecyclerView简单的应用之编写“精美”的聊天页面

1、由于我们会使用到RecyclerView&#xff0c;因此首先需要在app/build.gradle当中添加依赖库。如下&#xff1a; apply plugin: com.android.application .... dependencies {....compile com.android.support:recyclerview-v7:26.1.0 } 2、然后开始编写主页面&#xff0c;修该…