january 2012 hcl placement paper

56
January 2012 HCL Placement Paper:- 1.void main() { int i,j,k; for(i=0;i<3;i++) k=sum(i,i); printf("\n%d",k); getch(); } sum(s,t) { static int m; m+=s+t; return m; } Ans: 6 2.void main() { int i; clrscr(); for(i=1;i<6;++i) switch(i)

Upload: jatankothari30

Post on 06-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 1/56

January 2012 HCL Placement Paper:-

1.void main()

{

int i,j,k;

for(i=0;i<3;i++)

k=sum(i,i);

printf("\n%d",k);

getch();

}

sum(s,t)

{

static int m;

m+=s+t;

return m;

}

Ans: 6

2.void main()

{

int i;

clrscr();

for(i=1;i<6;++i)

switch(i)

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 2/56

{

case 1:

case 2: printf("%d,",i++);break;

case 3: continue;

case 4: printf("%d,",i);

}

printf("%d",i);

getch();

}

Ans: 1,4,6

3. Lucia is a wonderful grandmother. Her age is between 50 and 70.Each of her sons have as many sonsas they have brothers. Their combined number gives Lucia?s age. What is the age?

Ans: 64

4.There are two towers A and B. Their heights are 200ft and 150ft respectively and the foot of thetowers are 250ft apart. Two birds on top of each tower fly down with the same speed and meet at thesame instant on the ground to pick a grain. What is the distance between the foot of tower A and thegrain?

Ans:90ft

5.raju having some coins want to distribute to his 5 son , 5 daughter and driver in a manner that , hegave fist coin to driver and 1/5 of remaining to first son he again gave one to driver and 1/5 to 2nd sonand so on.... at last he equally distributed all the coins to 5 daughters. how many coins raju initiallyhave???

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 3/56

Ans:-881

6. 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 lessthan the second.4 th digit is 4 more than the second one. Find the digit.

Ans : 25296.

7.0, 2, 4, 6, 8, 12, 12, 20, 16, ____ Ans: 12

8. A tree on first day grows 1/2 of its size second day 1/3rd of its size on the previous day similarly than1/4th and so on.u have to calculate after how many days the tree will be 100 times of its original size.

Ans -198 days

9. A is an integer. Dividing 89 & 125 gives remainders 4 & 6 respectively. Find a ?

Ans: 17

10. If there are 1024*1280 pixels on a screen and each pixel can have around 16 million colors Find thememory required for this?

Ans. 4MB

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 4/56

HCL Placement Paper 2011 - I:

1. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of thecost. What percent of cost would be gross profit on the item have been if it had been sold without thediscount?

(A) 20% (B) 40% (C) 50% (D) 60% (E) 66.6%

Ans :c) 50%

2. A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hatsincluding 4/5 of the brown hats. What fraction of the unsold hats were brown.

(A)1/60 (B)1/15 (C)3/20 (D)3/5 (E)3/4 Answer :c)3/20

3. How many integers n greater than and less than 100 are there such that, if the digits of n arereversed, the resulting integer is n+9 ?

(A)5 (B)6 (C)7 (D)8 (E)9 Answer :D)8

4. An investor purchased a shares of stock at a certain price. If the stock increased in price Rs 0.25 pershare and the total increase for the x shares was Rs 12.50, how many shares of stock had beenpurchased ?

(A)25 (B)50 (C)75 (D)100 (E)125

Answer :B)50

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 5/56

5. At a special sale, 5 tickets can be purchased for the price of 3 tickets. If 5 tickets are purchased at thesale, the amount saved will be what percent of the original price of the 5 tickets?

(A)20% (B)33.3% (C)40% (D)60% (E)66.6% Answer :c)40%

6. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do thesame job in 9 hours. If Tina works independently at the job for 8 hours and then Ann worksindependently, how many hours will it take Ann to complete the remainder of the jobs?

(A)2/3 (B)3/4 (C)1 (D)2 (E)3 Ans :E)3

7. A decorator bought a bolt of d m number of red chips in any one stack ?

(A)7 (B)6 (C)5 (D)4 (E)3 Answer :C) 5

8. HCL prototyping machine can make 10 copies every 4 seconds. At this rate, How many copies can themachine make in 6 min.?

a) 900

b) 600

c) 360

d) 240

e) 150

Ans: a

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 6/56

9. if a=2,b=4,c=5 then a+b c c a+b

a) 1

b) 11/30

c) 0

d) -11/30

e) -1

ans: b

10. 10^2(10^8+10^8) =10^4

a) 2(10)^4

b) 2(10)^6

c) 10^8

d) 2(10)^8

e) 10^10

Ans: b

11. Worker W produces n units in 5 hours. Workers V and W, workers independently but at the sametime, produce n units in 2 hours. how long would it take V alone to produce n units?

a) 1 hr 26 min

b) 1 hr 53 min

c) 2 hr 30 min

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 7/56

d) 3 hr 30 min

e) 3 hr 20 min

