Sie sind auf Seite 1von 25

Category SubCategory Location Company About HCL:-

IT Placement Papers Bangalore HCL

HCL is a leading global Technology and IT Enterprise with annual revenues of US$ 5.3 billion. The HCL Enterprise comprises two companies listed in India, HCL Technologies and HCL Infosystems HCL is one of India's original IT garage start ups. Its range of offerings span R&D and Technology Services, Enterprise and Applications Consulting, Remote Infrastructure Management, BPO services, IT Hardware, Systems Integration and Distribution of Technology and Telecom products in India. The HCL team comprises 71,000 professionals of diverse nationalities, operating across 29 countries including 500 points of presence in India. HCL has global partnerships with several leading Fortune 1000 firms, including several IT and Technology majors. Working at HCL - Why should i Join HCL? HCL Enterprise is a leading Global Technology and IT enterprise with annual revenues of US $5.5 billion. HCL Enterprise comprises of two companies listed in India - HCL Technologies & HCL Infosystems. HCL Infosystems offers products and infrastructure solutions in the fields of computing, communications, networking, office automation, broadcasting and imaging. HCL Technologies is one of India's leading global IT services, providing software - led IT solutions, remote infrastructure management services and BPO.

HCL Placement Paper Pattern 2011-2012 freshers


Posted on

About HCL : HCL founded in 1976, is one of Indias original IT garage start ups. Fueled by the entrepreneurial zeal of its founders, HCL developed the first indigenous microcomputer in 1978, at the same time as Apple. Since then, HCL has had a 3 decade rich history of inventions and innovations. The HCL team comprises 80,000 professionals of diverse nationalities, operating across 31 countries including 500 points of presence in India. HCL has global partnerships with several leading Fortune 1000 firms, including several IT and Technology majors. In India, HCL has its prescence in 170 cities with 500 Service centres, reaching out to around 4000 towns.

Why should i Join HCL? HCL Enterprise is a leading Global Technology and IT enterprise with annual revenues of US $5.5 billion. HCL Enterprise comprises of two companies listed in India HCL Technologies & HCL Infosystems. HCL Infosystems offers products and infrastructure solutions in the fields of computing, communications, networking, office automation, broadcasting and imaging. HCL Technologies is one of Indias leading global IT services, providing software led IT solutions, remote infrastructure management services and BPO. 1) Written Test 2) Interview

Written Test contains 4 categories: 1) VERBAL (25Que- 25min) (Not that much tough) 2) QUANT (25Que 35min) (Very easy ones (GRE)) 3) TECHNICAL (25 Que- 35min) ( C,C++ knowledge) 4) APTITUDE(25 Que -35min) (Number series, (easy)) In Interview Questions are:some of the interview questions 1) What is ur fav subject in ur curriculam 2) Difference b/w C & C++ (Based on 1st one) 3) What are advantages of C++ over C ? 4) What is POLYMORPHYSM and How can we achieve it in our C++ programs? 5) What will u do if u have a clash with ur coleague 6) If u are given Extra work in the Office and Your girl frnd is waiting for u at the

out side.Then what will u do

