1. What is the output of printf("%d")
2. What will happen if I say delete this
3. Difference between "C structure" and "C++ structure".
4. Difference between a "assignment operator" and a "copy constructor"
5. What is the difference between "overloading" and "overriding"?
6. Explain the need for "Virtual Destructor".
7. Can we have "Virtual Constructors"?
8. What are the different types of polymorphism?
9. What are Virtual Functions? How to implement virtual functions in "C"
10. What are the different types of Storage classes?
11. What is Namespace?
12. What are the types of STL containers?
13. Difference between "vector" and "array"?
14. How to write a program such that it will delete itself after execution?
15. Can we generate a C++ source code from the binary file?


C/C++ Interview Questions - 2


1. What are inline functions?
2. Talk some timing about profiling?
3. How many lines of code you have written for a single program?
4. What is “strstream”?
5. How to write Multithreaded applications using C++?
6. Explain "passing by value", "passing by pointer" and "passing by reference"
7. Write any small program that will compile in "C" but not in "C++"
8. Have you heard of "mutable" keyword?
9. What is a "RTTI"?
10. Is there something that I can do in C and not in C++?
11. Why pre increment operator is faster than post increment?
12. What is the difference between "calloc" and "malloc"?
13. What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?
14. What is Memory Alignment?
15. Explain working of printf.
16. Difference between "printf" and "sprintf".
17. What is "map" in STL?
18. When shall I use Multiple Inheritance?
19. What are the techniques you use for debugging?
20. How to reduce a final size of executable?
21. Give 2 examples of a code optimization.


Veritas
mainly C and puzzles.

C:

(1)comparison question of array and linked list. why is array poorer.
ans: inserting new elements at front is potentially expensive

(2) how to insert a new element in a linked list.
(3) some programs and asking for result.
(4) where does malloc allocate memory
ans : heap.

Puzzles:
(1) car tied to a tree with infinite elastic rope. drives at 100kmph. ant on tree travelling along the rope at 1.5kmph. will the ant catch up with the car.

(2) lion lies on monday,tuesday and wednesday. unicorn on thursday,friday and saturday. on other days both say the truth.

one day lion said: yesterday was one of my lying days.
unicorn said: yesterday was not one of my lying days.

what day is it:

ans: thursday.

(3) square of 8x8 can be filled with 2x1 rectangles. now if we remove two corner squares(opposite) than can the remaining object be covered completely with 2x1 squares.? explain.
ans: no. explain urself :)


Infosys Placement Papers - 8

1) There was a cycle race going on. 1/5th of the those in front of a person and 5/6th of those behind him gives the total number of participants. How many people took part in the race? (3 marks)

Ans : 31

Approach:

Let the total number of participants be X

So, [(x-1)/5 + 5(x-1)/6] = X



2) Today is Saturday. A person wants to meet a lawyer and as that lawyer is busy he asks him to come three days after the before day of the day after tomorrow? On which day the lawyer asks the person to come?

Ans: Wednesday

Approach:

Today=Saturday

Day after tomorrow=Monday

Day before day after tomorrow=Sunday

Three days after the day before the day after tomorrow=Wednesday



3) A person is 80 years old in 490 and only 70 years old in 500 in which year is he born?

Ans: 570 BC

Approach:

Since the age gets decreased with the years, the years should definitely be in BC and hence u should increment the years as u decrease the age. Therefore if he is 70 years old in 500BC, he would have born on 570 BC!!



4) A man enquires a person about the past 5 days temperatures at 12 noon in that region. The other replies that he doesn't remember the actual figures but there was a different temperature on each day and that their product gives 12. Assuming the temperature to the nearest degree what are the temperatures on the five days?

Ans: -1,-2,1,2,3

Approach:

We know that the smallest two integers that can give a product of 12 is 3*4 which is spilt up as 2*2*3. But no temperature is the same...hence use -2 instead of 2. Now the product becomes -12. Choose the other temperatures such that value of the product does not change but only the sign changes. So naturally, the other two options are -1 and 1.



5) A cube is painted. It is cut into 27 cubes with three straight lines. Find the number of cubes with
a. 3 sides painted
b. 2 sides painted
c. 1 side painted
d. no painted sides

Ans: a. 8 (4 corner cubes + 4 corner cubes)
b. 12 (center cubes at each EDGE)
c. 6 (center cubes at each FACE)
d. 1 (cube at the center of the original cube)

Approach

Draw a cube (with front, top and side faces, dont draw the inner lines. that'll confuse) cut it into 27 cubes. thats done by drawing 3 horizontal and 3 vertical lines on the front face of the cube. extend those lines along the other two faces. then COUNT accordingly.



6) A person travels at a speed of 10 mph from one city to another. However while returning as there was not much traffic. He came with a speed of 15mph. what is his average speed?

Ans: 12 mph

Approach:

Let the distance be X

Distance/ Time=Speed

Time taken for forward journey=X/10

Time taken for return journey=X/15

Total time for to and fro journey T =[(X/10)+(X/15)]

Total distance covered D=2X

Hence, average speed= D/T = 12mph



7) There is a peculiar island where people speak a strange language called 'Kubi'.The men always speak truth and a women never say two 2 consecutive truth or false statements, that is, if she says truth statement once then she says false statement next and vice versa. The boys and girls always lie. One day I asked a child "Are you a boy or girl ?" and the child replied in Kubi. Since I didn't know the language, I asked the child's parents what it means. One of the parents said "The child says,"I am a boy"" and the other said that "The child is a girl. He lied".

a) Is the child a boy or a girl

b) Which parent answered first?

Ans: The child is a girl and father answered first.

Approach:

Take the statement "The child is a girl. He lied". If 'He lied' is true, then the child is a girl is a false. Likewise, is 'He lied' is false, then the child is a girl is true => The second statement was given by the child's mother and hence the father answered first.
Take the statement "The child says,"I am a boy". Since the father always speak the truth, the child should have said that he was a boy. But then the child lies, so he cannot be a boy => the child was a girl. (Confused? Try reasoning it out yourself, u'll understand the logic)