Ans: d (e)

12. if q <> 0 and k = qr/2 -s, then what is r in terms of k,q,s?

a) 2k+s q

b) 2sk q

c) 2(k-s) q

d) 2k+sq q

e) 2(k+s) q

Ans: e

13. How many of the integers between 25 and 45 are even ?

(A)21

(B)20

(C)11

(D)10

(E)9

Ans:d)10

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 8/56

14. If taxi fares were Rs 1.00 for the first 1/5 mile and Rs 0.20 for each 1/5 miles thereafter. The taxi farefor a 3-mile ride was

(A)Rs 1.56

(B)Rs 2.40

(C)RS 3.00

(D)Rs 3.80

(E)Rs 4.20

Answer :d)Rs 3.80

15. A computer routine was developed to generate two numbers (x,y) the first being a random numberbetween 0 and 100 inclusive, and the second being less than or equal to the square root of the first.Each of the following pair satisfies the routine EXCEPT

(A) (99.10)

(B) (85.9)

(C) (50.7)

(D) (1.1)

(E) (1.0)

Answer : A) (99.10)

16. A warehouse had a square floor with area 10,000 sq.meters. A rectangular addition was built alongone entire side of the warehouse that increased the floor by one-half as much as the original floor. Howmany meters did the addition extend beyond the original buildings ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 9/56

(A)10

(B)20

(C)50

(D)200

(E)500

Ans: c)50

17. A digital wristwatch was set accurately at 8.30 a.m and then lost 2 seconds every 5 minutes. Whattime was indicated on the watch at 6.30 p.m of the same day if the watch operated continuously thattime ?

(A)5:56

(B)5:58

(C)6.00

(D)6.23

(E)6.26

Ans :E) 6.26

18. A 5 litre jug contains 4 litres of a salt water solution that is 15 percent salt. If 1.5 litres of the solutionspills out of the jug, and the jug is then filled to capacity with water, approximately what percent of theresulting solution in the jug is salt?

(A)7.5%

(B)9.5%

(C) 10.5%

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 10/56

(D)12%

(E)15%

Ans :A)7.5%

19. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of thecost. What percent of cost would be gross profit on the item have been if it had been sold without thediscount?

(A)20%

(B)40%

(C)50%

(D)60%

(E)66.6%

Ansr :c) 50%

20. A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hatsincluding 4/5 of the brown hats. What fraction of the unsold hats were brown.

(A)1/60

(B)1/15

(C)3/20

(D)3/5

(E)3/4

Ans :c)3/20

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 11/56

21. How many integers n greater than and less than 100 are there such that,if the digits of n arereversed, the resulting integer is n+9 ?

(A)5

(B)6

(C)7

(D)8

(E)9

Ans :D)8

22. main

{

int x,j,k;

j=k=6;x=2; ans x=1

x=j*k;

printf("%d", x);

23. fn f(x)

{ if(x<=0)

return; ans fn(5) ....?

else f(x-1)+x;

}

24. i=20,k=0;

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 12/56

for(j=1;j<i;j=1+4*(i/j))

{

k+=j<10?4:3;

}

printf("%d", k); ans k=4

25. int i =10

main()

{

int i =20,n;

for(n=0;n<=i;)

{

int i=10

i++;

}

printf("%d", i); ans i=20

HCL Placement Paper on 13th May 2011 at Gurgaon

1. X = 2, Y = 3, Z = 6 Find the value of Z/(X + Y)-(X + Y)/Z

Answer: 11/30

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 13/56

2. What does the hexadecimal number F80 in radix 8.

(a) 7600

(b) 6400

(c) 4000

3. In a murder case there are four suspects A,B,C,D. Each of them makes a statement. They are A:

"I had gone to the theatre with S at the time of the murder".B: "I was playing cards with A at the time

of the murder".C: "Q didn't commit the murder".D: "C is not the murderer".Assuming the only one of the

above statement is false and that one of them is the murderer, who is the murderer?

a) A

b) B

c) C

d) D

4. Q != 0 and k = (Q X n - s)/2.What is the value of n?

(a) (2 x k + s)/Q

(b) (2 x s x k)/Q

(c) (2 x k - s)/Q

(d) (2 x k + s x Q)/Q

(e) (k + s)/Q

5 Rahim earned twice as much as Deeptha. Yogi earned rs.3/- more than half as much as Deeptha.

If the amounts earned by Raheem,Deeptha,Yogi are R,D,Y respectively, Which of the following is

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 14/56

the correct ordering of these amounts?

a) R< D < Y

b) R< Y < D

c) D< R < Y

d) Cannot be determined

e) D< Y < R

6)Next number in the series 1, 1/2, 1/4, 1/8 ?

a) 1/25

b) 1/16

c) 1/36

Answer is 1/16

7) In 6 seconds a light flashes once. In one hour how many times it will flash?

a) 569 times

b) 601 times

c) 499 times

Answer is 601 times

8) A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?

