微软2013暑假实习生笔试题

2023-11-18

自己mark一下,以作后备。下面提交原文链接

原文博客


部分题目答案不确定,会持续更新……

1. Which of the following calling convention(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 the following code?(3 Points)

[cpp]  view plain copy
  1. class A  
  2. {  
  3. public:  
  4.     virtual void f()  
  5.     {  
  6.         cout<<"A::f()"<<endl;  
  7.     }  
  8.     void f() const  
  9.     {  
  10.         cout<<"A::f() const"<<endl;  
  11.     }  
  12. };  
  13.   
  14. class B: public A  
  15. {  
  16. public:  
  17.     void f()  
  18.     {  
  19.         cout<<"B::f()"<<endl;  
  20.     }  
  21.     void f() const  
  22.     {  
  23.         cout<<"B::f() const"<<endl;  
  24.     }  
  25. };  
  26.   
  27. void g(const A* a)  
  28. {  
  29.     a->f();  
  30. }  
  31.   
  32. int main()  
  33. {  
  34.     A* a = new B();  
  35.     a->f();  
  36.     g(a);  
  37.     delete a ;  
  38. }  

    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)

[cpp]  view plain copy
  1. {  
  2.   int x = 10 ;  
  3.   int y = 10 ;  
  4.   x = x++ ;  
  5.   y = ++y ;  
  6.   printf("%d, %d\n",x,y);  
  7. }  

    A. 10, 10

    B. 10, 11

    C. 11, 10

    D. 11, 11

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

[csharp]  view plain copy
  1. int [][] myArray3 =  
  2. new int[3][]{  
  3.   new int[3]{5,6,2},  
  4.   new int[5]{6,9,7,8,3},  
  5.   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)

[cpp]  view plain copy
  1. #include <iostream>  
  2.   
  3. class A{  
  4. public:  
  5.     long a;  
  6. };  
  7.   
  8. class B : public A  
  9. {  
  10. public:  
  11.     long b;  
  12. };  
  13.   
  14. void seta(A* data, int idx)  
  15. {  
  16.     data[idx].a = 2;  
  17. }  
  18.   
  19. int _tmain(int argc, _TCHAR *argv[])  
  20. {  
  21.     B data[4];  
  22.   
  23.     for(int i=0; i<4; ++i)  
  24.     {  
  25.         data[i].a = 1;  
  26.         data[i].b = 1;  
  27.         seta(data, i);  
  28.     }  
  29.   
  30.     for(int i=0; i<4; ++i)  
  31.     {  
  32.         std::cout<<data[i].a<<data[i].b;  
  33.     }  
  34.   
  35.     return 0;  
  36. }  

    What is the correct result?

    A. 11111111

    B. 12121212

    C. 11112222

    D. 21212121

 【此题答案貌似应该是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

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 X using F = X / 2 and G = (X>>1), and you found F!=G, this implies that(5 Points)

    A. There is a compiler 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!

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


    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)

    

    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


本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

微软2013暑假实习生笔试题 的相关文章

