当前位置: 首页 > 编程日记 > 正文

微软2014校园招聘笔试试题

转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807
1、Which statement(s) is(are) correct about thread and process?Select all that apply.(5 Points)
A、Threads share the same address space of the parent process;Processes share the same address space of the parent process.
B、Changes to the main thread(cancellation,priority change,etc.) may affect the behavior of the other threads of the process; Changes to the parent process does not affect child processes.
C、Multiple threads mar cause deadlock,while multiple processes won't cause deadlock.
D、Threads can directly communicate with other threads of its process; Processes must use inter-process communication to communicate with sibling processes.
E、None of the above.


2、Which statement(s) below regarding TCP(Transmission Control Protocol) is(are) correct? Select all that apply.(5 Points)
A、TCP provides a way for applications to send encapsulated IP datagrams and send them without having to establish a connection.
B、TCP supports multicasting.
C、Port numbers below 1024 are called well-known ports and are reserved for standard services. For example,port 21 is reserved for FTP protocol, and port 25 is for SMTP protocol.
D、TCP handles package loss reliably.
E、None of the above.

3、Initialize integer i as 0, what's the value of i after the following operation?(5 Points)

i += i > 0 ? i++ : i --;

A、-2
B、-1
C、0
D、1
E、2

4、Which of the follwing sequence(s) could not be a postorder tree walk result of a binary search tree?(5 Points)
A、1,2,3,4,5
B、3,5,1,4,2
C、1,2,5,4,3
D、5,4,3,2,1

5、When a dll is loaded into memory, which part(s) can be shared between processes?(5 Points)
A、code segment
B、static variable
C、global variable
D、external difinitions and references for linking

E、BSS segment

6、How many times is f() called when calculating f(10)?(5 Points)

int f(int x)
{if(x <= 2)return 1;return f(x - 2) + f(x - 4) + 1;
}
A、14
B、18
C、20
D、24
E、None of the above.

7、Asume you have an object to describe customer data:(5 Points)
{
  ID(7 digit numeric)
  Family Name(string)
  Account Balance(currency)
}
If you have 500,000 Chinese customers records represented by instances of this object type , what set of data structures is best to get fast retrieval of customers (1) get IDs from Name and (2) get Name from ID?
A、(1) Tree with Hash(100 bucket) at leaves(2) Tree with linked list at leaves.
B、(1) Tree with linked list at leaves(2) Array.
C、(1) Tree with linked list at leaves(2) Hash(10,000 buckets)
D、(1) Sort linked list(2) Array.

8、Let's assume one type of cancer may be mis-diagnosed in the examination. 5 out of 100 people with this cancer will be diagnosed as not having it , and 1 out of 100 people without this cancer will be diagnosed as having it. We know the chance of getting this cancer is around 0.1%. One person was examined and diagnosed of having this cancer, which of the following value if the closest to the chance of is really having it?(5 Points)
A、90%
B、50%
C、30%
D、10%

9、In which case(s) would you use an outer join?(5 Points)
A、The table being joined have NOT NULL columns.

B、The table being joined have only matched data.
C、The columns being joined have NULL values.
D、The table being joined have only unmatched data.
E、The table being joined have both matched and unmatched data.

10、As shown in the graph , start from node B , traverse the nodes on a Depth-First Search(DFS) algorithm , which is(are) the possible traversa sequence(s)? Select all that apply.(5 Points)


A、BADECF
B、BADEFC
C、BCAFDE
D、BCFDEA
E、BFDECA

11、The best time complexity of quick sort algorithm is:(5 Points)
A、O(lgn)
B、O(n)
C、O(nlgn)
D、O(n*n)

12、Which of the following method(s) CANNOT be used for Text-encryption:(5 Points)
A、MD5
B、RSA
C、RC4
D、DES

MD5是不可逆加密,不能够用来加密文本,DES和RC4是对称加密,RSA是不正确称加密,都能够用于文本加密。
13、To speed up data access , we build cache system. In one system , The L1 cache access time is 5 ns , the L2 cache access time is 50 ns and the memory access time is 400 ns. The L1 cache miss rate is 50% , the L2 cache miss rate is 10%. The average data access time of this system is:(5 Points)
A、5
B、30
C、45
D、50
E、55

14、Which is(are) valid function pointer declaration(s) below ? Select all that apply.(5 Points)
A、void* f(int);
B、int (*f)();
C、void (*f(int , void(*)(int)))(int);
D、void (*(*f)(int))();


15、Which of the following method(s) could be used to optimize the speed of a program ? (5 Points)
A、Improve memory access pattern to decrease cache misses.
B、Use special instructions(e.g. vector instructions) to replace compiler generated assembly code.
C、Change an algorithm from recursive implementation to iterative implementation.