a) 3.0 sec

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 15/56

b) 2.9 sec

c) 2.8 sec

Answer is 2.9 sec

9) A ship started from port and moving with 'I' miles/hour and other ship started From L and movingwith 'H' miles/hour . At the place where these two ships will meet?.

a)( L*I*H)/(H+I)

b)(L+I+H)/(H*I)

c)(L/I/H)*(H/I)

Answer is ( L*I*H)/(H+I)

10) A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hatsincluding 4/5 of the brown hats. What fraction of the unsold hats were brown.

a)1/60

b)1/15

c)3/20

d)3/5

e)3/4

Answer is 3/20

11) 10 in 4 seconds, ? in 6 minutes

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 16/56

a)800

b)900

c)650

Answer is 900

12) Mohan earned twice as much as Deep.Yogesh earned rs.3/- more than half as much as deep. If theamounts earned by Mohan,Deep,Yogesh are M,D,Y respectively, Which of the following is the correctordering of these amounts?

a)M< D < Y

b)M< Y < D

c)D < M < Y

d)It cann't be determined from the information given

e)D < Y < M

Answer is M< D < Y

13) At a special sale, 5 tickets can be purchased for the price of 3 tickets.

If 5 tickets are purchased at the sale, the amount saved will be

What percent of the original price of the 5 tickets?

a)20%

b)33.3%

c)40%

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 17/56

d)60%

e)66.6%

Answer is 40%

14) Find the average height of five students with heights 142,147,153,165,157 in cms?

a) 152

b) 152.2

c) 152.4

d) 152.8

Answer is 152.8

15) The average marks of girls in a class is 62.5. The average marksof 4 girls among them is 60.Theaverage marks of remaining girls is 63,then what is the number of girls in the class?

a) 11

b) 10

c) 9

Answer is 10

16) The average price of 10 books is increased by 17 Rupees when one of them whose value is Rs.400 isreplaced by a new book.What is the price of new book?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 18/56

a) 570

b) 750

c) 600

Answer is 570

17) The average age of Mr and Mrs Sharma 4 years ago is 28 years .If the present average age of Mr andMrs Sharma and their son is 22 years. What is the age of their son?

a) 2

b) 1

c) 4

Answer is 2

18) The average weight of a class of 30 students is 40 kgs. If the teacher's weight is included thenaverage increases by 2 kgs. Find the weight of the teacher?

a) 102

b) 100

c) 98

Answer is 102

19) In a group the average income of 6 men is 500 and that of 5 women is 280, then what is averageincome of the group?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 19/56

a) 400

b) 100

c) 200

Answer is 400

20) The average marks of a marks of a student in 4 Examination is 40.If he got 80 marks in 5th Exam thenwhat is his new average?

a) 48

b) 84

c) 40

Answer is 48

21) Find the average of first 50 natural numbers.

a) 16

b) 15.5

c) 14

Answer is 15.5

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 20/56

HCL Placement Paper Aptitude Questions on 14th June 2011 at Pune

1) A man can row 5 kmph in still water. If the river is running at 1kmph, it takes him 75 minutes to rowto a place and back. How far is the place?

(i) 3km

(ii) 2.5 km

(iii) 4 km

(iv) 5 km

Solution:-

Speed downstream = (5+1)km/hr = 6 km/hr Speed upstream = (5-1)km/hr = 4 km/hr Let the requireddistance be x km x/6 + x/4 = 75/60 2x+3x = 15 x = 3km

2) 729 ml of a mixture contains milk and water in ratio 7:2. How much of the water is to be added to geta new mixture containing half milk and half water?

(i) 79 ml

(ii) 81 ml

(iii) 72 ml

(iv) 91 ml

Solution:-

Milk = (729 * (7/9))=567ml

Water = (729-567)= 162ml

Let water to be added be x ml 567/(162+x) = 7/3 1701 = 1134 + 7x x = 81ml

3) If log 0.317=0.3332 and log 0.318=0.3364 then find log 0.319 ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 21/56

(i)0.3396

(ii)0.3369

(iii)0.3368

(iv)0.3338

Solution: log 0.317=0.3332 and log 0.318=0.3364, then

log 0.319=log0.318+(log(0.318-0.317)) = 0.3396

4) A box of 150 packets consists of 1kg packets and 2kg packets. Total weight of box is 264kg. Howmany 2kg packets are there ?

(i)36

(ii)114

(iii)120

(iv)50

Solution:

x= 2 kg Packs

y= 1 kg packs

x + y = 150 .......... Eqn 1

2x + y = 264 .......... Eqn 2

Solve the Simultaneous equation; x = 114

so, y = 36

ANS : Number of 2 kg Packs = 114.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 22/56

5) The average weight of a class of 30 students is 40 kgs. If the teacher's weight is included then averageincreases by 2 kgs. Find the weight of the teacher?

a) 102

b) 100

c) 98

Answer :- 102

6) In a group the average income of 6 men is 500 and that of 5 women is 280, then what is averageincome of the group?

