Anda di halaman 1dari 5

Duration: 90 Mins.

Q1) Using only a 5-gallon bucket and a 3-gallon bucket, define process to put exactly four gallons of water in the 5-gallon bucket. (Assume you have an infinite supply of water. No measurement markings on the buckets.) Q2) There are 20 breads to be divided among 20 people. 1 man eats exactly 3 breads. 1 woman eats exactly 2 breads and 1 kid eats exactly half bread. After distributing breads, no bread is left behind i.e. all breads are distributed completely. How many Men, Women and kids are present? Q3) Bucket B contains banana pulp. Bucket T contains tomato pulp. Both buckets are 5 liters in volume. Using a 500 ml jar, 500 ml pulp is transferred from bucket B to bucket T. Now using same jar, 500 ml of the pulp is transferred from bucket T to bucket B. What is the conclusion? A) Banana pulp in bucket T is more than Tomato pulp in bucket B. B) Banana pulp in bucket T is less than Tomato pulp in bucket B. C) Banana pulp in bucket T is same as Tomato pulp in bucket B. D) Information is not sufficient Q4) Three brothers oldest O, middle M, young Y have to share 100 chocolates. Rules are as follows Rule 1) Current oldest person will decide how to share. Rest of the brothers will decide whether to agree or disagree. Rule 2) Even if one person agrees (not one who decided, but one of those who are going to pick), every one has to agree. Rule 3) If everyone disagrees, current oldest, (who decide how to share) will get zero share and he is out. For remaining brothers, process will repeat. Everyone is intelligent. Everyone is greedy (want maximum share but according to rules only). How oldest brother O will decide shares? a) O 33, M 33, Y 34 b) O 1, M 1, Y 98 c) O 99, M 1, Y 0 d) O 1, M 0, Y 99 Q5) Train A is traveling with speed 50m/s. On a parallel track, Train B is traveling with speed 70m/s. Two trains are at a distance 120 Km and are start traveling towards each other. A bird who is initially on engine bogie of train A starts flying between train A and train B. Bird starts flying towards train B, touches train B and then start flying towards train A. It touches train A and starts flying towards train B and so on. Before trains start crossing each other, how much distance bird will fly if its flying speed is 120m/s? Ignore distance between tracks.

Q6) A man bought a horse and a cart. If he sold the horse at 10%loss and the cart at 20% gain, he would not lose anything; but if he sold the horse at 5% loss and the cart at 5% gain, he would lose Rs 10/- in the bargain. The amount paid by him was Rs._________for the horse and Rs. _____________ for the cart? Q7) A train moves with a speed of 108 km/hr. Length of the train is 130m. Train is crossing a 800 m long tunnel. Assuming train moves with constant speed, with what speed (m/s) train will go through the tunnel? a) 30 b) 31 c) 32 d) 33 Q8) EDWIN is a judge and a numerologist. He is married to a woman whose name: - Has a name that has the product same as that for JUDGE (J:10, U:21, D:4, G:7, E:5) - Has no letter common with JUDGE. - Has no 3rd letter of the alphabet as 3 is his unlucky number. - Has no 3 consecutive consonants Q9) A man has a gold chain with 7 links. he needs the service of a laborer for 7 days at a fee of one gold link per day. However, each day of work needs to be paid for separately. In other words, the worker must be paid each day after working and if the laborer is ever overpaid he will quit with the extra money. also he will never allow himself to be owed a link. What is the fewest number of cuts to the chain to facilitate this arrangement and how does that guarantee payment? Additional info and Hint: Laborer does not cell / use any of his links for 7 days. Q10) Two brothers Brian and Jim have 'n' number of chocolate boxes. They both want to divide the boxes among themselves such that both get equal number of chocolates. Condition is that only boxes should be divided. It is not allowed to open any box and divide chocolates in it. On each box, number of chocolates in the box is written. Both Brian and Jim know only Binary addition. Brian is a kid and is week at making addition. He does not consider "carry". e.g. for Brian 3+5=011+101= 110 = 6. Jim knows addition process in normal way. 3+5 = 011+101=1000=8. Now Jim wants to take advantage of this to get a large share convincing Brian (falsely) that they both got equal share. e.g. n=3. Boxes are of size {3, 5, 6}. So Jim will share chocolates as {3} and {5,6} because according to Brian 5 + 6 = 101 + 110 = 011 =3. So distribution is equal. Question1) Under what condition such kind of distribution is possible. Question2) If it is possible, define process followed by Jim to get maximum advantage, Q11) Can you print "Hello world" using a C program that has no semi-colons (;)? You can not use ASCII value also. If yes, write program. If no, then explain why not?

Q12) Q1 #include<stdio.h> void main() { printf("%c",7["Sundaram"]); } What will be the output? a) Error b) Sundaram c) m

d) a

Q13) Suppose for every bus route in the city of Mumbai you are given information about the fare to travel from every stop on the route to any other stop on the route. I want to go from a given bus stop x to another given bust stop y with minimum expense, changing buses as many times as required. Give an algorithm for this. Basic idea is enough. Do not write every detail. Q14) Which one of the following is not a fundamental data type in C++ A. float B. string C. int D. wchar_t Q15) Say that the Hamming distance between two bits strings of the same length is the number of positions in which they differ. For example the distance between 10001 and 01001 is 2, since they differ in the most significant and the second most significant positions. What is the number of bit strings that are at distance 3 from the bit string 1001001? Q16) One application has a data structure "App_State" that stores complete application state. A function is written "void Save_State(App_State *state_save)" that will save current state of the application in state_save. Whenever an action is performed, application state is stored in a new instance of "App_State". A function is written "void load_state(App_State *state_load)" that will load state described by "state_load". Suggest data structure for implementing undo and redo operations. Q17) int a = 10; void main() { int a = 20; cout << a << ::a; } The output of this program is A. Syntax error C. 20 10 B. 10 20 D. 20 20

Q18) Value of a in a = (b = 5, b + 5); is A. Junk value B. Syntax error C. 5 D. 10

Q19) Which of the following members do get inherited but become private members in child class A. Public C. Protected B. Private D. All the above

Q20) Which of the following is not a valid conditional inclusions in preprocessor directives A. #ifdef C. #endif B. #ifundef D. #elif

Q21) Alice and Bob play a fair game repeatedly for one nickel each game. If originally Alice has a nickels and Bob has b nickels, What is the Alices chances of winning all of Bobs money, assuming play goes of until one person has lost all his/her money? Q22) What is maximum number of comparision required to merge two sorted list of size M and N Q23) Find the output: main() { int i, n; char *x = "girl"; n = strlen(x); *x = x[n]; for(i=0;i<n;i++) { printf("%s\n",x); x++; } }

Q24) If array arr begins at address 65486 and each integer is 4 bytes long,what is output of following program? #include<stdio.h> void main() { int arr[]={12,14,15,24,33}; printf("%u %u ",arr+1,&arr+1); } Q25) Why pre-increment operator is faster than post-increment?

Anda mungkin juga menyukai