随机推荐

  • [思维模式-8]:《如何系统思考》-4- 认识篇 - 什么是系统思考?系统思考的特征?系统思考的思维转变。

    目录 第1章 系统思考概述 1 1 什么是系统思考 1 2 系统思考适合解决什么样的问题 解决复杂问题的有效利器 1 3 思维模式的转换 还原论向整体论 西医向中医 第2章 系统思考的四项特征 2 1 看到全貌而非局部 2 2 看透结构而非
  • 基于 Kintex-7 FPGA + Nvidia TX2 = 16通道高速ADC数据采集系统

    在之前接触的设计中如果涉及要实现ADC采样的话 往往会从精度和速率来考虑对性能的影响 一般来说精度是固定的或有一个最大精度设置 但是采样速率的话 过快会造成采样不准确 往往会对整个设计的性能造成限制 所以一直期望有这样一个系统 可以实现高速
  • 如何配置Java环境变量

    文章目录 零 首先需要进入环境变量页面 一 配置 JAVA HOME 变量 二 配置 Path 变量 三 配置 CLASSPATH 变量 四 验证是否配置成功 零 首先需要进入环境变量页面 1 win i 打开设置页面 点击系统 2 点击关
  • Camera的学习笔记(二)——ISP

    ISP概念 ISP是Image Signal Processor的缩写 全称是影像处理器 在相机成像的整个环节中 它负责接收感光元件 Sensor 的原始信号数据 可以理解为整个相机拍照 录像的第一步处理流程 对图像质量起着非常重要的作用
  • 改善服务器响应时间,一种改进WWW服务器响应时间的调度方法

    一种改进WWW服务器响应时间的调度方法 这篇论文提出了一种基于控制因子 处于先来先服务和最短作业优先调度方法之间的分类调度方法 它是非抢占的 且不会发生HTTP请求长期等待而未得到WW 本文共3页 阅读全文 gt gt 公共交通是城市居民出
  • element UI 对导航el-menu 样式的修改

    element UI 对导航el menu 样式的修改 对样式进行修改时 el menu horizontal gt el submenu el submenu title el menu horizontal gt el submenu
  • 关于unity3的中关于创建方法的总结

    关于创建基本物体 有些情况会使用上 物体碰撞 游戏里怪物和英雄的触发事件上 创建一个简单物体 隐藏mesh可以作为简单的触法器使用 多次创建预制体Prefab 方法Instantiate original Object position V
  • 基于蜣螂算法优化的SVM数据分类预测-附代码

    基于蜣螂算法优化的SVM数据分类预测 附代码 文章目录 基于蜣螂算法优化的SVM数据分类预测 附代码 1 数据集 2 SVM模型建立 3 基于蜣螂算法优化的SVM 4 测试结果 5 参考文献 6 Matlab代码 7 python代码 摘要
  • IP数据包格式各字段详解说明

    1 版本 指IP协议的版本 为0100或0110 即IPv4和IPv6两种版本 通信双方使用的IP协议版本必须一致 2 首部长度 占 4 位 可表示的最大十进制数值是15 请注意 这个字段所表示数的单位是32位字 即0001表示1个32位字
  • android 中的的 sp/wp/RefBase

    转自 http blog csdn net innost article details 6752443 5 1 概述 初次接触Android源码时 见到最多的一定是sp和wp 即使你只是沉迷于Java世界的编码 那么Looper和Hand
  • STM32CubeIDE IAP原理讲解,及UART双APP交替升级IAP实现

    随言 IAP应该是我唯一想写的文章 从创建这个账号开始 但是不知不觉几年过去了 一直没去写这文章 现在就随便写写吧 曾做过4G模块UART协议与STM32通讯实现远程无线迭代升级 一共2个APP bootloader优先选择稳定高版本的AP
  • 最详解决:jupyter notebook不会自动打开浏览器问题

    一 宝刀未老的老Amy回归之 问题描述 好久木有在 csdn 上写文章了 那是什么原因让 开摆一年 的老Amy 开写 了呢 噔噔蹬蹬 答案是 老Amy的一颗责任心 言归正传 最近替别的老师上几节课 刚好告诉大家如何安装 jupyter 以及
  • 线程复习(针对面试)

    问题一 请说明一下进程和线程的区别 一个进程运行要给他分配系统资源 维护他的代码段和数据段 堆栈等 而线程跟他共享这些 节俭的多任务操作方式 典型的UNIX Linux进程可以看成只有一个控制线程 一个进程在同一时刻只做一件事情 有了多个控
  • (附源码)spring boot西安市中小学生护眼平台开发 毕业设计 080855

    springboot西安市中小学生护眼平台开发 摘要 俗话说 眼睛是心灵的窗户 可在这个科学技术日新月异发展的大千世界里 戴眼镜的人却随处可见 特别是我国在校学生3 2亿 平均近视率超过60 其中小学生为35 初中生为65 高中生达79 更
  • CAD螺纹lisp程序_公英制螺纹标注方法及加工大全

    普通螺纹的标记 螺纹公差带代号的标注在螺纹代号之后 中间用 分开 如果螺纹的中径公差带代号不同 则分别注出 前者表示中径公差带 后者表示顶径公差带 如果中径公差带与顶径公差带代号相同 则只标注一个代号 例如 M10 5g6g M10 1 6
  • shell是什么?ssh 与 git bash linux或cmd与 shell区别

    什么是shell Bash介绍及内容 1 认识Bash这个Shell 管理整个计算机硬件就是操作系统的内核 而内核是需要被保护的 不能让用户随便去修改不然系统崩溃了怎么办 所以一般用户只能通过Shell来跟内核沟通 shell的定义 什么是
  • ajax上传netcore插件,.NET Core Web 文件分片上传,带进度条实用插件

    git CMD命令 git initgit add 添加文件至暂存区 git commit m 描述性语句 随意写即可 git branch gh pages 创建仓库分支 git checkou 使用ARM模板部署自动扩展的Linux V
  • canvas圆形和正方形碰撞检测

    1 圆形碰撞检测 弧度转角度 function d2a n return n Math PI 180 角度转弧度 function a2d return n 180 Math PI window onload function let oC
  • 技术干货的选择性问题

    今天准备整理下微信的收藏夹 因为我发现好像在里面已经收藏了太多文章 这些收藏的文章并不是已经读过觉得不错故而收藏的 而是全没读过的 而其中的很大部份都是所谓的技术干货型文章 因为这类文章一方面比较长 另一方面比较费脑 所以我总是习惯在碰到的
  • 微软2013暑假实习生笔试题

    自己mark一下 以作后备 下面提交原文链接 原文博客 部分题目答案不确定 会持续更新 1 Which of the following calling convention s support s supportvariable leng