a) 400

b) 100

c) 200

Answer :- 400

7) The average marks of a marks of a student in 4 Examination is 40.If he got 80 marks in 5th Exam thenwhat is his new average?

a) 48

b) 84

c) 40

Answer :- 48

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 23/56

8) Find the average of first 50 natural numbers.

a) 16

b) 15.5

c) 14

Answer :- 15.5

9) Find the average height of five students with heights 142,147,153,165,157 in cms?

a) 152

b) 152.2

c) 152.4

d) 152.8

Answer :- 152.8

10) The average marks of girls in a class is 62.5. The average marksof 4 girls among them is 60.Theaverage marks of remaining girls is 63,then what is the number of girls in the class?

a) 11

b) 10

c) 9

Answer :- 10

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 24/56

11) The average price of 10 books is increased by 17 Rupees when one of them whose value is Rs.400 isreplaced by a new book.What is the price of new book?

a) 570

b) 750

c) 600

Answer :- 570

12) The average age of Mr and Mrs Sharma 4 years ago is 28 years .If the present average age of Mr andMrs Sharma and their son is 22 years. What is the age of their son?

a) 2

b) 1

c) 4

Answer :- 2

13) A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hatsincluding 4/5 of the brown hats. What fraction of the unsold hats were brown.

a)1/60

b)1/15

c)3/20

d)3/5

e)3/4

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 25/56

Answer :- 3/20

14) 10 in 4 seconds, ? in 6 minutes

a)800

b)900

c)650

Answer :- 900

15) Mohan earned twice as much as Deep.Yogesh earned rs.3/- more than half as much as deep. If theamounts earned by Mohan,Deep,Yogesh are M,D,Y respectively, Which of the following is the correctordering of these amounts?

a)M< D < Y

b)M< Y < D

c)D < M < Y

d)It cann't be determined from the information given

e)D < Y < M

Answer :- M< D < Y

15) At a special sale, 5 tickets can be purchased for the price of 3 tickets.

If 5 tickets are purchased at the sale, the amount saved will be

What percent of the original price of the 5 tickets?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 26/56

a)20%

b)33.3%

c)40%

d)60%

e)66.6%

Answer :- 40%

16)Next number in the series 1, 1/2, 1/4, 1/8 ?

a) 1/25

b) 1/16

c) 1/36

Answer :- 1/16

17) In 6 seconds a light flashes once. In one hour how many times it will flash?

a) 569 times

b) 601 times

c) 499 times

Answer :- 601 times

18) A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 27/56

a) 3.0 sec

b) 2.9 sec

c) 2.8 sec

Answer :- 2.9 sec

19) A ship started from port and moving with 'I' miles/hour and other ship started From L and movingwith 'H' miles/hour . At the place where these two ships will meet?.

a)( L*I*H)/(H+I)

b)(L+I+H)/(H*I)

c)(L/I/H)*(H/I)

Answer :- ( L*I*H)/(H+I)

HCL Placement Papers on 5th March 2011 at Noida

1) A man can row 5 kmph in still water. If the river is running at 1kmph, it takes him 75 minutes to rowto a place and back. How far is the place?

(i) 3km

(ii) 2.5 km

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 28/56

(iii) 4 km

(iv) 5 km

Solution:

Speed downstream = (5+1)km/hr = 6 km/hr Speed upstream = (5-1)km/hr = 4 km/hr Let the requireddistance be x km x/6 + x/4 = 75/60 2x+3x = 15 x = 3km

2) 729 ml of a mixture contains milk and water in ratio 7:2. How much of the water is to be added to geta new mixture containing half milk and half water?

(i) 79 ml

(ii) 81 ml

(iii) 72 ml

(iv) 91 ml

Solution:

Milk = (729 * (7/9))=567ml

Water = (729-567)= 162ml

Let water to be added be x ml 567/(162+x) = 7/3 1701 = 1134 + 7x x = 81ml

3) If log 0.317=0.3332 and log 0.318=0.3364 then find log 0.319 ?

(i)0.3396

(ii)0.3369

(iii)0.3368

(iv)0.3338

Solution: log 0.317=0.3332 and log 0.318=0.3364, then

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 29/56

log 0.319=log0.318+(log(0.318-0.317)) = 0.3396

4) A box of 150 packets consists of 1kg packets and 2kg packets. Total weight of box is 264kg. Howmany 2kg packets are there ?

(i)36

(ii)114

(iii)120

(iv)50

Solution:

x= 2 kg Packs

y= 1 kg packs

x + y = 150 .......... Eqn 1

2x + y = 264 .......... Eqn 2

Solve the Simultaneous equation; x = 114

so, y = 36

ANS : Number of 2 kg Packs = 114.

5)Which of the following statements regarding C compilation is true ?

a) C Compiler upon completion invokes Preprocessor.

b) C Compiler invokes Preprocessor prior to compiling a code.

c) C Compiler doesn't use Preprocessor for compiling.