8) There is a couple and they have many children. 7 of them dont eat spinach. 5 ot them dont eat carrot. 6 of them dont eat beans. 4 of them dont eat either spinach or carrot. 2 of them eat neither spinach or beans and 3 of them eat neither carrot or beans. and 1 dont eat spinach, carrot or beans. How many children r there in total?

Ans: 9 children

Approach:

4 of them don't eat spinach or carrot => 4 of them eat beans alone.

2 of them don't eat spinach or beans => 2 of them eat carrots alone.

3 of then don't eat carrot or beans =>3 of them eat spinach alone.

Total children=4+2+3=9

(If some other reasoning approach was chosen, the remaining three statements could be used. But this one is simple and I am sure that the answer is right. Try out the other approaches anyway)



9) There are three tribes in a village. The Sorobean always speaks the truth. The Narobean always lies and the Midorean speaks truth and false alternatively. From the following statements, find out who belongs to which tribe.

A: I am a Sorobean

B is a Narobean



B: I am a Sorobean

C is a Midorean



C: I am a Sorobean

A is a Midorean



Ans: A -Midorean, B-Narobean, C-Sorobean

Approach:

Simple ! Assume one as Sorobean and try to satisfy the conditions. All the above statement get satisfied only for the above answer. I think the statements that I have given are right...am sorry if its wrong but the answer to this puzzle in the Infy paper is the one that I have given above.



10) A flight is scheduled to depart at 12 midnight. A family arrived at the airport 10 hours late and missed the flight. If they had arrived 4 hours earlier, they would have reached the airport 2 hours earlier to the departure of the flight. (Something like that...not sure of the values). What is the present time ?

Ans: 4PM



Approach:

Let the present time be X

If they r 4 hours early, they arrive at airport at X+(10-4)=X-6.

The train leaves at 12 midnight => total duration from morning 12am 10 12 midnight=24 hours.

x-6 is 2 hours earlier to 12Pm =>24-(x-6)=2

X=16 hours=4PM



3i Infotech - 2
1. In a class composed of x girls and y boys what part of the class is composed of girls

A.y/(x + y) B.x/xy C.x/(x + y) D.y/xy (Ans.C)


2. What is the maximum number of half-pint bottles of cream that can be filled with a 4-gallon can of cream(2 pt.=1 qt. and 4 qt.=1 gal)

A.16 B.24 C.30 D.64 (Ans.D)

3. If the operation,^ is defined by the equation x ^ y = 2x + y,what is the value of a in 2 ^ a = a ^ 3

A.0 B.1 C.-1 D.4 (Ans.B)

4. A coffee shop blends 2 kinds of coffee,putting in 2 parts of a 33p. a gm. grade to 1 part of a 24p. a gm.If the mixture is changed to 1 part of the 33p. a gm. to 2 parts of the less expensive grade,how much will the shop save in blending 100 gms.

A.Rs.90 B.Rs.1.00 C.Rs.3.00 D.Rs.8.00 (Ans.C)

5. There are 200 questions on a 3 hr examination.Among these questions are 50 mathematics problems.It is suggested that twice as much time be spent on each maths problem as for each other question.How many minutes should be spent on mathematics problems

A.36 B.72 C.60 D.100 (Ans.B)

6. In a group of 15,7 have studied Latin, 8 have studied Greek, and 3 have not studied either.How many of these studied both Latin and Greek

A.0 B.3 C.4 D.5 (Ans.B)

7. If 13 = 13w/(1-w) ,then (2w)2 =

A.1/4 B.1/2 C.1 D.2 (Ans.C)

8. If a and b are positive integers and (a-b)/3.5 = 4/7, then

(A) b < a (B) b . a (C) b = a (D) b .= a (Ans. A)

9. In june a baseball team that played 60 games had won 30% of its game played. After a phenomenal winning streak this team raised its average to 50% .How many games must the team have won in a row to attain this average?

A. 12 B. 20 C. 24 D. 30 (Ans. C)

10. M men agree to purchase a gift for Rs. D. If three men drop out how much more will each have to contribute towards the purchase of the gift/

A. D/(M-3) B. MD/3 C. M/(D-3) D. 3D/(M2-3M) (Ans. D)

11. A company contracts to paint 3 houses. Mr.Brown can paint a house in 6 days while Mr.Black would take 8 days and Mr.Blue 12 days. After 8 days Mr.Brown goes on vacation and Mr. Black begins to work for a period of 6 days. How many days will it take Mr.Blue to complete the contract?

A. 7 B. 8 C. 11 D. 12 (Ans.C)
12. 2 hours after a freight train leaves Delhi a passenger train leaves the same station travelling in the same direction at an average speed of 16 km/hr. After travelling 4 hrs the passenger train overtakes the freight train. The average speed of the freight train was?

A. 30 B. 40 C.58 D. 60 (Ans. B)

13. If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?

A.-5 B. 4 C. 2 D. 8 (Ans. D)

14. There are 5 red shoes, 4 green shoes. If one draw randomly a shoe what is the probability of getting a red shoe (Ans 5c1/ 9c1)

15.What is the selling price of a car? If the cost of the car is Rs.60 and a profit of 10% over selling price is earned (Ans: Rs 66/-)

16. 1/3 of girls , 1/2 of boys go to canteen .What factor and total number of classmates go to canteen.
Ans: Cannot be determined.

17. The price of a product is reduced by 30% . By what percentage should it be increased to make it 100% (Ans: 42.857%)

18. There is a square of side 6cm . A circle is inscribed inside the square. Find the ratio of the area of circle to square. (Ans. 11/14 )

19. There are two candles of equal lengths and of different thickness. The thicker one lasts of six hours. The thinner 2 hours less than the thicker one. Ramesh lights the two candles at the same time. When he went to bed he saw the thicker one is twice the length of the thinner one. How long ago did Ramesh light the two candles .
Ans: 3 hours.
20. f M/N = 6/5,then 3M+2N = ?

21. If p/q = 5/4 , then 2p+q= ?

