微軟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.pswp.cn/news/274123.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/274123.shtml
英文地址,請注明出處:http://en.pswp.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;柱形圖] …

第一次寫python

這是一個在BJDP上學習Coding Kata的時候用到的一個練習&#xff0c;原來打算用Java寫的&#xff0c;但是一想正好是學習的好機會。 就用Python了。第一次&#xff0c;寫的有些復雜。 這個題目是關于購買圖書的打折信息的。 題目來源&#xff1a; http://codingdojo.org/cgi-bin…

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 …

解決IE中img.onload失效的方法

解決IE中img.onload失效的方法 - CoffeeCats IT Blog - IT博客http://www.cnitblog.com/CoffeeCat/archive/2008/02/01/39533.htmlFirefox、Google Chrome不存在問題&#xff01;為什么onload沒有被IE調用呢&#xff1f;因為IE會緩存圖片&#xff0c;第2次加載的圖片&#xff0…

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

ListView允許用戶通過手指上下滑動的方式將屏幕外的數據滾動到屏幕內&#xff0c;同時屏幕上原有數據將會滾動出屏幕。 1、ListView簡單用法 如何將ListView將你要顯示的大量內容關聯起來呢&#xff1f;這是個很重要的問題。 1、首先我們必須先將數據提供好&#xff0c;因為你的…

Singleton patterns 單件(創建型模式)

1、模式分類 1.1 從目的來看&#xff1a; ? – 創建型&#xff08;Creational&#xff09;模式&#xff1a;負責對象創建。 ? – 結構型&#xff08;Structural&#xff09;模式&#xff1a;處理類與對象間的組合。 ? – 行為型&#xff08;Behavioral&…

Android 第十一課 SQlite 數據庫存儲

Android 為了讓我們能夠更加方便的管理數據庫&#xff0c;特意提供了一個SQLiteOpenHelper幫助類&#xff0c;通過借助這個類就可以非常簡單的對數據庫進行創建和升級。 SQLiteOpenHelper是一個抽象類&#xff0c;我們要創建一個自己的幫助類去繼承它。SQLiteOpenHelper有兩個抽…

淺析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閉包中…

listview頻繁刷新報錯

在Android編程中使用Adapter時&#xff0c;偶爾會出現如下錯誤&#xff1a;The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI t…

Android 第十三課 SharedPreferences存儲

SharedPreferences是使用鍵值對的方式來存儲數據的。當保存一條數據時&#xff0c;需要給這條數據提供一個對應的鍵&#xff0c;這樣在讀取數據的時候就可以通過這個鍵把相應的值取出來。而且支SharedPreferences還支持多種不同的數據類型存儲&#xff0c;例如&#xff1a;如果…

DSP的Gel作用

轉自&#xff1a;http://blog.csdn.net/azhgul/article/details/6660960最近剛在研究Davinci系&#xff0c;特此MARK下&#xff0c;以資后續學習之用。 DSP的Gel作用 1 GEL文件基本作用 當CCSStudio啟動時&#xff0c;GEL文件加載到PC機的內存中&#xff0c;如果定義了StartUp(…

解決關于登錄校園網顯示不在IP段的問題方案(要看注意事項哦!)

有時&#xff0c;登錄校園網&#xff0c;賬號和密碼都顯示正確&#xff0c;但是卻顯示出“賬號只能在指定IP段登錄”的問題。 那我們就提供了一個解決方案&#xff1a; 使用WinR,并在輸入框&#xff0c;輸入cmd命令&#xff1a;&#xff08;如下&#xff09;接著輸入&#xff1…

jquery插件編寫

jQuery為開發插件提拱了兩個方法&#xff0c;分別是&#xff1a; jQuery.fn.extend(object); jQuery.extend(object); jQuery.extend(object); 為擴展jQuery類本身.為類添加新的方法。可以理解為添加靜態方法。是全局的&#xff08;位于jQuery命名空間內部的函數&#xff09;…

gtk/Glade編程 編譯命令不成功 解決方法

摘自&#xff1a;http://blog.chinaunix.net/uid-26746982-id-3433656.html 當我們編寫gtk/glade程序&#xff0c;gcc編譯時&#xff0c;用如下命令&#xff1a; #gcc -o server server.c pkg-config --cflags --libs gtk-2.0 報錯&#xff1a;/tmp/ccoXadAd.o: In function …

Android 第十五課 如何使用LitePal從SQLite數據庫中刪除數據(十四課用來保留講解如何向SQLite數據庫中存入數據)

使用LitePal刪除數據的方式主要有兩種&#xff0c;第一種就是直接調用已存對象的delete()方法&#xff0c;所謂已存儲對象就是調用過save()方法的對象&#xff0c;或者說是通過LitePal提供的查詢API查出來的對象&#xff0c;都是可以直接使用delete方法來刪除對象的。這是比較簡…

頁面返回頂部(方法比較)

下面就說下簡單的返回頂部效果的代碼實現&#xff0c;附注釋說明。 1. 最簡單的靜態返回頂部&#xff0c;點擊直接跳轉頁面頂部&#xff0c;常見于固定放置在頁面底部返回頂部功能 方法一&#xff1a;用命名錨點擊返回到頂部預設的id為top的元素 html代碼 <a href"#top…

Android 第十六課 使用LitePal查詢數據

LitePal在查詢API方面做了非常多的優化&#xff0c;基本上可以滿足絕大多數場景的查詢需求&#xff0c;并且代碼也十分整潔。 例如我們需要查詢表中的所有數據&#xff1a; List<books> DataSupport.findAll(Book.class); 沒有冗長的參數列表&#xff0c;只需要調用一下…