D、Loop unwinding.

16、Which regular expression(s) matches the sentence "www.microsoft.com" ? (5 Points)
A、^\w+\.\w+\.\w+$
B、[w]{0,3}.[a-z]*.[a-z]+
C、.[c-w.]{3,10}[.][c-w.][.][a]|.+

D、[w][w][w][microsoft]+[com]+
E、\w*

17、In the image below , if the function is designed to multiply two positive numbers which line number in the image contains the biggest functional bug(assume no overflow)? (5 Points)


A、Line 1
B、Line 2
C、Line 3
D、Line 4
E、Line 5

18、Which of the following can be referred to as attack method(s)? Select all that apply.(5 Points)
A、Vulnerability scan
B、SQL Injection
C、Drive-by downloading

D、Brute force

19、A table CANNOT have one or more of the following index configurations.(5 Points)
A、No indexes
B、A clustered index
C、clustered index and many non-clustered indexes
D、Many clustered index


20、Which of the following is(are) true about providing security to database servers ? Select all that apply.(5 Points)
A、Do not host a database server on the same server as your web server
B、Do not host a database server on a server based system
C、Do not use blank password for SA account

D、Employ a centralized administration model

第二部分測试时间为60分钟,满分50分。请务必在回答问题前细致阅读变成题目。您能够选用C、C++、C#或者Java 当中不论什么一种编程语言,而且保证您的代码能够正确编译和有正确的结果。另外,请一定要注意您的代码的质量。
21、Given a singly linked list L: (L0 , L1 , L2...Ln-1 , Ln). Write a program to reorder it so that it becomes(L0 , Ln , L1 , Ln-1 , L2 , Ln-2...).

struct Node
{int val_;Node* next;
};
Notes:
1、Space Complexity should be O(1) 
2、Only the ".next" field of a node is modifiable.
代码:

//转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807
struct Node
{  int val_;  Node* next;  
};
Node* reverse_list(Node* phead)   //链表反转
{Node *temp ,*curr , *pre , *reverse_head;pre = NULL;curr = phead;while(curr->next){temp = curr->next;curr->next = pre;pre = curr;curr = temp;}curr->next = pre;reverse_head = curr;return reverse_head;
}Node* Merge(Node* slow , Node* fast)
{if(fast == NULL)return slow;if(slow == NULL)return fast;Node *head , *result;result = NULL;int i = 0;while(slow && fast){if(0 == i){if(NULL == result){head = result = slow;slow = slow->next;}else{result->next = slow;slow = slow->next;result = result->next;}}else{if(NULL == result){head = result = fast;fast = fast->next;}else{result->next = fast;fast = fast->next;result = result->next;}}i ^= 1;}//whileif(slow){result->next = slow;}if(fast){result->next = fast;}return head;
}Node* reorder_list(Node* phead)
{Node *r_head , *slow , *fast;r_head = slow = fast = phead;while(fast->next != NULL && fast->next->next != NULL){slow = slow->next;fast = fast->next->next;}if(slow->next == NULL)return r_head;fast = slow->next;slow->next = NULL;slow = phead;fast = reverse_list(fast);      //链表的后半部分反转r_head = Merge(slow , fast);    //链表归并return r_head;
}

转载请标明出处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807












转载请标明出处处,原文地址:http://blog.csdn.net/hackbuteer1/article/details/12190807



转载于:https://www.cnblogs.com/yxwkf/p/3855101.html

相关文章:

vi(vim)快捷键小记

1、前言 vi是“visual interface”的缩写&#xff0c;vim是vi IMproved(增强版的vi)。总结一下自己平时常用的vim快捷键&#xff0c;当是忘记也好&#xff0c;后续会不定期更新。 2、vim 快捷键 快捷键说明vi[m] file打开[新建]文件命令模式可以移动光标、删除字符等h,j,k,l左…

Premiere Pro2.0用DebugMode2.3搭桥小日本4.0输出图解

看图说话&#xff0c;不懂的多试试看首先明确几点&#xff1a;1。3个软件&#xff1a;Premiere Pro2.0、DebugMode&#xff08;帧服务器&#xff09;、小日本&#xff08;TMPGEnc 4.0 XPress&#xff09;2。渲染过程是在小日本中完成&#xff0c;与DebugMode无关&#xff0c;De…

用例点度量方法介绍

用例点度量方法分为6个步骤&#xff0c;分别是 step 1:计算未调整前的角色(执行者)权重 将角色按照复杂程度分为3类&#xff0c;具体如下 则本例中 UAW1121329 计算未调整前的用例权重UUC 有三种评估用例复杂程度的方法&#xff0c;具体如下 以下是用例权重评估表(普通那…

NYOJ——街区最短路径问题