22. If PQRST is a parallelogram what it the ratio of triangle PQS & parallelogram PQRST . (Ans: 1:2 )

23. The cost of an item is Rs 12.60. If the profit is 10% over selling price what is the selling price ?

(Ans: Rs 13.86/- )

24. There are 6 red shoes & 4 green shoes . If two of red shoes are drawn what is the probability of getting red shoes (Ans: 6c2/10c2)

25. To 15 lts of water containing 20% alcohol, we add 5 lts of pure water. What is % alcohol. (Ans : 15% )

26. A worker is paid Rs.20/- for a full days work. He works 1,1/3,2/3,1/8.3/4 days in a week. What is the total amount paid for that worker ? (Ans : 57.50 )

27. If the value of x lies between 0 & 1 which of the following is the largest?

(a) x b) x2 (c) รข€“x (d) 1/x (Ans : (d) )

28. If the total distance of a journey is 120 km .If one goes by 60 kmph and comes back at 40kmph what is the average speed during the journey? Ans: 48kmph

29. A school has 30% students from Maharashtra .Out of these 20% are Bombey students. Find the total percentage of Bombay? (Ans: 6%)

30. An equilateral triangle of sides 3 inch each is given. How many equilateral triangles of side 1 inch can be formed from it? (Ans: 9)

31. If A/B = 3/5,then 15A = ? (Ans : 9B)

32. Each side of a rectangle is increased by 100% .By what percentage does the area increase? (Ans : 300%)

33. Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel .What is the distance? Ans : 315 feet

34. Perimeter of front wheel =30, back wheel = 20. If front wheel revolves 240 times. How many revolutions will the back wheel take? Ans: 360 times

35. 20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution

(Ans: 36%)

36.City A's population is 68000, decreasing at a rate of 80 people per year. City B having population 42000 is increasing at a rate of 120 people per year. In how many years both the cities will have same population? (Ans: 130 years)

37.Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet? (Ans: 3/2 hours)

38. A person wants to buy 3 paise and 5 paise stamps costing exactly one rupee. If he buys which of the following number of stamps he won't able to buy 3 paise stamps. Ans: 9

39.There are 12 boys and 15 girls, How many different dancing groups can be formed with 2 boys and 3 girls.

40. Which of the following fractions is less than 1/3

(a) 22/62 (b) 15/46 (c) 2/3 (d) 1 (Ans: (b))

41. There are two circles, one circle is inscribed and another circle is circumscribed over a square. What is the ratio of area of inner to outer circle? Ans: 1 : 2

42. Three types of tea the a,b,c costs Rs. 95/kg,100/kg and70/kg respectively.How many kgs of each should be blended to produce 100 kg of mixture worth Rs.90/kg, given that the quantities of band c are equal

a)70,15,15 b)50,25,25 c)60,20,20 d)40,30,30 (Ans. (b))

43. In a class, except 18 all are above 50 years.15 are below 50 years of age. How many people are there

(a) 30 (b) 33 (c) 36 (d) none of these. (Ans. (d))

44. If a boat is moving in upstream with velocity of 14 km/hr and goes downstream with a velocity of 40 km/hr, then what is the speed of the stream ?
(a) 13 km/hr (b) 26 km/hr (c) 34 km/hr (d) none of these (Ans. A)

45. Find the value of ( 0.75 * 0.75 * 0.75 - 0.001 ) / ( 0.75 * 0.75 - 0.075 + 0.01)
(a) 0.845 (b) 1.908 (c) 2.312 (d) 0.001 (Ans. A)

46. A can have a piece of work done in 8 days, B can work three times faster than the A, C can work five times faster than A. How many days will they take to do the work together ?

(a) 3 days (b) 8/9 days (c) 4 days (d) can't say (Ans. B)

47. A car travels a certain distance taking 7 hrs in forward journey, during the return journey increased speed 12km/hr takes the times 5 hrs. What is the distance traveled

(a) 210 kms (b) 30 kms (c) 20 kms (c) none of these (Ans. B)

48. Instead of multiplying a number by 7, the number is divided by 7. What is the percentage of error obtained ?

49. Find (7x + 4y ) / (x-2y) if x/2y = 3/2 ?

(a) 6 (b) 8 (c) 7 (d) data insufficient (Ans. C)

50. A man buys 12 lts of liquid which contains 20% of the liquid and the rest is water. He then mixes it with 10 lts of another mixture with 30% of liquid. What is the % of water in the new mixture?

51. If a man buys 1 lt of milk for Rs.12 and mixes it with 20% water and sells it for Rs.15, then what is the percentage of gain?

52. Pipe A can fill a tank in 30 mins and Pipe B can fill it in 28 mins.If 3/4th of the tank is filled by Pipe B alone and both are opened, how much time is required by both the pipes to fill the tank completely ?

53. If on an item a company gives 25% discount, they earn 25% profit. If they now give 10% discount then what is the profit percentage.

(a) 40% (b) 55% (c) 35% (d) 30% (Ans. D)

54. A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?

(a) 110 men (b) 130 men (c) 100 men (d) none of these (Ans. A)

55. In simple interest what sum amounts of Rs.1120/- in 4 years and Rs.1200/- in 5 years ?

(a) Rs. 500 (b) Rs. 600 (c) Rs. 800 (d) Rs. 900 (Ans. C)

56. If a sum of money compound annually amounts of thrice itself in 3 years. In how many years will it become 9 times itself.
(a) 6 (b) 8 (c) 10 (d) 12 (Ans A)

57. Two trains move in the same direction at 50 kmph and 32 kmph respectively. A man in the slower train observes the 15 seconds elapse before the faster train completely passes by him. What is the length of faster train ?
(a) 100m (b) 75m (c) 120m (d) 50m (Ans B)

58. How many mashes are there in 1 squrare meter of wire gauge if each mesh
is 8mm long and 5mm wide ?

(a) 2500 (b) 25000 (c) 250 (d) 250000 (Ans B)

x% of y is y% of ?
(a) x/y (b) 2y (c) x (d) can't be determined Ans. C