HCL Placement Paper - I:1. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of the cost. What percent of cost would be gross profit on the item have been if it had been sold without the discount? (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 hats including 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 are reversed, 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 per share and the total increase for the x shares was Rs 12.50, how many shares of stock had been purchased ? (A)25 (B)50 (C)75 (D)100 (E)125 Answer :B)50 5. 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 :c)40% 6. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina works independently at the job for 8 hours and then Ann works independently, 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 the machine make in 6 min.? a) 900 b) 600 c) 360 d) 240 e) 150 Ans: a 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 same time, 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 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 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 fare for 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 number between 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 along one entire side of the warehouse that increased the floor by one-half as much as the original floor. How many meters did the addition extend beyond the original buildings ? (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. What time was indicated on the watch at 6.30 p.m of the same day if the watch operated continuously that time ? (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 solution spills out of the jug, and the jug is then filled to capacity with water, approximately what percent of the resulting solution in the jug is salt? (A)7.5% (B)9.5% (C) 10.5% (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 the cost. What percent of cost would be gross profit on the item have been if it had been sold without the discount? (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 hats including 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 21. How many integers n greater than and less than 100 are there such that,if the digits of n are reversed, 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; 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 - II:1. int x=5; y= x&y Multiple Choice Questions: Ans : c 2. Y=10; if( Y++>9 && Y++!=10 && Y++>10) printf("........ Y); else printf("".... ) Ans : 13 3. f=(x>y)?x:y a) f points to max of x and y b) f points to min of x and y c)error d) ........ Ans : a 4. if x is even, then (x%2)=0 x &1 !=1 x! ( some stuff is there) a)only two are correct b) three are correct c), d) ....

Ans : all are correct 5. which of the function operator cannot be over loaded a) <= b)?: c)== d)* Ans: b and d 6. How many of the integers between 25 and 45 are even ? (A)21 (B)20 (C)11 (D)10 (E)9 Ans:d)10 7. 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 fare for 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 8. A computer routine was developed to generate two numbers (x,y) the first being a random number between 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) 9. A warehouse had a square floor with area 10,000 sq.meters. A rectangular addition was built along one entire side of the warehouse that increased the floor by one-half as much as the original floor. How many meters did the addition extend beyond the original buildings ? (A)10 (B)20 (C)50 (D)200 (E)500 Ans: c)50 10. A digital wristwatch was set accurately at 8.30 a.m and then lost 2 seconds every 5 minutes. What time was indicated on the watch at 6.30 p.m of the same day if the watch operated continuously that time ? (A)5:56 (B)5:58 (C)6.00 (D)6.23 (E)6.26 Ans :E) 6.26 11. A 5 litre jug contains 4 litres of a salt water solution that is 15 percent salt. If 1.5 litres of the solution spills out of the jug, and the jug is then filled to capacity with water, approximately what percent of the resulting

solution in the jug is salt? (A)7.5% (B)9.5% (C) 10.5% (D)12% (E)15% Ans :A)7.5% 12. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of the cost. What percent of cost would be gross profit on the item have been if it had been sold without the discount? (A)20% (B)40% (C)50% (D)60% (E)66.6% Ansr :c) 50% 13. A millionaire bought a job lot of hats 1/4 of which were brown. The millionaire sold 2/3 of the hats including 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 14. How many integers n greater than and less than 100 are there such that,if the digits of n are reversed, the resulting integer is n+9 ? (A)5 (B)6 (C)7 (D)8 (E)9 Ans :D)8 15. An investor purchased a shares of stock at a certain price.If the stock increased in price Rs 0.25 per share and the total increase for the x shares was Rs 12.50, how many shares of stock had been purchased ? (A)25 (B)50 (C)75 (D)100 (E)125 Ans :B)50 16. 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% Ans :c)40% 17. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina Works independently at the job for 8 hours and then Ann works independently, 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 18. 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 Ans :C) 5 19. A sink has 12 lits of water some quantity of water is taken out. if the remainng water is 6 litres less then the water taken out then quantity of water taken out is. a. 3 b. 6 c. 9 d. 1 20. which is the 4 digit number whose second digit is thrice the first digit and 3'rd digit is sum of 1'st and 2'nd and last digit is twice the second digit. 1.2674 2.1349. 3.3343 4.3678 21. In a straight highway 2 cars starts from the same point in opposite directions each travels for 8 Kms and take left turn then travel for 6 Kms what is the distance between them now. 1.16 2.20 3.25 4.10 22 . main() { int var=25,varp; varp=&var; varp=10; fun(varp); printf(%d%d",var,varp); ans a)45,45 b)55,55 c) 20,55; 23. u r given two statements a=(10.15); b=10,15; if they are executed what is the output printf("%d%d",a,b); a)10,15 b)15,10 c)10,10 d)15,15 ans a 24. define null 0 ans=0; 25. #define inc(x) x++ main() { int t=1; printf("%d",inc(t++)); } ans.error

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) { 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 sons as 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 the towers are 250ft apart. Two birds on top of each tower fly down with the same speed and meet at the same instant on the ground to pick a grain. What is the distance between the foot of tower A and the grain? Ans:90ft 5.raju having some coins want to distribute to his 5 son , 5 daughter and driver in a manner that , he gave fist coin to driver and 1/5 of remaining to first son he again gave one to driver and 1/5 to 2nd son and so on.... at last he equally distributed all the coins to 5 daughters. how many coins raju initially have??? 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 less than 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 than 1/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 the memory required for this? Ans. 4MB

These are Placement questions asked in HCL Placement drive for 2011 freshers.You can start here to be in HCL.

1. A merchant sells an item at a 20 percent discount. but still makes a gross profit of 20 percent of the cost. What percent of cost would be gross profit on the item have been if it had been sold without the discount? (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 hats including 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 are reversed, the resulting integer is n+9 ? (A)5 (B)6 (C)7 (D)8 (E)9 Answer )8 4. An investor purchased a shares of stock at a certain price. If the stock increased in price Rs 0.25 per share and the total increase for the x shares was Rs 12.50, how many shares of stock had been purchased ? (A)25 (B)50 (C)75 (D)100 (E)125 Answer :B)50 5. 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 :c)40% 6. Working independently, Tina can do a certain job in 12 hours. Working independently, Ann can do the same job in 9 hours. If Tina works independently at the job for 8 hours and then Ann works independently, 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 the machine make in 6 min.? a) 900 b) 600 c) 360 d) 240 e) 150 Ans: a 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 same time, 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 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 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 fare for 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 number between 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 along one entire side of the warehouse that increased the floor