Answer: b) C Compiler invokes Preprocessor prior to compiling a code.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 30/56

Explanation & Inference: C Preprocessor is invoked by Compiler to handle derivatives like #include,macro definitions etc. note: Not only HCL, but many companies give much importance to specific areasof C language like compilation, preprocessing etc.

6) The Technique to make a computer to behave as it is having more memory than its actual physicalmemory limit is called --------------.

a) Virtual Memory.

b) Random Memory.

c) Mounted Memory.

Answer: a) Virtual Memory.

7) main()

{

static char names[5][20]={"pascal","ada","cobol","fortran","perl"};

int i;

char *t;

t=names[3];

names[3]=names[4];

names[4]=t;

for (i=0;i<=4;i++)

printf("%s",names[i]);

}

Answer:

Compiler error: Lvalue required in function main

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 31/56

Explanation:

Array names are pointer constants. So it cannot be modified.

8) main( )

{

void *vp;

char ch = g , *cp = goofy ;

int j = 20;

vp = &ch;

printf( %c , *(char *)vp);

vp = &j;

printf( %d ,*(int *)vp);

vp = cp;

printf( %s ,(char *)vp + 3);

}

Answer: g20fy

Explanation:

Since a void pointer is used it can be type casted to any other type pointer. vp = &ch stores address of char ch and the next statement

prints the value stored in vp after type casting it to the proper data type pointer. the output is g .Similarly the output from second printf is 20 . The third printf

statemen t type casts it to print the string from the4th value hence the output is fy .

9) main()

{

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 32/56

main();

}

Answer:

Runtime error : Stack overflow.

Explanation:

main function calls itself again and again. Each time the function is called its return address is stored inthe call stack. Since there is no condition to terminate the function call, the call stack overflows atruntime. So it terminates the program and results in an error.

10) main()

{

show();

}

void show()

{

printf("I'm the greatest") ;

}

Answer:

Compier error: Type mismatch in redeclaration of show.

Explanation:

When the compiler sees the function show it doesn't know anything

about it. So the default return type (ie, int) is assumed. But when

compiler sees the actual definition of show mismatch occurs since it is

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 33/56

declared as void. Hence the error.

The solutions are as follows:

1. declare void show() in main() .

2.define show() before main().

3.declare extern void show() before the use of show()

11) #include<stdio.h>

main()

{

struct xx

{

int x=3;

char name[]="hello";

};

struct xx *s=malloc(sizeof(struct xx));

printf("%d",s->x);

printf("%s",s->name);

}

Answer:

Compiler Error

Explanation:

Initialization should not be done for structure members inside the structure declaration

12) main()

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 34/56

{

int *j;

{

int i=10;

j=&i;

}

printf("%d",*j);

}

Answer:- 10

Explanation:

The variable i is a block level variable and the visibility is inside that block only. But the lifetime of i islifetime of the function so it lives upto the exit of main

function. Since the i is still allocated space, *j prints the value stored in i since j points i.

13) int i,j;

for(i=0;i<=10;i++)

{

j+=5;

assert(i<5);

}

Answer:

Runtime error: Abnormal program termination. assert failed (i<5), ,

Explanation:

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 35/56

asserts are used during debugging to make sure that certain conditions are satisfied. If assertion fails,the program will terminate reporting the same. After debugging use,

#undef NDEBUG and this will disable all the assertions from the source code. Assertion is a gooddebugging tool to make use of..

14) main()

{

int i;

printf("%d",scanf("%d",&i)); // value 10 is given as input here

}

Answer:- 1

Explanation:

Scanf returns number of items successfully read and not 1/0. Here 10

is given as input which should have been scanned successfully. So

number of items read is 1.

HCL Placement Papers on 16th Jan 2011 at Chennai

1) The letters P, Q, R, S, T, U and V, not necessarily in that order represents seven

consecutive integers from 22 to 33.

U is as much less than Q as R is greater than S.

V is greater than U.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 36/56

Q is the middle term.

P is 3 greater than S.

Can you find the sequence of letters from the lowest value to the highest value?

Answer :- The sequence of letters from the lowest value to the highest value is TUSQRPV.

2) Because cigars cannot be entirely smoked, a Bobo who collects cigar butts can make a cigar to smokeout of every 3 butts that he finds.Today, he has collected 27 cigar butts. How many cigars will he be ableto smoke?

Answer :- 13

3) A boy found that he had a 48 inch strip of paper. He could cut an inch off every second.How longwould it take for him to cut 48 pieces? He can not fold the strip and also, can not

stack two or more strips and cut them together.

Answer :- 47 seconds.

4) At University of Probability, there are 375 freshmen, 293 sophomores, 187 juniors, & 126 seniors.One student will randomly be chosen to receive an award.

What percent chance is there that it will be a junior? Round to the nearest whole percent.

Answer :- 19%

5) If you were to dial any 7 digits on a telephone in random order, what is the probability that you willdial your own phone number? Assume that your telephone number is 7-digits.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 37/56