59. The price of sugar increases by 20%, by what % should a housewife reduce the consumption of sugar so that expenditure on sugar can be same as before ?

(a) 15% (b) 16.66% (c) 12% (d) 9% (Ans B)

60. A man spends half of his salary on household expenses, 1/4th for rent, 1/5th for travel expenses, the man deposits the rest in a bank. If his monthly deposits in the bank amount 50, what is his monthly salary ?
(a) Rs.500 (b) Rs.1500 (c) Rs.1000 (d) Rs. 900 (Ans C)

61. The population of a city increases @ 4% p.a. There is an additional annual increase of 4% of the population due to the influx of job seekers, find the % increase in population after 2 years ?

62. The ratio of the number of boys and girls in a school is 3:2 Out of these 10% the boys and 25% of girls are scholarship holders. % of students who are not scholarship holders.?

63. 15 men take 21 days of 8 hrs. each to do a piece of work. How many days of 6 hrs. each would it take for 21 women if 3 women do as much work as 2 men?
(a) 30 (b) 20 (c) 19 (d) 29 (Ans. A)

64. A cylinder is 6 cms in diameter and 6 cms in height. If spheres of the same size are made from the material obtained, what is the diameter of each sphere?

(a) 5 cms (b) 2 cms (c) 3 cms (d) 4 cms (Ans C)

65. A rectangular plank (2)1/2 meters wide can be placed so that it is on either side of the diagonal of a square shown below. (Figure is not available) What is the area of the plank? ( Ans :7*(2)1/2 )

66. What is the smallest number by which 2880 must be divided in order to make it into a perfect square ?
(a) 3 (b) 4 (c) 5 (d) 6 (Ans. C)

67. A father is 30 years older than his son however he will be only thrice as old as the son after 5 years what is father's present age ?
(a) 40 yrs (b) 30 yrs (c) 50 yrs (d) none of these (Ans. A)

68. An article sold at a profit of 20% if both the cost price and selling price would be Rs.20/- the profit would be 10% more. What is the cost price of that article?

69. If an item costs Rs.3 in '99 and Rs.203 in '00.What is the % increase in price?
(a) 200/3 % (b) 200/6 % (c) 100% (d) none of these (Ans. A)

70. 5 men or 8 women do equal amount of work in a day. a job requires 3 men and 5 women to finish the job in 10 days how many woman are required to finish the job in 14 days.
a) 10 b) 7 c) 6 d) 12 (Ans 7)

71. A simple interest amount of rs 5000 for six month is rs 200. what is the anual rate of interest?
a) 10% b) 6% c) 8% d) 9% (Ans 8%)

72. In objective test a correct ans score 4 marks and on a wrong ans 2 marks are ---. a student score 480 marks from 150 question. how many ans were correct?

a) 120 b) 130 c) 110 d) 150 (Ans130)

73. An article sold at amount of 50% the net sale price is rs 425 .what is the list price of the article?
a) 500 b) 488 c) 480 d) 510 (Ans 500)

74. A man leaves office daily at 7pm A driver with car comes from his home to pick him from office and bring back home. One day he gets free at 5:30 and instead of waiting for driver he starts walking towards home. In the way he meets the car and returns home on car He reaches home 20 minutes earlier than usual. In how much time does the man reach home usually?? (Ans. 1hr 20min)

75. A works thrice as much as B. If A takes 60 days less than B to do a work then find the number of days it would take to complete the work if both work together?

Ans. 22½days

76. How many 1's are there in the binary form of 8*1024 + 3*64 + 3 Ans. 4

77. In a digital circuit which was to implement (A B) + (A)XOR(B), the designer implements (A B) (A)XOR(B) What is the probability of error in it ?

78. A boy has Rs 2. He wins or loses Re 1 at a time If he wins he gets Re 1 and if he loses the game he loses Re 1.He can loose only 5 times. He is out of the game if he earns Rs 5.Find the number of ways in which this is possible? (Ans. 16)

79. If there are 1024*1280 pixels on a screen and each pixel can have around 16 million colors. Find the memory required for this? (Ans. 4MB)

80. On a particular day A and B decide that they would either speak the truth or will lie. C asks A whether he is speaking truth or lying? He answers and B listens to what he said. C then asks B what A has said B says "A says that he is a liar" What is B speaking ?(a) Truth (b) Lie (c) Truth when A lies (d) Cannot be determined

Ans. (b)

81. What is the angle between the two hands of a clock when time is 8:30

Ans. 75(approx)

82. A student is ranked 13th from right and 8th from left. How many students are there in totality ?

83. A man walks east and turns right and then from there to his left and then 45degrees to his right.In which direction did he go (Ans. North west)

84. A student gets 70% in one subject, 80% in the other. To get an overall of 75% how much should get in third subject.

85. A man shows his friend a woman sitting in a park and says that she the daughter of my grandmother's only son.What is the relation between the two
Ans. Daughter

86. How many squares with sides 1/2 inch long are needed to cover a rectangle that is 4 ft long and 6 ft wide

(a) 24 (b) 96 (c) 3456 (d) 13824 (e) 14266

87. If a=2/3b , b=2/3c, and c=2/3d what part of d is b/

(a) 8/27 (b) 4/9 (c) 2/3 (d) 75% (e) 4/3 Ans. (b)

88. 2598Successive discounts of 20% and 15% are equal to a single discount of

(a) 30% (b) 32% (c) 34% (d) 35% (e) 36 Ans. (b)

89. The petrol tank of an automobile can hold g liters.If a liters was removed when the tank was full, what part of the full tank was removed?

(a)g-a (b)g/a (c) a/g (d) (g-a)/a (e) (g-a)/g (Ans. (c))

90. If x/y=4 and y is not '0' what % of x is 2x-y
(a)150% (b)175% (c)200% (d)250% (Ans. (b))
Infosys Placement Paper

1) There are two balls touching each other circumferencically.

The radius of the big ball is 4 times the diameter of the small

ball.The outer small ball rotates in anticlockwise direction

circumferencically over the bigger one at the rate of 16 rev/sec.

