TECH MAHINDRA PLACEMENT PAPERS

Questions from a previous placement exam test paper - techmahindra / axes it technologies company recruitment - employment test.
1. There are total 15 people. 7 speaks french and 8 speaks spanish. 3 do not speak any language. Which part of total people speaks both languages.
Ans: 1/5
2. A jogger wants to save ?th of his jogging time. He should increase his speed by how much %age.
Ans: 33.33 %
3. A is an integer. Dividing 89 & 125 gives remainders 4 & 6 respectively. Find a ?
Ans: 17
4. In a office work is distribute between p persons. If 1/8 members are absent then work increased for each person.
5. Question based on cubes. In which fill the blank box.
6. 120, 315, 300, 345, ? ?- 390
7. 2,1, 4, 3, 6, 6, 8, 10, 10, ?, ? ? 12, 15
8. Questions based on figure rotation
9. Questions based on figure rotation
10. A Child is saying numbers 1, 2, 3, 4. When he says 1 Another child puts white marble in a box. On saying 2 he puts Blue marble and on saying 3 he puts red ma rble. When child says 4 other child take out white and blue marble. Child says some no. in a sequence then questions are based on the no. of marbles in the box. Like this
1,1,2,3,1, 4, 1,1,3,2,2,4,111?
a) Find the no. of Blue marble in the box ? 2
b) Find the no. of White-2
c) No. of red marbles - 7
11. Questions based on logical reasoning (R. S. Agrawal)
a) all pens are hens. All hens are doctor.
(I) all pens are doctor.
(II) all doctors are pen.
Ans: Only first conclusion is correct
12. if M person r buying a thing costing D$ each,, if 3 person get away, how much each person has to spend so that total expenditure is same ???
13. which is smallest?
a. 1/7
b 1/8
c 2/9
d 3/13 or something similar having denominations as 11 and 13 in option ?d? and ?e?
14. f Rix can collect 45 pieces in 1 min.. and Rax take 1 and half minute for same,, what is time require d to collect 300 pieces when both working together??
15. One long quiz followed by 5 questions 3 cages having 3 tags on them, sum of digit of cage num not to exceed 10, and other cond.
16. one quest of grandfather-father-son type quest.
17. A is shorter than B but taller than E, D is tallest, C is just shorter than A, who is shortest or similar questions?
18. Rectangular box, 25*20*2 converted in to cylinder of dia 10? what is height in terms of ?pai?
Company Name : Tech Mahindra
Type : Fresher, Job Interview
Hi, guys I am from Punjabi University, Patiala doing B. Tech in the stream of CSE.

Selection Procedure:
1) Written Test
2) Technical Round
3) HR Round
1) Written Test: Around 270 peoples attended for written test, total 51 were furthered to technical
round den 37 furthered to hr round nd finally 27 are selected.
- Online test consist of two parts
- Aptitude (easy time mgmt nedded)
- English (very easy)
- NO NEGATIVE marking

Aptitude consists of 3 parts comprising of 70 questions to b done in 40 mins (time
management needed here)
1. Non verbal reasoning(35 questions)
2. Verbal reasoning(20 questions)
3.Quantitative (15 questions)

RS Aggarwal is sufficient for aptitude but try to do fast and so all questions as there is no negative
marking.

Second part is English it has 8 sections and 100 questions to b done in 40 minutes
1. Tenses(10 questions)
2. Articles(10 questions)
3. Verbiage (synonymms 10 questions)
4. Confusing words (similar sound words typ principle/principal etc 10 questions)
5. Reading comprehension(10 questions very easy 1)
6. Subject verb agreement(20 questions do this from cat material or simmilar)
7. Prepositions(20 questions easy one)
8. One more section of 10 questions i cant remember but easy one

English is easy almost all students complete this section in half an hour. Do this from any good
English book this is very easy part. Each section has different cut of may b 60% in English and 70% in
Aptitude
which can be increased or decreased by Tech Mahindra.

Out of 270 students 51 cleared test, Huge reduction here so b careful. Then interviews -

Technical Interview: this went for 40-45 min for me:
Interviewer: tell me about your project
me: told projects plus what difficulties i faced
he: tell me about your strengths
me: told
with each strength I told he asked for example
this take 15 -20 min
then he see my resume and certificates n asked few more questions on my hobby
then few puzzles as i was topper in maths.
and then so on hobbies
he: how you rate your communication skills