Answer :- 1 in 10,000,000

6) An anthropologist discovers an isolated tribe whose written alphabet contains only six letters (call theletters A, B, C, D, E and F). The tribe has a taboo against

using the same letter twice in the same word. It's never done.If each different sequence of lettersconstitues a different word in the language, what is the maximum number of six-letter words that thelanguage can employ?

Answer :- The language can employ maximum of 720 six-letter words.

7) Kate, Demi, Madona, Sharon, Britney and Nicole decided to lunch together in a restaurant. Thewaiter led them to a round table with six chairs. How many different ways can they seat?

Answer :- There are 120 different possible seating arrangments.

8) e(int n)

{

if(n>0)

{

(not clear)

printf("%d",n);

e(--n);

}

return

}

Ans:0,1,2,0

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 38/56

9) a=5,b=3,c=a,b

d=(a,b)

printf(c,d)

Ans:c=5,d=3

10) char s1[20]="hello world";

s1[5]="\0";

printf("%d",strlen(s1));

printf("%%.%...(not clear)",s1);

}

Ans:bad format specifier

11) func(int i)

{

static int count;

count=count+i;

}

Ans: 1+2+3...(counts values does not go after funtion call)

12) What is the technical term used to denote the problem of a program failing to release the consumedmemory back to other programs ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 39/56

Answer :- Memory Leakage is the technical term used to denote the problem in question.

13) Can you tell the primary difference between two static and dynamic testing methods ?

Answer :- Static testing is basically a passive testing when program is not run. One may check algorithm,program logic etc. Dynamic testing is done by executing the program for different inputs.

14) Name any two implementations of SDLC (Software Development Life Cycle)

Answer :- Waterfall model and prototyping can be considered as few real time implementations of SDLC.

HCL Placement Paper for Exprience on 24th Jan 2011 at Bangalore

Q.1. What is the technical term used to denote the problem of a program failing to release theconsumed memory back to other programs ?

Answer :-Memory Leakage is the technical term used to denote the problem in question.

Q.2. Can you tell the primary difference between two static and dynamic testing methods ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 40/56

Answer :-Static testing is basically a passive testing when program is not run. One may check algorithm,program logic etc. Dynamic testing is done by executing the program for different inputs.

Q.3. Name any two implementations of SDLC (Software Development Life Cycle)

Answer :-Waterfall model and prototyping can be considered as few real time implementations of SDLC.

Q.4. Which of the following statements regarding C compilation is true ?

a) C Compiler upon completion invokes Preprocessor.

b) C Compiler invokes Preprocessor prior to compiling a code.

c) C Compiler doesn't use Preprocessor for compiling.

Answer: b) C Compiler invokes Preprocessor prior to compiling a code.

Explanation & Inference: C Preprocessor is invoked by Compiler to handle derivatives like #include,macro definitions etc. note: Not only HCL, but many companies give much importance to specific areasof C language like compilation, preprocessing etc.

Q.5. The Technique to make a computer to behave as it is having more memory than its actual physicalmemory limit is called --------------.

a) Virtual Memory.

b) Random Memory.

c) Mounted Memory.

Answer: a) Virtual Memory.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 41/56

Q.6. In a mesh network with 'n' number of nodes what is the number of links required to connect all thenodes together?

a) n(n - 1)

b) n(n - 1) / 2

c) n

Answer: b) n(n - 1) / 2

Explanation & Inference : A mesh network is a fully connected network with every node (orcomputer/device) connected to every other node. The number of links is n(n - 1) / 2 which can beproved mathematically. This placement question is from basic computer network concepts.

Q.7. Which of the following statements is true regarding 'malloc' function in C?

a) memory allocated by malloc is persistent

b) memory allocated by malloc is not persistent

c) malloc memory cannot be deallocated by the programmer explicitly.

Answer: a) memory allocated by malloc is persistent Explanation & Inference : This placement questionis from basic C programming concepts.

Q.8. The letters P, Q, R, S, T, U and V, not necessarily in that order represents seven

consecutive integers from 22 to 33.

U is as much less than Q as R is greater than S.

V is greater than U.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 42/56

Q is the middle term.

P is 3 greater than S.

Can you find the sequence of letters from the lowest value to the highest value?

Answer :-The sequence of letters from the lowest value to the highest value is TUSQRPV.

Q.9. Because cigars cannot be entirely smoked, a Bobo who collects cigar butts can make a cigar tosmoke out of every 3 butts that he finds.Today, he has collected 27 cigar butts. How many cigars will hebe able to smoke?

Answer :-13

Q.10. A boy found that he had a 48 inch strip of paper. He could cut an inch off every second.How longwould it take for him to cut 48 pieces? He can not fold the strip and also, can not stack two or morestrips and cut them together.

Answer :-47 seconds.

Q.11. At University of Probability, there are 375 freshmen, 293 sophomores, 187 juniors, & 126 seniors.One student will randomly be chosen to receive an award.