by one-half as much as the original floor. How many meters did the addition extend beyond the original buildings ? (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. What time was indicated on the watch at 6.30 p.m of the same day if the watch operated continuously that time ? (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 solution spills out of the jug, and the jug is then filled to capacity with water, approximately what percent of the resulting solution in the jug is salt? (A)7.5% (B)9.5% (C) 10.5% (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 the cost. What percent of cost would be gross profit on the item have been if it had been sold without the discount? (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 hats including 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 21. How many integers n greater than and less than 100 are there such that,if the digits of n are reversed, the resulting integer is n+9 ? (A)5 (B)6 (C)7 (D)8 (E)9 Ans )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; 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 25. Which of the following about the following two
declaration is true i ) int *F() ii) int (*F)() Choice : a) Both are identical b) The first is a correct declaration and the second is wrong c) The first declaraion is a function returning a pointer to an integer and the second is a pointer to function returning int d) Both are different ways of declarin pointer to a function Answer : c

26. What are the values printed by the following program? #define dprint(expr) printf(#expr "=%d\n",expr) main() { int x=7; int y=3; dprintf(x/y); } Choice: a) #2 = 2 b) expr=2 c) x/y=2 d) none Answer: c

HCL Technical Interview Questions 2011-2012


Posted on

Technical round has lots importance for a company.Here I am sharing some HCL Placement Technical round questions and answers for 2011-2012 freshers. What are objects and use of these ? What is Polymorphism What is Abstraction What is LAN,WAN,SAN.

Explain Join Command What is the Organization elements? A client running the business through world wide,but he has in all branches,all bank accounts in only ICICI Bank a/cs but how many house banks he need to create? How it explain me? I have a hard disk. After inserting this what are the recommended steps to install it on your solaris What is the difference between udp and tcp? How to find the digits truncation when assigning the interger variable to the character variables. like int i=500; char x = i : here we have truncation. how to find this. another ex: i =100; char x=i. here we do not have truncation. how will you clarify the requirements why you want to leave the current job can you change name of main()?how? what is the difference between through and throws? What is regex (lookup)? When you should use it? What is the Importance of co-education in Our society. A brief difference between Session and Cookies in asp.net Difference between ADO.net Dataset , ADO Record Set & ADO Data Reader? What is WCF? Pls Explain clearly with exmple. What is the difference between appsetting and connectionstring tags in web.config file ] What is a Managed Data? Difference between Trace and Debug ? What is Web Application? Where is ViewState information stored? what do you mean software devlopment ? What are all the ways to find out types of objects? what is view state and its use How .net CLR works with n-tier application What is the Difference B/W Finalize() and Dispose() in .Net?