The bigger wheel also rotates anticlockwise at Nrev/sec. what is

'N' for the horizontal line from the centre of small wheel always

is horizontal.

2) 1 2 3 4

+ 3 4 5 5

----------

4 6 8 9

- 2 3 4 5

----------

2 3 4 4

+ 1 2 5 4

------------

3 6 9 8

Q) Strike off any digit from each number in seven rows (need not

be at same place) and combine the same operations with 3 digit numbers

to get the same addition. After this strike off another digit from all

and add all the No.s to get the same 2 digit No. perform the same

process again with 1 digit No.s. Give the ' no.s in 7 rows at

each stage.

3) there is a safe with a 5 digit No. The 4th digit is 4 greater than

second digit, while 3rd digit is 3 less than 2nd digit. The 1st digit

is thrice the last digit. There are 3 pairs whose sum is 11. Find

the number. Ans) 65292.

4) there are 2 guards Bal and Pal walking on the side of a wall of a

wearhouse(12m X 11m) in opposite directions. They meet at a point and

Bal says to Pal " See you again in the other side". After a few moments

of walking Bal decides to go back for a smoke but he changes his

direction again to his previous one after 10 minutes of walking in

the other(opposite) direction remembering that Pal will be waiting

for to meet.If Bal and Pal walk 8 and 11 feet respectively, how

much distance they would have travelled before meeting again.

5) xxx)xxxxx(xxx

3xx

-------

xxx

x3x

------

xxx

3xx

------

Q) Find the 5 digit No.

Hint: 5 is used atleast once in the calculation.

6) Afly is there 1 feet below the ceiling right across a wall length

is 30m at equal distance from both the ends. There is a spider 1 feet

above floor right across the long wall eqidistant from both the ends.

If the width of the room is 12m and 12m, what distance is to be

travelled by the spider to catch the fly? if it takes the shortest

path.

7) Ramesh sit around a round table with some other men. He has one

rupee more than his right person and this person in turn has 1 rupee

more than the person to his right and so on, Ramesh decided to give

1 rupee to his right & he in turn 2 rupees to his right and 3 rupees

to his right & so on. This process went on till a person has

'no money' to give to his right. At this time he has 4 times the

money to his right person. How many men are there along with Ramesh

and what is the money with poorest fellow.

8)Question related to probabilities of removing the red ball from a

basket,given that two balls are removed from the basket and the other

ball is red. The basket contains blue,red,yellow balls.

9)Venkat has 1boy&2daughters.The product of these children age is 72.

The sum of their ages give the door numberof Venkat.Boy is elder of

three.Can you tell the ages of all the three.

ANALYTICAL

----------

1)L:says all of my other 4 friends have money

M:says that P said that exact one has money

N:says that L said that precisely two have money

O:says that M said that 3 of others have money.

P:Land N said that they have money.

all are liers.Who has money&who doesn't have?

2)A hotel has two,the east wing and the west wing.some east wing rooms

but not all have an ocean view(OV).All WW have a harbour view(HV).The

charge for all rooms is identical, except as follows

* Extra charge for all HV rooms on or above the 3rd floor

* Extra charge for all OV rooms except those without balcony

* Extra charge for some HV rooms on the first two floor&some EW rooms

without OV but having kitchen facilities. (GRE modrl Test 3-question

1J-22)

3)Post man has a data of name surname door no.pet name of 4 families.

But only one is correct for each family.There are a set of statements

&questions.

4)4 couples have a party.Depending on the set of statements,find who

insulted whom and who is the host of the party.

5)5 women given some of their heights(tall,medium,short)Hair( long,

plainted),stards(Black or Brown), sari,2 medium,2-short.Tall->no

sari.Plainted->medium.Answer the combinations.

1) A person has to go both Northwards&Southwards in search of a job.

He decides to go by the first train he encounters.There are trains for

every 15 min both southwards and northwards.First train towards south

is at 6:00 A.M. and that towards North is at 6:10 .If the person arrives

at any random time,what is the probability that he gets into a train

towards North.

2) A person has his own coach&whenever he goes to railway station he

takes his coach.One day he was supposed to reach the railway station

at 5 O'clock.But he finished his work early and reached at 3 O'clock.

Then he rung up his residence and asked to send the coach immediately.

He came to know that the coach has left just now to tje railway station.

He thought that the coach has left just now to the railway station.He

thought that he should not waste his time and started moving towards

his residence at the speed of 3mi/hr.On the way,he gets the coach and

reaches home at 6 o'clock.How far is his residence from railway

station.

3)Radha,Geeta&Revathi went for a picnic.After a few days they forgot the

date,day and month on which they went to picnic.Radha said that it was

onThursday,May 8 and Geeta said that it was Thursday May 10.Revathi

said Friday Jun 8.Now one of them told all things wrongly,others one

thing wrong and the last two things wrongly.If April 1st is tuesday

what is the right day,date and month?

-------------------------------------------------------------------------
I am sending mainly c
paper and some questions.Rao
also will send somethig.There are 15 c q's all are discriptive.