街区最短路径问题 时间限制&#xff1a;3000 ms | 内存限制&#xff1a;65535 KB难度&#xff1a;4描述一个街区有很多住户&#xff0c;街区的街道只能为东西、南北两种方向。住户只可以沿着街道行走。各个街道之间的间隔相等。用(x,y)来表示住户坐在的街区。例如&#xff08…

Git 中常用的 4 个命令

使用 Git 进行版本管理时&#xff0c;肯定不只做提交&#xff0c;有时候也会需要回退修改&#xff0c;并且在回退的基础上进行重新提交&#xff0c;这时候有几个常用的命令就需要用到了&#xff0c;下面分别做介绍。 1、查看提交日志 首先&#xff0c;我们查看当前提交记录的命…

7月17日 晴

小懒猫&#xff0c;太阳晒PP拉Mua转载于:https://www.cnblogs.com/loverain/archive/2008/07/17/1244992.html

AS更改初始布局遇到的问题

将所有的simple.xml.ftl的内容都改成 <?xml version"1.0" encoding"utf-8"?> <LinearLayout xmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_parent"android:layout_height"…

android Json解析详解

JSON的定义&#xff1a; 一种轻量级的数据交换格式&#xff0c;具有良好的可读和便于快速编写的特性。业内主流技术为其提供了完整的解决方案&#xff08;有点类似于正则表达式 &#xff0c;获得了当今大部分语 言的支持&#xff09;&#xff0c;从而可以在不同平台间进行数据交…

[二]Java虚拟机 jvm内存结构 运行时数据内存 class文件与jvm内存结构的映射 jvm数据类型 虚拟机栈 方法区 堆 含义...

前言简介 class文件是源代码经过编译后的一种平台中立的格式 里面包含了虚拟机运行所需要的所有信息,相当于 JVM的机器语言 JVM全称是Java Virtual Machine ,既然是虚拟机,他终归要运行在物理机上 在操作系统中体现出来的也就是一个进程 操作系统会给他分配资源,割一块内存作为…

import android.support.v7.widget.RecyclerView失败

换成 androidx.recyclerview.widget.RecyclerView 参考文章 https://blog.csdn.net/u013183608/article/details/89428611/

CrackMe_001

本系列文章的目的是从一个没有任何经验的新手的角度(其实就是我自己)&#xff0c;一步步尝试将160个CrackMe全部破解&#xff0c;如果可以&#xff0c;通过任何方式写出一个类似于注册机的东西。 其中&#xff0c;文章中按照如下逻辑编排&#xff08;解决如下问题&#xff09;&…

用javascript实现的纵版飞行射击游戏—《天机》

花了一个半月的时间用javascript完成了这款web版飞行射击游戏&#xff0c;游戏效果接近一般的客户端游戏&#xff0c;不过对机器的要求稍微高点点&#xff0c;主要是CPU&#xff0c;最好在1.5GHZ以上&#xff0c;不然可能会比较卡&#xff0c;支持IE、FF、Opera、safari。 用ja…

对分组交换(packet switching)高效迅速灵活可靠四个优点的理解

1.什么是分组&#xff1f; 通信过程中要发送的整块数据被称为一个报文(message)&#xff0c;报文被划分为一个个更小的等长数据段&#xff0c;每个数据段前加入一些由必要的控制信息组成的首部后&#xff0c;就构成了一个分组。分组是在互联网中传送的数据单元(长报文&#xff…

06、ActivationDeactivation

1、将App.xaml中的StartupUri"MainWindow.xaml"删除。 2、使用NuGet安装Prism.Wpf、Prism.Core、Prism.Unity。 3、添加类“Bootstrapper”&#xff0c;编辑如下&#xff1a; 1 using System;2 using System.Collections.Generic;3 using System.Linq;4 using System…

Git 学习笔记一

Git的基本配置和使用 一、git add ;git commit;git commit -a(默认跟踪修改直接提交(不包括新文件))。 二、tig命令 查看修改记录的前端工具&#xff0c;方面查看修改记录。相当于git log –p。 三、git config --global alias.ci "commit -a -v"添加命令别名&#x…

vb 取得计算机名及目录

Public gCompName 取得计算机名及Windows目录 Dim i% Dim c$ Dim cSql As String Dim cProduct As String c Space(256) i GetComputerName(c, 256) gCompName Trim(c) gCompName Left(gCompName, Len(gCompName) - 1) 读取MAC地址 Dim…

速率单位和信息量单位区分

网络技术钟的速率指的是数据的传送速率&#xff0c;也称为数据率或比特率。 单位是bit/s 比特每秒 也写作b/s 或bps(bit per second) 当数据率较高时 常常在bit/s前面加一个字母&#xff0c;如 k 10^3 M 10^6 G 10^9 T 10^12 P 10^15 …… 数据量往往用字节B作为度量单位…