What percent chance is there that it will be a junior? Round to the nearest whole percent.

Answer :- 19%

Q.12. If you were to dial any 7 digits on a telephone in random order, what is the probability that youwill dial your own phone number? Assume that your telephone number is 7-digits.

Answer :- 1 in 10,000,000

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 43/56

Q.13. An anthropologist discovers an isolated tribe whose written alphabet contains only six letters (callthe letters A, B, C, D, E and F). The tribe has a taboo against using the same letter twice in the sameword. It's never done.If each different sequence of letters constitues a different word in the language,

what is the maximum number of six-letter words that the language can employ?

Answer :-The language can employ maximum of 720 six-letter words.

Q.14. Kate, Demi, Madona, Sharon, Britney and Nicole decided to lunch together in a restaurant. Thewaiter led them to a round table with six chairs. How many different ways can they seat?

Answer :- There are 120 different possible seating arrangments.

Q.15. e(int n)

{

if(n>0)

{

(not clear)

printf("%d",n);

e(--n);

}

return

}

Ans:- 0,1,2,0

Q.16. a=5,b=3,c=a,b

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 44/56

d=(a,b)

printf(c,d)

Ans:- c=5,d=3

Q.17. char s1[20]="hello world";

s1[5]="\0";

printf("%d",strlen(s1));

printf("%%.%...(not clear)",s1);

}

Ans:bad format specifier

Q.18. func(int i)

{

static int count;

count=count+i;

}

Ans: 1+2+3...(counts values does not go after funtion call)

Q.19. Atomicity is _____

a)Either all actions are carried out or none are. Users should not have to worry about the effect of incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions.

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 45/56

b)A concept which is used to model a relationship between a collection of entities and relationships. It isused when we need to express a relationship among relationships.

Asnwer :- Either all actions are carried out or none are. Users should not have to worry about the effectof incomplete transactions. DBMS ensures this by undoing the actions of incomplete transactions.

Q.20.The phase that identifies an efficient execution plan for evaluating a query that has the leastestimated cost is referred to as___.

a) Query optimization

b) Query String

Answer :- Query optimization

Q.21. Expansion of DDL is _____.

a) Data Description Language

b) Data Definition Language

c) Data Degree Language

Answer :- Data Definition Language

Q.22. A collection of conceptual tools for describing data, data relationships data semantics andconstraints is called as_____.

a) Data base

b) Table

c) Data model

Answer :- Data model

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 46/56

1) A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hatsincluding 4/5 of the brown hats. What fraction of the unsold hats were brown.

a)1/60

b)1/15

c)3/20

d)3/5

e)3/4

Answer : 3/20

2) 10 in 4 seconds, ? in 6 minutes

a)800

b)900

c)650

Answer : 900

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 47/56

3) Mohan earned twice as much as Deep.Yogesh earned rs.3/- more than half as much as deep. If theamounts earned by Mohan,Deep,Yogesh are M,D,Y respectively, Which of the following is the correctordering of these amounts?

a)M< D < Y

b)M< Y < D

c)D < M < Y

d)It cann t be determined from the information given

e)D < Y < M

Answer : M< D < Y

4) At a special sale, 5 tickets can be purchased for the price of 3 tickets.

If 5 tickets are purchased at the sale, the amount saved will be

What percent of the original price of the 5 tickets?

a)20%

b)33.3%

c)40%

d)60%

e)66.6%

Answer : 40%

5)Next number in the series 1, 1/2, 1/4, 1/8 ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 48/56

a) 1/25

b) 1/16

c) 1/36

Answer : 1/16

6) In 6 seconds a light flashes once. In one hour how many times it will flash?

a) 569 times

b) 601 times

c) 499 times

Answer : 601 times

7) A clock is late by 1 minute 27 seconds in a month. Then how much will it be late in 1 day?

a) 3.0 sec

b) 2.9 sec

c) 2.8 sec

Answer : 2.9 sec

8.) A ship started from port and moving with I miles/hour and other ship started From L and movingwith H miles/hour . At the place where these two ships will meet?.

a)( L*I*H)/(H+I)

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 49/56

b)(L+I+H)/(H*I)

c)(L/I/H)*(H/I)

Answer : ( L*I*H)/(H+I)

9) Find the average height of five students with heights 142,147,153,165,157 in cms?

a) 152

b) 152.2

c) 152.4

d) 152.8

Answer : 152.8

10) The average marks of girls in a class is 62.5. The average marksof 4 girls among them is 60.Theaverage marks of remaining girls is 63,then what is the number of girls in the class?

a) 11

b) 10

c) 9

Answer : 10

11) The average price of 10 books is increased by 17 Rupees when one of them whose value is Rs.400 isreplaced by a new book.What is the price of new book?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 50/56

a) 570

b) 750

c) 600

Answer : 570

12) The average age of Mr and Mrs Sharma 4 years ago is 28 years .If the present average age of Mr andMrs Sharma and their son is 22 years. What is the age of their son?