int a=2;
f1(a++);
}
f1(int c)
{
printf("%d", c);
}
1)fallacy
f()
{
int a;
void c;f2(&c,&a);
2)a=0;
b=(a=0)?2:3;
a) What will be the value of b? why
b) If in 1st stmt a=0 is replaced by -1, b=?
c) If in second stmt a=0 is replaced by -1, b=?
3)char *a[2]
int const *p;
int *const p;
struct new { int a;int b; *var[5] (struct new)
4)f()
{
int a=2;
f1(a++);
}
f1(int c)
{
printf("%d", c);
}
c=?
5)f1()
{
f(3);}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;}
value of c?
6)Fallacy
int *f1()
{
int a=5;
return &a;
}
f()
int *b=f1()
int c=*b;
}
7)a)Function returning an int pointer
b)Function ptr returning an int ptr
c)Function ptr returning an array of integers
d)array of function ptr returning an array of integers
(See Scham series book)
8)fallacy
int a;
short b;
b=a;
9)Define function ?Explain about arguments?
10)C passes By value or By reference?
11)Post processed code for
abc=1;
b=abc1; (1 or 2 blank lines are given)
strcpy(s,"abc");
z=abc;
12)difference between my-strcpy and strcpy ?check
13)f()
{
int *b;
*b=2;
}
14)Function which gives a pointer to a binary trees const an integer value
at each code, return function of all the nodes in binary tree.(Study)Check
15)Calling refernce draw the diagram of function stack illustrating the
variables in the -----then were pushed on the stack at the point when
function f2 has been introduced
type def struct
{ double x,double y} point;
main( int argc, char *arg[3])
{double a;
int b,c;
f1(a,b);}
f1(double x, int y)
{
point p;
stack int n;
f2(p,x,y)}
f2(point p, double angle)
{ int i,j,k,int max)
}
_____________________________________________________________
1)Least no. when divide by [7 gives remainder 6,6gives 5,5 gives 4 and
soon ans;419
2)What compilation do (ans source code to obj)
3)Artficial language is provided which of the language (Lisp) check
4)241 change its equivalent octal ?
5)for cube and sphere 3 views are similarly draw one such figure?
6)Write a program to exchange two variaables without temp
7)Fortran cannot have value by reference
8)4,6,8,__
9)success is to failure, joy is to
10)MEANING OF JOLLY?
11)opposite to essential?
12)"Raw" means
13)To be good "Wrestler " one should have?
14)"Command" opposite?
15)genuine opposite?
16)Two proverbs are goven
17)Sum of two consecutive nos is 55, larger one is?
18)A person goes 4/5 of his usual speed reaches 10min lateto his
destinaton, time taken?
19)80% pass in english, 70%pass in maths , 10%fail in both , 144 pass in
both . How many all appeared to the test?
20)To get a parabola if you cut a section of?
21)Bird is flying 120km/hr b/w B to R. two trians at B to R at 60 kmph
The distance trvelled by the bird before it is killed.Ans.120
22)meaning of inert
If any are there rao will send you. Prepare well
for the interview. Mostly on graphics , geometry .Prepare questions like
(for interview)Prove some of the angles in a triangle are 180.Angle in a
half circle is 90.How will you measure hight of building when you are at
the top of the building and if you have stone with you.

Infosys Placement Paper
GEORGE SUMMERS puzzle books are suggested.
-----------------------------
INFOSYS TECHNOLOGIES LIMITED.
-----------------------------
Question Paper
--------------
Part 1.
------
(1) 9 cards are there. u have to arrange them in a 3*3 matrix.
cards are of 4 colors.they are red,yellow,blue,green.
conditions for arrangement: one red card must be in first row
or second row.2 green cards should be in 3rd column.Yellow
cards must be in the 3 corners only. Two blue cards must be in
the 2nd row. Atleast one green card in each row.
Solution:
Yello Red Gren
Blu Blu Gren
Yello Gren Yello
2. 4 cards are placed on a table, each card has two colors. U
don't know the color of the back side of eachcard.4 persons A
B C and D are sitting on the table before the cards. They can
see Red, Green Red and blue .Out of the 4 poeple 2 always lie.
They see the color on the reverse side and give the following
comment
A: Yello/green
B: Neither Blue/nor Green
c: Blue/Yello
D: Blue/ Yello
find out the color on the other side of the 4 cards.

3.Red and brown tribes [FROM BARRONS GRE] Conditions to
get married with each other.

4. Venn diagram regarding Rich, muscular, soft-skinned,
employed, etc.,( Refer BARRONS GRE GUIDE)
--------------------------------------------------------------------
PART 2.
1. SAKUNTALA DEVI'S PUZZLE BOOK : PUZZLES TO PUZZLE YOU.
problem no: 3. ( Brothers and Sisters)
A family I know has several children. Each boy in this
family has as many sisters as brothers but each girl has
twice as many brothers as sisters. How many brothers
and sisters are there?
ans: 4 boys and 3 girls.
2. No. of animals is 11 more than the no. of birds. If the
no. of birds were the no. of animals and no. of animals
were the no. of birds( ie., interchanging no.s of animals
and birds.), the total no. of legs get reduced by one fifth
(1/5). How many no. of birds and animals were there?
ans: birds:11,animals:22
3. In a soap company a soap is manufactured with 11 parts.
For making one soap you will get 1 part as scrap. At the
end of the day u have 251 such scraps. From that how many
soaps can be manufactured? ans: 22 + 2+ 1 = 25.
4. 2 * * |
3 * * | No. 7 does not occur in this
---------------- |
5 * * | multiplication.
* 4 * |
* * 3 | Find the product.
---------------- |
* * * * * |
---------------- |
--------------------------------------------------
ans 2 8 1
3 2 2
-----
5 6 2
5 6 2 0
8 4 3 0 0
---------
9 0 4 8 2
---------
5. There is a 5digit no. 3 pairs of sum is eleven each.
Last digit is 3 times the first one.
3 rd digit is 3 less than the second.
4 th digit is 4 more than the second one.
Find the digit.
ans : 25296.
6. There are five thieves, each loot a bakery one after the
other such that the first one takes 1/2 of the total no.
of the breads plus 1/2 of a bread. Similarly 2nd, 3rd,4th
and 5fth also did the same. After the fifth one no. of
breads remained are 3. Initially how many breads were there?
ans : 31.
7.ESCALATOR PROBLEM OF SAKUNTALA DEVI 'PUZZLES TO PUZZLE'book.
Problem No: Problem 27( Down the escalator)
ans : the no of steps in the stair way : 46.
8.Harbour line and Main line Problem of Sakuntala Devi Puzzle
book. Ans : 4/5.
( More Puzzles book)
9.There are some chicken in a poultry. They are fed with corn
One sack of corn will come for 9 days.The farmer decides to
sell some chicken and wanted to hold 12 chicken with him.
He cuts the feed by 10% and sack of corn comes for 30 days.
So initially how many chicken are there?
10.Two people X & Y walk on the wall of a godown in opposite
direction. They meet at a point on one side and then go
ahead. X after walking for some time, walks in opposite
direction for 15 mtrs.Then again he turns back and walks
in the original direction. What distance did Y walk before
they met again, if X walks 11 mtrs by the time Y walks
8 mtrs.
11.Problem from SAKUNTALA DEVI 'PUZZLES TO PUZZLE U'.
Problem no: 23( Walking back to happiness.) The walking time : 55 mins.