Data Structure Interview Questions and Answers for 2011-2012 freshers : Set-1
Posted on

This is a collections of data structure interview Questions with answers.You can study to make your interview best. Q. What is data structure? A data structure is a way of organizing data that considers not only the items stored, but also their relationship to each other. Advance knowledge about the relationship between data items allows designing of efficient algorithms for the manipulation of data. Q. List out the areas in which data structures are applied extensively? Compiler Design, Operating System, Database Management System, Statistical analysis package, Numerical Analysis, Graphics, Artificial Intelligence, Simulation Q. What are the major data structures used in the following areas : RDBMS, Network data model and Hierarchical data model. RDBMS = Array (i.e. Array of structures) Network data model = Graph Hierarchical data model = Trees Q. What are the types of Collision Resolution Techniques and the methods used in each of the type? Open addressing (closed hashing), The methods used include: Overflow block. Closed addressing (open hashing), The methods used include: Linked list,

Binary tree. Q. In RDBMS, what is the efficient data structure used in the internal storage representation? B+ tree. Because in B+ tree, all the data is stored only in leaf nodes, that makes searching easier. This corresponds to the records that shall be stored in leaf nodes. Q. What is a spanning Tree? A spanning tree is a tree associated with a network. All the nodes of the graph appear on the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight between nodes is minimized. Q. Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes? No. The Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesnt mean that the distance between any two nodes involved in the minimum-spanning tree is minimum. Q. Which is the simplest file structure? (Sequential, Indexed, Random) Sequential is the simplest file structure. Q. Whether Linked List is linear or Non-linear data structure? According to Access strategies Linked list is a linear one. According to Storage Linked List is a Non-linear one. Q.Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes? Minimal spanning tree assures that the total weight of the tree is kept at its minimum. But it doesnt mean that the distance between any two nodes involved in the minimum-spanning tree is minimum. Q.Whether Linked List is linear or Non-linear data structure? According to Access strategies Linked list is a linear one. According to Storage Linked List is a Non-linear one. Q.What is the quickest sorting method to use? The answer depends on what you mean by quickest. For most sorting problems, it just doesnt matter how quick the sort is because it is done infrequently or other operations take significantly more time anyway. Even in cases in which sorting

speed is of the essence, there is no one answer. It depends on not only the size and nature of the data, but also the likely order. No algorithm is best in all cases. There are three sorting methods in this authors toolbox that are all very fast and that are useful in different situations. Those methods are quick sort, merge sort, and radix sort. The Quick Sort The quick sort algorithm is of the divide and conquer type. That means it works by reducing a sorting problem into several easier sorting problems and solving each of them. A dividing value is chosen from the input data, and the data is partitioned into three sets: elements that belong before the dividing value, the value itself, and elements that come after the dividing value. The partitioning is performed by exchanging elements that are in the first set but belong in the third with elements that are in the third set but belong in the first Elements that are equal to the dividing element can be put in any of the three sets the algorithm will still work properly. The Merge Sort The merge sort is a divide and conquer sort as well. It works by considering the data to be sorted as a sequence of already-sorted lists (in the worst case, each list is one element long). Adjacent sorted lists are merged into larger sorted lists until there is a single sorted list containing all the elements. The merge sort is good at sorting lists and other data structures that are not in arrays, and it can be used to sort things that dont fit into memory. It also can be implemented as a stable sort. The Radix Sort The radix sort takes a list of integers and puts each element on a smaller list, depending on the value of its least significant byte. Then the small lists are concatenated, and the process is repeated for each more significant byte until the list is sorted. The radix sort is simpler to implement on fixed-length data such as ints. Q.How can I search for data in a linked list? Unfortunately, the only way to search a linked list is with a linear search, because the only way a linked lists members can be accessed is sequentially. Sometimes it is quicker to take the data from a linked list and store it in a different data structure so that searches can be more efficient.