python 自动生成C++代码 (代码生成器)

python 代码自动生成的方法 &#xff08;代码生成器&#xff09; 遇到的问题 工作中遇到这么一个事&#xff0c;需要写很多C的底层数据库类&#xff0c;但这些类大同小异&#xff0c;无非是增删改查&#xff0c;如果人工来写代码&#xff0c;既费力又容易出错&#xff1b;而借用…

WPF实用指南二:移除窗体的图标

原文:WPF实用指南二&#xff1a;移除窗体的图标WPF没有提供任何功能来移除窗体上的icon图标。一般的做法是设置一个空白的图标&#xff0c;如下图1: 这种做法在窗体边框与标题之间仍然会保留一片空白。比较好的做法是使用Win32API提供的函数来移除这个图标。使用如下的代码&…

什么是EAI?

什么是EAI(enterprise application integration)企业应用集成? EAI是将基于各种不同平台、用不同方案建立的异构应用集成的一种方法和技术。EAI通过建立底层结构&#xff0c;来联系横贯整个企业的异构系统、应用、数据 源等&#xff0c;完成在企业内部的 ERP、CRM、SCM、数据库…

C# 中的委托和事件

引言 委托 和 事件在 .Net Framework中的应用非常广泛&#xff0c;然而&#xff0c;较好地理解委托和事件对很多接触C#时间不长的人来说并不容易。它们就像是一道槛儿&#xff0c;过了这个槛的人&#xff0c;觉得真是太容易了&#xff0c;而没有过去的人每次见到委托和事件就觉…

零代价修复海量服务器的内核缺陷——UCloud内核热补丁技术揭秘

下述为UCloud资深工程师邱模炯在InfoQ架构师峰会上的演讲——《UCloud云平台的内核实践》中非常受关注的内核热补丁技术的一部分。给大家揭开了UCloud云平台内核技术的神秘面纱。 如何零代价修复海量服务器的Linux内核缺陷&#xff1f; 对于一个拥有成千上万台服务器的公司&…

软件工程技术基础-(软件复用技术)

软件可重用问题&#xff0c;包括源程序代码重用、静态库重用和组建重用。 源程序代码重用是直接将其他项目或系统开发完成的代码复制过来&#xff0c;直接使用。 限制源程序代码重用技术使用的关键因素是要考虑代码的语言实现&#xff0c;以及源代码 公开可能带来的知识产权问题…

Parcelable与Serializable的比较

Parcel: Android中的序列化方式&#xff0c;可用于跨进程传输 Parcelable 进程间 如&#xff1a;想从一个第三方app拿进程回来 Serializable 进程内

20140725 快速排序时间复杂度 sTL入门

1、快速排序的时间复杂度(平均时间复杂度为) 数组本身就有序时&#xff0c;效果很差为O(n^2) 2、STl入门 &#xff08;1&#xff09; C内联函数(inline)和C中宏(#define)区别 内联函数有类型检查&#xff0c;宏定义没有&#xff1b;C编程尽量使用内联函数 template <class T…

小编带你进入强如 Disruptor 也发生内存溢出?

前言OutOfMemoryError 问题相信很多朋友都遇到过&#xff0c;相对于常见的业务异常&#xff08;数组越界、空指针等&#xff09;来说这类问题是很难定位和解决的。 本文以最近碰到的一次线上内存溢出的定位、解决问题的方式展开&#xff1b;希望能对碰到类似问题的同学带来思路…

数据库反规范设计

< DOCTYPE html PUBLIC -WCDTD XHTML StrictEN httpwwwworgTRxhtmlDTDxhtml-strictdtd> 反规范化设计 为了提升性能而使用反规范化设计 常用方法&#xff1a; A、在多个表中存储某个字段的副本 B、在父表中存储汇总值 C、将活动数据和历史数据分开存储 D、应用程序本地缓…

安卓的两种界面编写方式对比

1.XML进行描述 优点是可以直接在Android studio Preview 栏中查看效果(所见即所得&#xff0c;但是不是所有的都可以立刻看到效果) 注意&#xff1a;包含两种方式-编辑layout文件夹下的XML文件 和 直接从下图的图形化界面操作 2.Java/Kotlin代码进行编写 随着学习的深入&#x…

对象***已断开连接或不在该服务器上 的解决方案之一

使用VS2008在发布网站的时候&#xff0c;出现了这样的一个错误&#xff0c;先前一直是OK的。网上找了老半天&#xff0c;几乎没有此问题的解决办法。很是郁闷。只能一个一个地进行编译。单个层Build是OK的&#xff0c;整个Solution的Rebuild也是OK的&#xff0c;一开始使用VS自…