微软2013暑假实习生笔试题

原创 2013年04月06日 20:20:53

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

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)

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

【此题D选项存在疑问】

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)

#include <iostream>

class 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

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


this指针指向当前调用对象,只是用于类的非静态成员函数。静态函数和全局函数 无当前对象,无this指针。

void Date::setMonth( int mn ) {      month = mn; // 这三句是等价的      this->month = mn;      (*this).mo...
  • hzw05103020
  • hzw05103020
  • 2016-03-02 23:06:10
  • 2132

腾讯2017暑假实习生招聘笔试编程题(1)

算法基础-字符移位小Q最近遇到了一个难题:把一个字符串的大写字母放到字符串的后面,各个字符的相对位置不变,且不能申请额外的空间。 你能帮帮小Q吗?输入描述:输入数据有多组,每组包含一个字符串s,且保...
  • chenpengyu22
  • chenpengyu22
  • 2017-03-23 20:17:24
  • 240

微软实习生项目计划

2012微软“智在未来”实习生项目计划招收多少名实习生?工作地点在哪里? 2012微软“智在未来”实习生项目计划招收实习生1000名左右,工作地点主要集中在北京,上海两地...
  • cos_sin_tan
  • cos_sin_tan
  • 2012-11-11 13:31:59
  • 531

乐视2017暑期实习生笔试题(一)

最近为应对秋招,又开始刷题,乐视的三大编程题,题目真心长 /* 卢卡斯的驱逐者大军已经来到了赫柏的卡诺萨城,赫柏终于下定决心,集结了大军,与驱逐者全面开战。 卢卡斯的手下有6名天之驱逐者,这...
  • u012325397
  • u012325397
  • 2016-07-13 23:24:30
  • 1510

乐视2017暑期实习笔试

  • Amnesia_SJTU
  • Amnesia_SJTU
  • 2016-09-04 22:20:22
  • 305

微软2016实习生笔试--第三题Demo Day

微软2016校园招聘4月在线笔试题解(三) Sat 09 April 2016 by ictlxb Filed under C/CPP Tags cpp algorithm hihocoder ...
  • u011278704
  • u011278704
  • 2016-07-07 21:10:50
  • 430

2014网易游戏暑期实习生电话面试题目

这次是我同学要申请网易游戏的暑期实习,所以对他进行了电话面试,因为内容是他转述给我的,所以我也只能够记住一些。 1、C++中的空类实例化所占空间  这道题我不知道,自己写了个程序尝试了一下...
  • u010917169
  • u010917169
  • 2014-03-25 21:46:22
  • 1080

微软2016校园招聘4月在线笔试题目解析

题目1 : Font Size 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Steven loves reading book on his phone. The b...
  • qq_32400847
  • qq_32400847
  • 2016-04-24 00:24:40
  • 1232

2017腾讯暑期实习生从笔试到面试总结(附带华为、阿里面试经历)

背景说明 个人情况 本人是武汉大学计算机学院2014级的本科生一枚,在写这篇总结的时候我是大三。本来我们班是规定了有固定的实习的,但是自己闲着蛋疼,抱着试一试的想法参加了几个公司(腾讯、阿...
  • qq_24369113
  • qq_24369113
  • 2017-04-22 22:40:30
  • 13137

微软2013暑假实习生笔试题(有答案)

转自http://blog.csdn.net/fengbingyang/article/details/8764931 部分题目答案不确定,会持续更新…… 1. Which of the foll...
  • zhizunwudi
  • zhizunwudi
  • 2013-05-21 10:50:33
  • 497
收藏助手
不良信息举报
您举报文章:微软2013暑假实习生笔试题
举报原因:
原因补充:

(最多只允许输入30个字)