PAPER CODE Q/A. marks 50.

--------------------------------------------------------------

1)At 6'o clock clock ticks 6 times. The time between first and

last ticks was 30sec. How much time it takes at 12'o clock.



Ans. 66 sec. 2 marks.



2)Three friends divided some bullets equally. After all of them

shot 4 bullets the total no.of remaining bullets is equal to that of

one has after division. Find the original number divided.



Ans. x x x

x-4 x-4 x-4

3x-12 = x

x= 6

ans is 18 2 marks



3)A ship went on a voyage after 180 miles a plane statrted with 10 times

speed that of the ship. Find the distance when they meet from

starting point.



Ans. 180 + (x/10) = x

x = 20

ans is 180+20=200miles. 2 marks



4) Fill the empty slots.

Three FOOTBALL teams are there. Given below the list of maches.



played won lost draw Goals for Goals against

A 2 2 *0 *0 *7 1

B 2 *0 *1 1 2 4

C 2 *0 *1 *1 3 7



the slots with stars are answers. 4 marks

BC drew with 2-2

A won on B by 2-0

a won on C by 5-1

( YOU HAVE TO FILL THE BLANKS AT APPROPRIATE STAR SYMBOLS.)`

5) There are 3 societies a,b,c. a lent tractors to b and c as many

as they had. After some time b gave as many tractors to a and c

as many as they have. After sometime c did the same thing.

At the end of this transaction each one of them had 24.

Find the tractors each orginally had.



Ans a had 39, b had 21, c had 12, 4 marks



6) There N stations on a railroad. After adding x stations 46 additional

tickets have to be printed. Find N and X.



Ans. let N(N-1) = t;

(N+x)(N+x-1) = t+46;

trail and error method x=2 and N=11 4 marks



7)Given that April 1 is tuesday. a,b,c are 3 persons told that their

farewell party was on

a - may 8, thursday

b - may 10,tuesday

c - june 8, friday

Out of a,b,c one is only correct one of the regarding month,day,date.

Other told two correct and the third person told all wrong.What is

correct date,month,day. 5 marks

(ans may be MAY 10 SUNDAY. check once again)

8)There are 4 parties. df,gs,dl(depositloss),ew ran for a contest.

Anup,Sujit,John made the following statements regarding results.

Anup said either df or ew will definitely win

sujit said he is confident that df will not win

John said he is confident that neither ew nor dl will win

the result has come. only one of the above three has made a correct

statement. Who has made the correct statement and who has won

the contest. 5 marks.

(ans DL )

9)Five people a,b,c,d,e are related to each other. Four of them make

one true statement each as follows.

i) b is my father's brother. (ans. d said this)

ii)e is my mother-in-law. ( b )

iii)c is my son-in-law's brother. ( e )

iv)a is my brother's wife. ( c )

who said each statement.

10 marks.



10) All members of d are also members of a

All '' e '' d

all '' c '' both a and b

not all '' a are members of d

not all '' d '' e

Some questions on these conditions.(5questions 5 marks)

11)

boys are allowed to watch football at c.v.Raman auditorium subjected to

conditions.

i)the boy over age 16 can wear overcoat

ii)no boy over age 15 can wear cap

iii)to watch the football either he has to wear overcoat or cap

or both

iv) a boy with an umberella or above 16 or both cannot wear sweater.

v) boys must either not watch football or wear sweater.



What is the appearence of the boy who is watching football.

Try to solve this question................







ok!!!!!

infosys paper 1997.

paper code q/c.

------------------------------------------------------------------------



1) be * be = acb

a,b,c,e are non zero numbers find b,e.

ans) b=1 e=9

2) a,b,c,d,e are having numerical values. there are some conditions

given

a) a=c <===> b!=e

b) difference between a and c as same as difference between c and b

as same as difference between a and d

c) c and c>d

then find a,b,c,d,e

3) there are six cards in which it has two king cards. all cards are

turned down and two cards are opened

a) what is the possobility to get at least one king.

b) what is the possibility to get two kings.

4) a person went to a shop and asked for change for 1.15paise.

but he said that he could not only give change for one rupee.

but also for 50p,25p,10p and 5p. what were the coins he had

ans) 1-->50 4--->10p 1--->25p

5) there are 3 nurses and they work altogether only once in a week.

no nurse is called to work for 3 consecutive days.

nurse 1 is off on tueseday,thursday and sunday.

nurse 2 is off on saturday.

nurse 3 is off on thursday,sunday.

no two nurses are off more than once a week.

find the day on which all the 3 nurses were on work.

6) there are 5 persons a,b,c,d,e and each is wearing a block or white

cap on his head. a person can see the caps of the remaining 4 but can't

see his own cap. a person wearing white says true and who wears block

says false.

i) a says i see 3 whites and 1 block

ii) b says i see 4 blocks

iii) e says i see 4 whites

iiii) c says i see 3 blocks and 1 white.

now find the caps weared by a,b,c,d and e

7) there are two women, kavitha and shamili and two males shyam, aravind

who are musicians. out of these four one is a pianist, one flutist,

violinist and drummer.

i) across aravind beats pianist

ii) across shyam is not a flutist

iii) kavitha's left is a pianist

iiii) shamili's left is not a drummer

v) flutist and drummer are married.

8) 1/3 ed of the contents of a container evaporated on the 1 st day.

3/4 th of the remaining contents of the container evaporated the

second day. what part of the contents of the container are left at

the end of the second day.

9) a man covered 28 steps in 30 seconds but he decided to move fast and

covered 34 steps in 18 seconds. how many steps are there on the

escalator when stationary.

10) all fair skinned, rich, handsome, muscular, lean and employed are

tall men

1) all lean men are muscular.

2) no fairskinned person who is not rich is handsome.

3) some muscular men are handsome.

4) all handsome are fairskinned.

5) no person who is neither fair skinned nor muscular is enplyed.

6) we unable to recall this condition and question also incomplete.


ALL THE BEST FOR THE INFY ASPIRANTS!!!!!


• Why do you use Option Explicit?
• What are the commonly used data types in VBScript?
• What is a session object?
• What are the three objects of ADO?
• What are the lock-types available in ADO?
• Explain. What are the cursor types available in ADO? Explain.
• What is a COM component? How do you register a COM component?
• What is a virtual root and how do you create one?
• What is a database index, how do you create one, discuss its pros and cons?
• How do you use multiple record sets(rs.NextRecordSet)?
• As soon as you fetch a record set, what operations would you perform?
• Define a transaction.
• What are ACID properties of a transaction?
• How would you remotely administer IIS?
• What is RAID? What is it used for?
• What is normalization? Explain normalization types.
• What is the disadvantage of creating an index in every column of a database table?
• What are the uses of source control software?
• You have a query that runs slowly, how would you make it better?
• How would you make it better in .NET environment?
• What is a bit datatype? What is it used for?
• How would you go about securing IIS and MS-SQL Server?
• What is the difference between Request("field") and Request.Form("field")?


What Have You Used QuestionsThese questions are used to determine the depth and breadth of experience the interviewee has.
• What versions of VB have you used? Have you also used VBA or VBScript?
• Have you ever used classes? If so, how have you used them?
• Have you ever created ActiveX DLLs? If so, why did you create the DLLs instead of using code in the main application?
• Have you ever created ActiveX controls? If so, what did they do?
• Have you ever created ActiveX EXEs? If so, what were they used for?
• Have you ever used Collections? Collection Classes?
• Have you ever used ADO? DAO? RDO? Any other database engines?
• What database backends have you worked with? Access? SQL Server? Oracle?
• Have you ever used resource files? If so, for what reason?
• Have you used the FileSystemObject? The Dictionary Object? Regular Expressions?
• Have you developed COM+ components? Any other types of server based components?
• What source code control systems have you used?
• What versions of Windows have you used? Have you used any other operating systems?
• What third party ActiveX controls have you used?
• Are there any other programming tools, such as database diagramming, UML, or CASE tools, that you've used?
• Have you developed components for IIS? Developed ASP pages?


General VB Programming QuestionsThese questions cover some common situations in programming in VB. You'll probably want to add your own that are specific to your project.
• If you were writing a program, what method would you use to send information from the main form of the application to a modal popup form and then pass any changes to the data back to the main form when the popup form was closed?
• How would you center a form on the screen? How about centering it on another form?
• If an event, such as a tool bar button or menu click,occurs on a MDI parent how can it invoke an action on one or more MDI child forms?
• What are some methods you can use to send data from one VB executable to another one?
• What are the differences between a standard module and a class module?
• What do you have to do to make your class visible to programs other than your own?
• How can you tell what kind of object an object variable is holding?
• Describe the different scopes of variables in VB.
• Describe the difference between a public variable in a form and one in a standard code module.
• How do you handle error conditions in your code?
• What are some uses and misuses of variants?
• What are some of the steps you can take to determine why your program is crashing with "Invalid Page Fault" errors?
• What are the different ways you can use threading in VB? When are they appropriate?
• How many tabs in a tabbed dialog do you consider appropriate?
• How many items should you make available to users in a listbox or combo box?


• What are the three main differences between flexgrid control and dbgrid(Data bound Grid) control
The Microsoft FlexGrid (MSFlexGrid) control displays and operates on tabular data. It allows complete flexibility to sort, merge, and format tables containing strings and pictures. When bound to a Data control, MSFlexGrid displays read-only data.Adaptation to existing Visual Basic code for the data-bound grid (DBGrid).

Dbgrid is A spreadsheet-like bound control that displays a series of rows and columns representing records and fields from a Recordset object.

The data grids are bound controls; that is, they require a data source that actually connects to a database and retrieves their data. And it seems that the root of the problem with DBGrid is that there's no data source that can be readily included along with the DBGrid control.In Visual Basic, the solution is simply to include the Data Control on the same form as DBGrid. But the Data Control is an intrinsic control; it's unavailable to anything outside of the Visual Basic environment itself. and VB 6.0 has a new set of data controls (DataGrid, DataList, DataCombo, MSHFlexGrid, MSFlexGrid) that once again are bound controls. Unlike DBGrid, though, they support OLE DB, and therefore rely on the an ADO Data Source (and in particular the ActiveX Data Objects Data Control, or ADO DC) for data access. Unlike the Data Control, the ADODC is a custom control (that is, an .OCX) that can be added to any project. In short, if you add ADO DC to your project along with theDataGrid control.
• ActiveX and Types of ActiveX Components in VB ?
Standard EXE
ActiveX EXE
ActiveX DLL
ActiveX document
ActiveX Control
• What is difference between inprocess and out of process ?
An in-process component is implemented as a DLL, and runs in the same process space as its client app, enabling the most efficient communication between client and component.Each client app that uses the component starts a new instance of it.
An out of process component is implemented as an EXE, and unlike a dll, runs in its own process space. As a result, exe's are slower then dll'sbecause communications between client and component must be marshalled across process boundaries. A single instance of an out of process component can service many clients.
• Advantage of ActiveX Dll over Active Exe ?

ACTIVEX DLL:An in-process component, or ActiveX DLL, runs in another application’s process. In-process components are used by applications or other in-process components. this allows you to wrap up common functionality (like an ActiveX Exe).

ACTIVEX EXE:An out-of-process component, or ActiveX EXE, runs in its own address space. The client is usually an application running in another process.The code running in an ActiveX Exe is running in a separate process space. You would usually use this in N-Tier programming.

An ActiveX EXE runs out of process while an ActiveX DLL runs in the same process space as VB app. Also, and ActiveX EXE can be run independent of your application if desired.