me: 8-9 out of 10
he: what is client for you
me: told
And few questions to elaborate this and interview end after 45 minutes. It was good exp for me and I
have shortlisted for HR. There are few more panels. From few they ask puzzles like water jug problem
etc. From few they ask about c/c++, Data Structures, DBMS, subjects u have good marks in your
dmc. 37 are shortlisted for HR
HR interview: it went for 20 min for me:
he: why you want to join Tech Mahindra
me: told.....
he: why we select you?
me: told i m technically sound....
he: what are area of interest?
me: told
then ask few question about my fav subject
I told operating system so few quetion on operating system
he: why you not selected in infy(few days before infy come at our college)
me: told......
he: how many times do you lie during a day?
me: told....
he: do you have gf?
me: told....
he: how many times ou lie to her?
me: told......
and few more questions related to this
he: do u want to ask any question?
me: ask few questions.....

Try to ask question this shows your interest in company. From my friends HR asked about movies
from some ask to speak for 5 min on some topic from some ask about what you know about Tech
Mahindra and so on. 27 are placed in Tech Mahindra try to be natural in interview.

Best of Luck Guys!

Exam/Interview Date : 06-Dec-2010
No of Rounds : Aptitude Test, Techincal Round-1, Client/Manager Interview
Tech Mahindra | Placement Paper (Aptitude, Technical) - 21.01.10
Company Name : Tech Mahindra
Type : Fresher
Exam/Interview Date : 21-Jan-2010
No of Rounds : Aptitude Test, Techincal Round-1, Techincal Round-2
Location : Chennai
Job Interview, Question Paper Writeup. : Hi friends i attended the tech mahindra recruitment
process on 21-01-2010. It consist of four rounds

On line Test

Technical Interview-1

Technical Interview-2

HR
Online Test consist of 100 questions

35 Q's from logical reasoning-Non verbal

20 Q,s from logical reasoning-Verbal






15
10
10
10

The tech-1 interview was very easy the hr's tried to get some answers from us they asked only basic
and your technical strengths and project and paper presentation .. all the persons who attended this
interview were forwarded to next round...

In Tech-2 he asked me the technical strengths(he expects more than three) i told ds,os,c,c++ then he
asked me rated myself in those subjects after that he shoot out the following questions

DS











what is spanning tree
did you heard about Travelling sales man problem
what is shortest path
what is BFS DFS
explain prim's algorithm
what is linked list and doubly linked list
What is the advantage and disadvantage of doubly linked list
write the code for finding no of elements in a circular linked list
what are the types of traversals

OS