a) 2

b) 1

c) 4

Answer : 2

13) The average weight of a class of 30 students is 40 kgs. If the teacher s weight is included thenaverage increases by 2 kgs. Find the weight of the teacher?

a) 102

b) 100

c) 98

Answer : 102

14) In a group the average income of 6 men is 500 and that of 5 women is 280, then what is averageincome of the group?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 51/56

a) 400

b) 100

c) 200

Answer : 400

15) The average marks of a marks of a student in 4 Examination is 40.If he got 80 marks in 5th Exam thenwhat is his new average?

a) 48

b) 84

c) 40

Answer : 48

16) Find the average of first 50 natural numbers.

a) 16

b) 15.5

c) 14

Answer : 15.5

17) X = 2, Y = 3, Z = 6 Find the value of Z/(X + Y)-(X + Y)/Z

Answer: 11/30

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 52/56

18)What does the hexadecimal number F80 in radix 8.

a) 7600

b) 6400

c) 4000

Answer: 7600

19)In a murder case there are four suspects A,B,C,D. Each of them makes a statement. They are A: Ihad gone to the theatre with S at the time of the murder .B: I was playing cards with A at the time of the murder .C: Q didn t commit the murder .D: C is not the murderer .Assuming the only one of theabove statement is false and that one of them is the murderer, who is the murderer?

a) A

b) B

c) C

d) D

Answer: D

20) Q != 0 and k = (Q X n s)/2.What is the value of n?

a) (2 x k + s)/Q

b) (2 x s x k)/Q

c) (2 x k s)/Q

d) (2 x k + s x Q)/Q

e) (k + s)/Q

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 53/56

Answer: (2 x k + s)/Q

21)Rahim earned twice as much as Deeptha. Yogi earned rs.3/- more than half as much as Deeptha.If the amounts earned by Raheem,Deeptha,Yogi are R,D,Y respectively, Which of the following is thecorrect ordering of these amounts?

a) R< D < Y

b) R< Y < D

c) D< R < Y

d) Cannot be determined

e) D< Y < R

Answer: Cannot be determined.

22) At University of Probability, there are 375 freshmen, 293 sophomores, 187 juniors, & 126 seniors.One student will randomly be chosen to receive an award.What percent chance is there that it will be a junior? Round to the nearest whole percent.

Answer : 19%

23) If you were to dial any 7 digits on a telephone in random order, what is the probability that you willdial your own phone number? Assume that your telephone number is 7-digits.

Answer : 1 in 10,000,000

24) An anthropologist discovers an isolated tribe whose written alphabet contains only six letters (callthe letters A, B, C, D, E and F). The tribe has a taboo against using the same letter twice in the sameword. It s never done.If each different sequence of letters constitues a different word in the language,what is the maximum number of six-letter words that the language can employ?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 54/56

Answer : The language can employ maximum of 720 six-letter words.

25) Kate, Demi, Madona, Sharon, Britney and Nicole decided to lunch together in a restaurant. Thewaiter led them to a round table with six chairs. How many different ways can they seat?

Answer : There are 120 different possible seating arrangments.

26) A man can row 5 kmph in still water. If the river is running at 1kmph, it takes him 75 minutes to rowto a place and back. How far is the place?

a) 3km

b) 2.5 km

c) 4 km

d) 5 km

Answer : 3km

27) 729 ml of a mixture contains milk and water in ratio 7:2. How much of the water is to be added toget a new mixture containing half milk and half water?

a) 79 ml

b) 81 ml

c) 72 ml

d) 91 ml

Answer : 81ml

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 55/56

28)If log 0.317=0.3332 and log 0.318=0.3364 then find log 0.319 ?

a)0.3396

b)0.3369

c)0.3368

d)0.3338

Answer : 0.3396

29) A box of 150 packets consists of 1kg packets and 2kg packets. Total weight of box is 264kg. Howmany 2kg packets are there ?

a)36

b)114

c)120

d)50

Answer : 114.

30) The letters P, Q, R, S, T, U and V, not necessarily in that order represents seven consecutive integersfrom 22 to 33.

U is as much less than Q as R is greater than S.

V is greater than U.

Q is the middle term.

P is 3 greater than S.

Can you find the sequence of letters from the lowest value to the highest value?

8/3/2019 January 2012 HCL Placement Paper

http://slidepdf.com/reader/full/january-2012-hcl-placement-paper 56/56

Answer : The sequence of letters from the lowest value to the highest value is TUSQRPV.

31)Because cigars cannot be entirely smoked, a Bobo who collects cigar butts can make a cigar to smokeout of every 3 butts that he finds.Today, he has collected 27 cigar butts. How many cigars will he be ableto smoke?

Answer : 13

32)A boy found that he had a 48 inch strip of paper. He could cut an inch off every second.How longwould it take for him to cut 48 pieces? He can not fold the strip and also, can not stack two or morestrips and cut them together.

Answer : 47 seconds