笔试题(六)

1. Please choose the right statement about const usage:

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

const integer const pointer 的差别在于 const * 的左边还是右边

 

2.

答案:22221111

 

3. 1 of 1000 bottles of water is poisoned which will kill a rat in 1 week if the rat drunk a mount 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?

A. 9          B. 10         C. 32               D. 999             E. None of the above

4. Which of following statement(s) equal(s) value 1 in C programming language?

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.

Don't know why A is wrong, return 0?

 

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

A. There is a complier error       B. X is odd        C. X is negative   

D. F - G = 1        E. G - F = 1

 

6. How  many rectangles you can find from 3*4 grid?

A.   18               B. 20                C.40                 D 60                  E. None of above is correct

 

7.  One line can split a surface to 2 part, 2 line can split a surface to 4 part. Give 100 lines, no tow parallel lines, no tree lines join at the same point, how many parts can 100 line split?

A. 5051            B. 5053               C. 5510                    D. 5511

   

分析:递推公式:x(n) - x(n-1) = n , x(0) = 1

 

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

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 application 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

 

9. Given the following database table, how many rows will the following SQL statement update?

update Books set NumberOfCopies=NumberOfCopies+1 Where AuthorID in

Select AuthorID from Books

group by AuthorID

having sum(NumberOfCopies)<=8

A. 1            B. 2               C. 3                D. 4                E. 5

 

10. 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?

A. 12               B. 16                     C. 20                        D. 24                          E. 28

每次分 3 .

posted @ 2014-03-29 17:10  周卓  阅读(272)  评论(0编辑  收藏  举报