what is shell
what schedulling algorithm is used in Unix
how will you avoid dead lock(Banker's algorithm)
what is the difffernce between an interupt and function call
differ between multi user and multitasking
there are two programs one is os and another one is an application, in a single processor
system what will be executed only the os or only the application or both the os and application..
and how?
Is there any chance of deadlock in C



C



is it possible to store different type of variables in a single array?
int a=10;
int b;
b=(&a);
will it show an error

what are the stoge class in C and tel the scope and life time of it?
Finally in hr Round

Intriduce urself

read this bond after that sign it.......

By : Gowtham KS

Tech Mahindra Placement Paper on 8th Jan 2010 at Nagpur

Campus Recruitment By Tech Mahindra At Priyadarshini college of Engineering, Nagpur On
8th January, 2010.
Hi friends, I am sharing my experience with Tech Mahindra with you. I am Sanket, final
yr. IT student of Priyadarshini Institute of Engg. & Tech.,Nagpur, 2010 batch. I got placed at
Tech Mahindra with the blessings of God, My family & well wishers. And yes
Discussionsworld helped me a lot...

q's from quantitative apps
Q's from reading comprehension
Q's Englsh-1
Q's English-2

It was a 3 stage procedure
1.Online Aptitude Test
2.Technical Interview
3. GD + HR

They gave nice presentation & explained the procedure for online apti.They will give unique
username & password to you to access the online test paper.Different paper sets are there,
so don't peep into neighbor's PC.

1. Aptitude Test
Apti had 100 questions to be solved in 60 mins. Questions were divided into 6 sections
1. Verbal reasoning
2. Non-verbal reasoning
3 Quantitative Aptitude
4 English I
5 English II
6 English III

There was sectional cut-off. They told us there was no negative marking. But after results
were out for Apti, many of the students who solved whole paper could not cleared the Apti.
No. of candidates clearing the apti was less, so there must be a negative marking.

Solve English Section first, they were so easy. Synonyms, antonyms, reading
comprehension, filling blanks with proper verbs, adjectives, prepositions, etc. Above average
student can also solve it in 15-20 mins. No need to go through Barrons.
Verbal reasoning & non-verbal reasoning were easy. R.S. Aggarwal is more than enough.
Go through it. Practice all type of questions from it. Different sets had different problems. so
don't left any part of R.S A.

Quantitative part had 12 questions. Some were very easy, some were easy but lengthy, 1-2
were really tough. Try to give them at least 15-20 mins.
Results were out in 20 mins. My friends told me i cleared the apti. Since i had little doubt
abt my Quantitative & sectional cut-off was there, i didn't believe them. But then I heard my
name, WOW, What a moment!!! a cleared most difficult hurdle of my way. Though TechM
apti was easy but sectional cut-off(& probable negative marking) makes it difficult Only 10-
25% can clear such an EASY Aptitude Test.
Then they give a form to fill to us. They asked for general information such as Educational
details, passport details, family details,languages known, career objective for next 3 years
(be specific such as system analyst, software testing, etc.)Future educational plans(eg, M.
Tech. DON'T WRITE MBA IN HRM particular, You may jeopardize your selection in HR Round)
Mine was 2nd no. for Technical Interview.

He was a nice & friendly. I asked him for permission to come in.He let me in & asked me to
take my sit. Thanking him, I sat & interview started.

T.I.: Tell me about Yourself & Family Background.
Me : Blah... blah...blah...Told him about my strengths & related them with my achievements.
T.I.: Your brothers works as software engineers? where?
Me.: Told.
T.I. : Which brach in .......?
Me. : Sir, I don't know the exact address, but it's near ...........
T.I.: (Smiling). Okkay.I got it.
T.I. : Your place of birth is "Yerli"! Where is it?

Me: told.
T.I.: Is there any lake near Tumsar?
Me: Yes sir, There is Chandpur lake. It's a famous tourist attraction.
T.I.: So, You are maharashtrian?
Me.: No sir,basically I am Hindi-sider.
T.I. : But born & brought up in Maharashtra.
Me. : Yes sir.
T.I: You can read Bengali???
Me: Yes Sir.
T.I.: How?
Me: Many of my college friends are Bengali. I learned from them.
T.I.: You are from I.T. Good. You learned C ,C++, Java, isn't it??
Me: Yes Sir.
T.I.: What is polymorphism?
Me.: Answered.
T.I. : What are classes in C++ ?
Me.: Thought for 5 seconds & then "SORRY SIR, I DON'T KNOW". I didn't get his question.I
was confused whether he's asking for different classes in C++ or Definition. & instead of
telling him that, I simply said SORRY Sir, I ....
T.I.: What is difference between Windows & Unix.
Me.: Told 2-3 differences..
T.I. : What is basic technical difference between Windows & Linux?
Me. : .......
T.I. : What is RDBMS.
Me: I didn't rembered it & I told him I don't know firmly.
T.I. You know DBMS?
Me: Yes sir.
T.I. : what is it?
Me: told.
T.I: Then, what is RDBMS.
Me : Still not clicked, I was blank & told I never heard of it.(!!!!!!!! :-) )
T.I. : Strange, You are from IT & you never heard of RDBMS.
T.I.: What is Waterfall Model?
Me: Explained with diagram.
T.I.: Strengths?
Me: Sir, I am a keen learner, always ready to learn new things. I am productive & a team
worker.
T.I.: Weakness?
Me: Sir, I go into much details of something, though it is not needed.
T.I.: Biggest achievements till date?
Me: I was District second in Scholarship Exam in school days. In case of college years, I am
Technical committee head of Intech i.e student's forum of my department.
T.I.: If you are placed, any preference for location, India or abroad?
Me : I am ready to work anywhere.
T.I.: Plans about Further studies??
Me : (Told exactly what I had written on their form). M. Tech but after 4 years.
T.I: Ok Sanket, You may go now.
Me: Thank you sir.

It lasted for abt 20 mins
I was really disappointed with my interview. I knew the answers of the questions
but didn't remembered those & I was angry on myself, shouting , yelling & really scared that

i wuold not get through the TI. I wanted to answer all the questions & those 2 "DON'T
KNOW"s were really hard to me to digest. I was waiting for TI result keeping my fingers
crossed.
I was confident, loud & clear while answering his questions. Even I said Don't Know
Loud & clear. Always gave answers after taking a small pause. Kept eye contact with him &
shows eagerness in my eyes while listening to him.
That worked for me.
Some guys were asked for their favrt subject & que based on it., abt project,
DBMS, ckts(ET students).Some guys were asked for only 1-2 technical questions, rest were
all HR questions.
It was TI + HR in fact.
Results were declared at around 9 pm.
I was overjoyed. I knew now I can easily clear GD+HR round. I was confident
about my selection. They gave us declaration form to fill & told to be ready with self-
attested documents (college ID+ previous mark-sheets, 10, 10+2 mark-sheets photocopies)
At 10pm, they announced that further round would be held on tomorrow. we
returned.
Next morning, HR took GD+HR.
He told some groups to choose the topics themselves, to some he gave the topic.
In my case, he gave us topic "whether marriage is necessary in Indian society."
Total 6 were there in my group
He grouped us & placed me in Against marriage.
It was easy for me & I was confident about my selection. One guy had written MBA
in HRM as his future career. HR shouted at him," If you want to be HR, why are you here.
Go & do your MBA. We want Technical People" That guy gave him some lame reason. So,
Don't try to fool HR, he is smart & know more thank you.

Do speak something in GD, you will get selected. HR didn't ask me anything, but he asked
some candidates about some significant people of India, Mogul Empire, hobbies, abt
attitude, latest issues, etc.
Other topics in GD were Separation of states, Capital Punishment to Kasab, Divorce
laws, such current issues.
Final Results were declared after an 1:30 hrs. My name was there. Package was 2.9lpa
That was the greatest moment of happiness of my life. I've got a job!!!! Only 3
from my branch were selected including me. One was my best friend. Total 18 were finally
placed from about 135 students of my college who sat for apti.
Very few candidates were rejected during TI & then during HR. Almost 90% guys
who cracked the Apti got placed.

Remember, if you cleared the Apti, rest will be much easier to you. For TechM, go through
R.S. Aggarwal thoroughly.It's sufficient. Remember Time Limit.Solve all the sections. At
least 60% questions from each section first to clear sectional cut-off & then try to attempt
others. Complete English Sections first, they are easy. In skill set, write about only those
languages where u are really confident & perfect. Better you write only C & prepare
thoroughly & clear all the concepts abt C. Refer Let Us C by Kanetkar for C. Be ready to
answer about your project, many question are based on your resume & form you fill before
entering TI. So think before writing something there.
I thank Discussionsworld, it was immensely helpful to me. It was my first online apti,TI &
GD, & I got placed. I got idea for Tech Mahindra preps from Discussionsworld & things
became easy for me. Pattern was similar to that discussed
here.

BEST OF LUCK!!!

ARITHMETIC SECTION

This section consists of 29 problems. The questions are simple though time consuming.

1. 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

2. 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

3. 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

4. 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 travelled

(a) 210 kms

(b) 30 kms

(c) 20 kms

(c) none of these

Ans. B

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

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

(a) 6

(b) 8

(c) 7

(d) data insufficient

Ans. C

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

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

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

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

11. 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

12. 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

13. 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

14. 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

15. 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

16. x% of y is y% of ?

(a) x/y

(b) 2y

(c) x

(d) can't be determined

Ans. C

17. 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

18. 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

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

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

22. 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

23. 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

24. 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

25. The difference b/w the compound interest payble half yearly and the simple interest on a

certain sum lent out at 10% p.a for 1 year is Rs 25. What is the sum?

(a) Rs. 15000

(b) Rs. 12000

(c) Rs. 10000

(d) none of these

Ans C

26. 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

27. 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

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

29. 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

LOGICAL SECTION

Directions: For questions 30-39 fill the missing number or letter in the given series

30. a, c, e, g, _

(a) h

(b) i

(c) d

(d) j

Ans. B

31. a, e, i, m, q, u, _, _

(a) y,c

(b) b,f

(c) g,i

(d) none

Ans. A

32. ay , bz , cw , dx ,__

(a) gu

(b) ev

(c) fv

(d) eu

Ans. D

33. 1, 2, 3, 5, 7, 11, __

(a) 15

(b) 9

(c) 13

(d) 12

Ans. C (series of prime numbers)

34. kp , lo , mn , __

(a) nm

(b) np

(c) op

(d) pq

Ans. A

35. R,M,__,F,D,__

(a) I, C

(b) A, Q

(c) L, N

(d) B, Q

Ans. A

36. ___, ayw, gec, mki, sqo

(a) awx

(b) usq

(c) prs

(d) lmn

Ans. B

37. 1, 3, 4, 8, 15, 27, __

(a) 60

(b) 59

(c) 43

(d) 50

Ans D

38. 0, 2, 3, 5, 8, 10, 15, 17, 24, 26,__

(a) 45

(b) 55

(c) 35

(d) 48

Ans. C

39. 2, 5, 9, 19, 37,__

(a) 64

(b) 55

(c) 75

(d) 40

Ans C

Directions for questions 40 to 45: Select the alternative that logically follows form the two given statements.

40. All scientists are fools. All fools are literates.

(a)All literates are scientists

(b) All scientists are literates

(c) No scientists are literates

(d) Both (a) and (b) are correct

Ans. B

41. No apple is an orange. All bananas are oranges.

(a) All apples are oranges

(b) Some apples are oranges

(c) No apple is a banana

(d) None of the above

Ans. A

42. All pens are elephants. Some elephants are cats.

(a) Some pens are cats

(b) No pens are cats

(c) All pens are cats

(d) None of the above

Ans. D

43. All shares are debentures.No debentures are deposits.

(a) All shares are deposits

(b) Some shares are deposits

(c) No shares are deposits

(d) None of the above

Ans. C

44. Many fathers are brothers. All brothers are priests.

(a) No father is a priest

(b) Many fathers are not priests

(c) Many fathers are priests

(d) Both (b) and (c)

Ans. B

45. Some green are blue. No blue are white.

(a) No green are white

(b) Some green are white

(c) No green are white

(d) None of the above

Ans. B

46. If the word "CODING" is represented as DPEJOH , then the word "CURFEW" can be represented?

(a) dvsgfx

(b) dvshfx

(c) dgshfx

(d) dtsgfy

Ans. A

47. If in a certain code "RANGE" is coded as 12345 and "RANDOM" is coded as 123678, then the code for the

word "MANGO" would be

(a) 82357

(b) 84563

(c) 82346

(d) 82543

Ans. D

Directions for questions 48-50:The questions are based on the following data

In a class of 150 students 55 speak English;85 speak Telugu and 30 speak neither English nor Telugu

48. How many speak both English and Telugu?

(a) 10

(b) 15

(c) 20

(d) 12

Ans. C

49.How many speak only Telugu?

(a) 55

(b) 45

(c) 65

(d) none of the above

Ans.C

50.How many speak at least one of the two languages?

(a) 120

(b) 100

(c) 250

(d) 50

Ans. A

Refer R.S Agarwal books for more questions of the same kind

Verbal -- Page 254 problems 53 to56

Nonverbal -- Pages 5,41,54,108,145,158

Page 354-355 8,13,

Read more: http://www.ittestpapers.com/articles/techmahindra(mbt)---paper----general---other-.html#ixzz17yNzE1uW

C-Test Paper

1. #include

* What is wrong in the following problem

main() {

int i,j;

j = 10;

i = j++ - j++;

printf("%d %d", i,j); }

ans: 0, 12

2.#include * What is the output of the following problem

main() {

int j;

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

foo();

}

foo() {

static int i = 10;

i+=10;

printf("%d\n",i); }

/* Out put is (***since static int is used i value is retained between

* 20 function calls )

* 30

* 40

*

/

3.#include #include #include /* This is asked in PCS Bombay walk-in-interview

* What is wrong in the following code

*/

main()

{

char *c;

c = "Hello";

printf("%s\n", c); }

/*ans:- Hello, The code is successfully running */

4. #include /* This problem is given in PCS BOMBAY walk-in-interview.

* What is the final value of i and how many times loop is

* Executed ?

*/

main()

{

int i,j,k,l,lc=0;

/* the input is given as 1234 567 */

printf("Enter the number string:<1234 567 \n");

scanf("%2d%d%1d",&i,&j,&k);

for(;k;k--,i++)

for(l=0;lprintf("%d %d\n",i,l);}

printf("LOOPS= %d\n", lc-1);

/* Ans: i = 16, and loop is executed for 169 times */

5.#include /* This is given in PCS Bombay walk-in-interview */

/* What is the output of the following program */

main() {

union {

int a;

int b;

int c;

} u,v;

u.a = 10;

u.b = 20;

printf("%d %d \n",u.a,u.b); }

/* Ans : The latest value assigned to any of the union member

will be present in the union members so answer is

20 20

*/

6.#include main()

{

float i, j;

scanf("%f %f", &i, &j);

printf("%.2f %.3f", i, j); }

/Ans:- 123.34 3. 234 */

7.#include /* This is given in PCS Bombay walk-in-interview

* What is the out put of the following problem ?

*/

main()

{

char *str = "12345";

printf("%c %c %c\n", *str, *(str++), *(str++));

}

/* Ans: It is not 1 2 3

* But it is 3 2 1 Why ??

*/

8.#include /* This problem is asked in PCS Bombay Walk-in-interview

* Write a macro statement to find maximum of a,b

*/

#define max(a,b) (ab)?a:b

main()

{

int a,b;

a=3;

b=4;

printf("%d",max(a,b)); }

/* Ans is very simple the coding is just for testing it

and output is 4 */

~

9.#include /* This problem is asked in PCS Bombay

* What is the output of the following coding

*/

main()

{

int len=4;

char *st="12345678";

st = st -len;

printf("%c\n",*st); }

/* Ans : It will print some junk value */

~

10.#include main()

{

func(1); }

func(int i){

static char *str ={ "One","Two","Three","Four"};

printf("%s\n",str[i++]);

return;

}

/* Ans:- it will give warning because str is pointer to the char but

it is initialized with more values

if it is not considered then the answer is Two */

11.

#include main()

{

int i;

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

printf("%d %0x\n",i,i); }

/* Ans:- i is from 1 to 99 for the first format,

for the second format 1to9, ato f, 10 to 19,1ato1f, 20 to 29, etc */

12.#include /* This problem is asked in PCS Bombay walk-in-interview

* In the following code please write the syntax for

* assing a value of 10 to field x of s and id_no 101 of s

*/

struct {

int x;

int y;

union {

int id_no;

char *name; }b;

main()

{

st = &s;

st-x=10;

st-b.id_no = 101;

printf("%d %d\n",s..x,s.b.id_no); }

/* Ans: The answer is st-x=10;

* st-b.id_no=101;

*/

13.#include /* This problem was asked in PCS Bombay in a walk-in-interview

* Write a recursive function that calculates

* n * (n-1) * (n-2) * ....... 2 * 1

*/

main() {

int factorial(int n);

int i,ans;

printf("\n Enter a Number:");

scanf("%d",&i);

ans = factorial(i);

printf("\nFactorial by recursion = %d\n", ans);

int factorial(int n)

{

if (n <= 1) return (1);

else

return ( n * factorial(n-1)); }

~

14.#include /* This problem is asked in PCS Bombay walk-in-interview

* What is the output of the following problem

*/

main(){

int j,ans;

j = 4;

ans = count(4);

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

}s,*st;

}int count(int i)

{

if ( i < 0) return(i);

else

return( count(i-2) + count(i-1)); }

/* It is showing -18 as an answer */

15.#includemain()

{

int i=4;

if(i=0)

printf("statement 1");

else

printf("statement 2");

/* statement 2 */

This is pcsb paper.

1. #include * What is wrong in the following problem

main() {

int i,j;

j = 10;

i = j++ - j++;

printf("%d %d", i,j); }

ans: 0, 12

2.#include * What is the output of the following problem

main() {

int j;

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

foo();

}

foo() {

static int i = 10;

i+=10;

printf("%d\n",i); }

/* Out put is (***since static int is used i value is retained between

* 20 function calls )

* 30

* 40

*

/

3.#include #include #include /* This is asked in PCS Bombay walk-in-interview

* What is wrong in the following code

*/

main()

{

char *c;

}

c = "Hello";

printf("%s\n", c); }

/*ans:- Hello, The code is successfully running */

4. #include /* This problem is given in PCS BOMBAY walk-in-interview.

* What is the final value of i and how many times loop is

* Executed ?

*/

main()

{

int i,j,k,l,lc=0;

/* the input is given as 1234 567 */

printf("Enter the number string:<1234 567 \n");

scanf("%2d%d%1d",&i,&j,&k);

for(;k;k--,i++)

for(l=0;lprintf("%d %d\n",i,l);}

printf("LOOPS= %d\n", lc-1);

/* Ans: i = 16, and loop is executed for 169 times */

5.#include /* This is given in PCS Bombay walk-in-interview */

/* What is the output of the following program */

main() {

union {

int a;

int b;

int c;

} u,v;

u.a = 10;

u.b = 20;

printf("%d %d \n",u.a,u.b); }

/* Ans : The latest value assigned to any of the union member

will be present in the union members so answer is

20 20

*/

6.#include main()

{

float i, j;

scanf("%f %f", &i, &j);

printf("%.2f %.3f", i, j); }

/Ans:- 123.34 3. 234 */

7.#include /* This is given in PCS Bombay walk-in-interview

* What is the out put of the following problem ?

*/

main()

{

char *str = "12345";

printf("%c %c %c\n", *str, *(str++), *(str++));

}

}

/* Ans: It is not 1 2 3

* But it is 3 2 1 Why ??

*/

8.#include /* This problem is asked in PCS Bombay Walk-in-interview

* Write a macro statement to find maximum of a,b

*/

#define max(a,b) (ab)?a:b

main()

{

int a,b;

a=3;

b=4;

printf("%d",max(a,b)); }

/* Ans is very simple the coding is just for testing it

and output is 4 */

~

9.#include /* This problem is asked in PCS Bombay

* What is the output of the following coding

*/

main()

{

int len=4;

char *st="12345678";

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

st = st -len;

printf("%c\n",*st); }

/* Ans : It will print some junk value */

~

10.#include main()

{

func(1); }

func(int i){

static char *str ={ "One","Two","Three","Four"};

printf("%s\n",str[i++]);

return;

}

/* Ans:- it will give warning because str is pointer to the char but

it is initialized with more values

if it is not considered then the answer is Two */

11.

#include main()

{

int i;

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

printf("%d %0x\n",i,i); }

/* Ans:- i is from 1 to 99 for the first format,

for the second format 1to9, ato f, 10 to 19,1ato1f, 20 to 29, etc */

12.#include /* This problem is asked in PCS Bombay walk-in-interview

* In the following code please write the syntax for

* assing a value of 10 to field x of s and id_no 101 of s

*/

struct {

int x;

int y;

union {

int id_no;

char *name; }b;

main()

{

st = &s;

st-x=10;

st-b.id_no = 101;

printf("%d %d\n",s.x,s.b.id_no);

/* Ans: The answer is st-x=10;

* st-b.id_no=101;

*/

13.#include /* This problem was asked in PCS Bombay in a walk-in-interview

* Write a recursive function that calculates

* n * (n-1) * (n-2) * ....... 2 * 1

*/

main() {

int factorial(int n);

int i,ans;

printf("\n Enter a Number:");

scanf("%d",&i);

ans = factorial(i);

printf("\nFactorial by recursion = %d\n", ans);

int factorial(int n)

{

if (n <= 1) return (1);

else

return ( n * factorial(n-1)); }

~

14.#include /* This problem is asked in PCS Bombay walk-in-interview

* What is the output of the following problem

*/

main(){

int j,ans;

j = 4;

ans = count(4);

}s,*st;

}

}

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

int count(int i)

{

if ( i < 0) return(i);

else

return( count(i-2) + count(i-1)); }

/* It is showing -18 as an answer */

15.#includemain()

{

int i=4;

if(i=0)

printf("statement 1");

else

printf("statement 2");

/* statement 2 */

Read more: http://www.ittestpapers.com/articles/techmahindra(mbt)---paper----technical---c--c----2.html#ixzz17yO6i2Hs

}

}

No comments:

Post a Comment