Data Structure Interview Questions and Answers for 2011-2012 freshers : Set-2
Posted on

Data Structure Interview Questions and Answers for 2011-2012 freshers : Set-1
Q. If you are using C language to implement the heterogeneous linked list, what pointer type will you use? The heterogeneous linked list contains different data types in its nodes and we need a link, pointer to connect them. It is not possible to use ordinary pointers for this. So we go for void pointer. Void pointer is capable of storing pointer to any type as it is a generic pointer type. Q. Minimum number of queues needed to implement the priority queue? Two. One queue is used for actual storing of data and another for storing priorities. Q. What is the data structures used to perform recursion? Stack. Because of its LIFO (Last In First Out) property it remembers its caller so knows whom to return when the function has to return. Recursion makes use of system stack for storing the return addresses of the function calls. Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written, explicit stack is to be used. Q. What are the notations used in Evaluation of Arithmetic Expressions using prefix and postfix forms? Polish and Reverse Polish notations. Q. Convert the expression ((A + B) * C (D E) ^ (F + G)) to equivalent Prefix and Postfix notations. Prefix Notation: * +ABC ^ DE + FG Postfix Notation: AB + C * DE FG + ^ -

Q. Sorting is not possible by using which of the following methods? (Insertion, Selection, Exchange, Deletion) Sorting is not possible in Deletion. Using insertion we can perform insertion sort, using selection we can perform selection sort, using exchange we can perform the bubble sort (and other similar sorting methods). But no sorting method can be done just using deletion. Q. What are the methods available in storing sequential files ? Straight merging, Natural merging, Polyphase sort, Distribution of Initial runs. Q. List out few of the Application of tree data-structure? The manipulation of Arithmetic expression, Symbol Table construction, Syntax analysis. Q. List out few of the applications that make use of Multilinked Structures? Sparse matrix, Index generation. Q. In tree construction which is the suitable efficient data structure? (Array, Linked list, Stack, Queue) Linked list is the suitable efficient data structure. Q. What is the type of the algorithm used in solving the 8 Queens problem?

Backtracking. Q. In an AVL tree, at what condition the balancing is to be done? If the pivotal value (or the Height factor) is greater than 1 or less than -1. 16. What is the bucket size, when the overlapping and collision occur at same time? One. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values. Q. Classify the Hashing Functions based on the various methods by which the key value is found. Direct method, Subtraction method, Modulo-Division method, Digit-Extraction method, Mid-Square method, Folding method, Pseudo-random method. Q.What is the heap? The heap is where malloc(), calloc(), and realloc() get memory. Getting memory from the heap is much slower than getting it from the stack. On the other hand, the heap is much more flexible than the stack. Memory can be allocated at any time and deallocated in any order. Such memory isnt deallocated automatically; you have to call free(). Recursive data structures are almost always implemented with memory from the

heap. Strings often come from there too, especially strings that could be very long at runtime. If you can keep data in a local variable (and allocate it from the stack), your code will run faster than if you put the data on the heap. Sometimes you can use a better algorithm if you use the heap faster, or more robust, or more flexible. Its a tradeoff. If memory is allocated from the heap, its available until the program ends. Thats great if you remember to deallocate it when youre done. If you forget, its a problem. A memory leak is some allocated memory thats no longer needed but isnt deallocated. If you have a memory leak inside a loop, you can use up all the memory on the heap and not be able to get any more. (When that happens, the allocation functions return a null pointer.) In some environments, if a program doesnt deallocate everything it allocated, memory stays unavailable even after the program ends.

Q.How do you assign an address to an element of a pointer array ? We can assign a memory address to an element of a pointer array by using the address operator, which is the ampersand (&), in an assignment statement such as ptemployee[0] = &projects[2]; Q.Run Time Memory Allocation is known as ? Allocating memory at runtime is called a dynamically allocating memory. In this, you dynamically allocate memory by using the new operator when declaring the array, for example : int grades[] = new int[10];

Das könnte Ihnen auch gefallen