Sie sind auf Seite 1von 24

Aptitude Questions for Coding (Shells 2k18)

Technical Aptitude

1.Output of the following program is

main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}

a) 0,5,9,13,17
b) 5,9,13,17
c) 12,17,22
d) 16,21
e) Syntax error

Ans. d

2. Which three are methods of the Object class in Java?

1. notify();
2. notifyAll();
3. isInterrupted();
4. synchronized();
5. interrupt();
6. wait(long msecs);
7. sleep(long msecs);
8. yield();

A. 1, 2, 4
B. 2, 4, 5
C. 1, 2, 6
D. 2, 3, 4
Answer: Option C
3. What allows the programmer to destroy an object x in Java?

A. x.delete()
B. x.finalize()
C. Runtime.getRuntime().gc()
D. Only the garbage collection system can destroy an object.

Answer: Option D

4. Which one of these lists contains only Java programming language keywords?

A. class, if, void, long, Int, continue


B. goto, instanceof, native, finally, default, throws
C. try, virtual, throw, final, volatile, transient
D. strictfp, constant, super, implements, do
E. byte, break, assert, switch, include

Answer: Option B

5. Which class does not override the equals() and hashCode() methods, inheriting them
directly from class Object?

A. java.lang.String
B. java.lang.Double
C. java.lang.StringBuffer
D. java.lang.Character

Answer: Option C

6. What will be the output of the following statements?

int a[2][2] = { 3,2,5,4 };


printf("%d",*(*(*(a))));
a) error
b) 3
c) garbage value
d) 2

Answer Option A
7. What will be the output of the following program

#include<stdio.h>
void main()
{
int a=320;
char *ptr;
ptr=(char *)&a;
printf("%d",*ptr);
getch();}

a) 2
b) 320
c) 64
d) compilation error
e) none of the above

Answer: option C

8. What is the use of dynamic_cast operator in c++?

A. it converts virtual base class to derived class


B. it converts virtual base object to derived objects
C. it will convert the operator based on precedence
D. None of the mentioned

Answer: Option A

9. What is the output of this program?

#include < iostream >


using namespace std;
#define MAX 10
int main()
{
int num;
num = ++MAX;
cout << num;
return 0;
}

A. 11
B. 10
C. compile time error
D. none of the mentioned Answer : Option C
10. How many types of templates are there in c++?
A. 1
B. 2
C. 3
D. 4

Answer: option B

11. What is the output

printf (“%d”, printf (“tim”));

(A) results in a syntax error


(B) outputs tim3
(C) outputs garbage
(D) outputs tim and terminates abruptly

Ans: B

12. What is the output of the following program segment?

main()
{
int i = ++2;
printf(“%d\n”, i);
}

(A) 3
(B) 2
(C) 0
(D) -1
Ans:A

13. Which of the following numerical value is invalid constant

(A) .75
(B) 9.3e2
(C) 27,512
(D) 123456

Answer C
14. What is the output of this C code (run without any command line arguments)?

#include <stdio.h>
int main(int argc, char *argv[])
{
printf("%s\n", argv[argc]);
return 0;
}
a) Segmentation fault/code crash
b) Executable file name
c) Depends on the platform
d) Depends on the compiler

Answer: a

15. What is the output of this C code?

#include <stdio.h>
#include "printf"
void main()
{
printf("hello");
}
a) hello
b) Error
c) Depends on compiler
d) Varies

Answer: a

16. While using threads which of the following is incorrect?

a. You invoke the Run method


b. You implement Runnable interface
c. You extend from thread class
d. you call the start method

Answer: a

17. What is (void*)0?

A. Representation of NULL pointer


B. Representation of void pointer
C. Error
D. None of above

Ans: A
18. In which header file is the NULL macro defined?

A. stdio.h
B. stddef.h
C. stdio.h and stddef.h
D. math.h

Answer: Option C

19. What would be the equivalent pointer expression for referring the array element
a[i][j][k][l]

A. ((((a+i)+j)+k)+l)
B. *(*(*(*(a+i)+j)+k)+l)
C. (((a+i)+j)+k+l)
D. ((a+i)+j+k+l)

Answer: Option B

20. Which bitwise operator is suitable for checking whether a particular bit is on or off?

A. && operator
B. & operator
C. || operator
D. ! operator

Answer: Option B

21. Which is the correct declaration for the following statement?


"A pointer to an array of three chars".

A. char *ptr[3]( );

B. char (*ptr)*[3];

C. char (*ptr[3])( );

D. char (*ptr)[3];

Answer: Option D
22. Which of the following is the correct order of evaluation for the below expression?
z=x+y*z/4%2-1
A. * / % + - =

B. = * / % + -

C. / * % - + =

D. * % / - + =
Answer: Option A

23. What will be the output of the program?


#include<stdio.h>
int main()
{
int i=0;
for(; i<=5; i++);
printf("%d", i);
return 0;
}

A. 0, 1, 2, 3, 4, 5

B. 5

C. 1, 2, 3, 4

D. 6
Answer: Option D

24. What will be the output of the program?


#include<stdio.h>
int main()
{
char str[]="C-program";
int a = 5;
printf(a >10?"Ps\n":"%s\n", str);
return 0;
}

A. C-program

B. Ps

C. Error

D. None of above

Answer: Option A
25. What will be the output of the program?
#include<stdio.h>
int main()
{
unsigned int i = 65536; /* Assume 2 byte integer*/
while(i != 0)
printf("%d",++i);
printf("\n");
return 0;
}

A. Infinite loop

B. 0 1 2 ... 65535

C. 0 1 2 ... 32767 - 32766 -32765 -1 0

D. No output

Answer: Option D

26. What will be the output of the program?


#include<stdio.h>
int main()
{
static char *s[] = {"black", "white", "pink", "violet"};
char **ptr[] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
++p;
printf("%s", **p+1);
return 0;
}

A. Ink

B. Ack

C. Ite

D. Let
Answer: Option A
27. What will be the output of the program?
#include<stdio.h>

int main()
{
int i=3, *j, k;
j = &i;
printf("%d\n", i**j*i+*j);
return 0;
}

A. 30

B. 27

C. 9

D. 3

Answer: A

Reasoning Aptitude

1. A software engineer has the capability of thinking 100 lines of code in five minutes
and can type 100 lines of code in 10 minutes. He takes a break for five minutes after
every ten minutes. How many lines of codes will he complete typing after an hour?

a)250

b)220

c)150

d)200

Ans: Option A

2. A monkey starts climbing up a tree 20ft. tall. Each hour, it hops 3ft. and slips back
2ft. How much time would it take the monkey to reach the top?

a) 21 hours
b) 12 hours
c) 18 hours
d) 15 hours Ans: Option C
3. There are five friends Sachin, Kunal, Mohit, Anuj and Rohan. Sachin ia shorter than
Kunal but taller than Rohan. Mohit is tallest. Anuj is a little shorter than Kunal and
little taller than Sachin.

If they stand in the order of their heights, who will be in the middle?

a)Kunal

b)Rohan

c) Sachin

d)Anuj

Answer: Option D

4. Introducing a man to her husband, a woman said, “His brother’s father is the only
son of my grandfather.” How is the woman related to this man?

a. Mother

b. Aunt

c. Sister

d. Daughter

Answer: option C

5. A, B, C, D, E, F and G are the seven members of a family. There are two married
couple and two children in the 3rd generation.
G is B’s mother.
D is E’s mother.
F is C’s son
B is E’s Aunt.

If C is B’s husband, how is F related to E?

a. Brother

b. Sister

c. Cousin
d. Cannot be determined

Answer : Option C

6. Find the wrong term in the letter-number series given below:


G4T, J10R, M20P, P43N, S90L

a. G4T
b. J10R
c. M20P
d. P43N
e. S90L

Answer : Option B

7. QPO, SRQ, UTS, WVU?


a. XVZ
b. ZYA
c. YXW
d. VWX

Answer : option C

8. Find an equivalent relationship

Aerie : Eagle

a) capital : government
b) bridge : architect
c) unit : apartment
d) house : person

Answer : Option D
9. Choose the word out of the given four alternatives which will fill in the blank space
and show the same relationship with the third word as between the first two.
Embarrassed is to humiliated as frightened is to…..
a) terrified
b) agitated
c) courageous
d) reckless

Answer : Option A

10. In a certain code language, if the word ‘DISTANCE’ is coded as EDCINSAT, then
how will you code
‘ACQUIRE’ in that language?

a. EACIQUR

b. EACRIUQ

c. ERCIAQU

d. EARCIQU

Answer : Option D

11. Which word does NOT belong with the others?


B. Sourdough

C. Pumpernickel

D. Loaf
Answer: Option A

12. Eileen is planning a special birthday dinner for her husband's 35th birthday. She
wants the evening to be memorable, but her husband is a simple man who would rather
be in jeans at a baseball game than in a suit at a fancy restaurant. Which restaurant
below should Eileen choose?
Alfredo's offers fine Italian cuisine and an elegant Tuscan decor. Patrons will feel as
A.
though they've spent the evening in a luxurious Italian villa.

Pancho's Mexican Buffet is an all-you-can-eat family style smorgasbord with the best
B.
tacos in town.

The Parisian Bistro is a four-star French restaurant where guests are treated like
C.
royalty. Chef Dilbert Olay is famous for his beef bourguignon.

Marty's serves delicious, hearty meals in a charming setting reminiscent of a baseball


D.
clubhouse in honor of the owner, Marty Lester, a former major league baseball star.
Answer: Option D

13. The film director wants an actress for the lead role of Lucy who perfectly fits the
description that appears in the original screenplay. He is not willing to consider
actresses who do not resemble the character as she is described in the screenplay, no
matter how talented they are. The screenplay describes Lucy as an average-sized, forty
something redhead, with deep brown eyes, very fair skin, and a brilliant smile. The
casting agent has four actresses in mind.

Actress #1 is a stunning red-haired beauty who is 5'9" and in her mid-twenties. Her eyes are
brown and she has an olive complexion.

Actress #2 has red hair, big brown eyes, and a fair complexion. She is in her mid-forties and
is 5'5".

Actress #3 is 5'4" and of medium build. She has red hair, brown eyes, and is in her early
forties.

Actress #4 is a blue-eyed redhead in her early thirties. She's of very slight build and stands at
5'.
A. 1, 2

B. 2, 3

C. 1, 4

2, 4
D.

Answer: Option B

14. One New York publisher has estimated that 50,000 to 60,000 people in the United
States want an anthology that includes the complete works of William Shakespeare.
And what accounts for this renewed interest in Shakespeare? As scholars point out, his
psychological insights into both male and female characters are amazing even today.
This paragraph best supports the statement that
A. Shakespeare's characters are more interesting than fictional characters today.

B. people even today are interested in Shakespeare's work because of the characters.

C. academic scholars are putting together an anthology of Shakespeare's work.

D. New Yorkers have a renewed interested in the work of Shakespeare.

E. Shakespeare was a psychiatrist as well as a playwright.

Answer: Option B
15. In how many different ways can the letters of the word 'LEADING' be arranged in
such a way that the vowels always come together?
A. 360

B. 480

C. 720

D. 5040
Answer: Option C

Quantitative Aptitude
1. 5b2 is a three-digit number with b as a missing digit. If the number is divisible by 6,
the missing digit is:
a. 2 b. 3 c. 6 d. 7

Answer : option A

2. (51+52+53+………+100) is equal to:


a. 2525 b. 2975 c. 3225 d. 3775

Answer: Option D

3.What is the probability of getting at least one six in a single throw of three unbiased
dice?

a. 1/6 b. 125/216 c. 1/36 d. 81/216 e. 91/216

Answer Option D

4. A person tosses an unbiased coin. When head turns up, he gets Rs.8 and tail turns up
he loses Rs.4. If 3 coins are tossed, what is probability that the gets a profit of Rs.12?
a. 3/8 b. 5/8 c. 3/4 d. 1/8

Answer Option A

5. A box contains 3 blue marbles ,4 red,6 green and 2 yellow marbles .if three marbles
are picked at random ,what is the probability that they are all blue?
A.2/455
B.4/455
C.1/91
D.1/455

Answer: D

6..A can finish a work in 18 days and B can do same work in half the time taken by the
A. Then working together ,what part of same work they can finish in a day
A.⅙
B.⅕
C.1/7
D.⅛
Answer A

7. A batsman makes a score of 87 runs in the 17th inning and thus


increases his averages by 3. What is his average after 17th inning?
A. 39
B. 35
C. 42
D. 40.5

answer: A
8. If a * b = 2a – 3b + ab, then 5 * 7 + 7 * 5 is equal to:

a. 33

b. 36

c. 34

d. 38

Answer : Option C

9.. There are 28 stations between Ernakulam and Chennai. How many second class
tickets have to be printed, so that a passenger can travel from one station to any other
station?
a. 800
b. 820
c. 850
d. 870
Answer: Option D
10. In how many ways can a team 16 be chosen out of a batch of 20 players?
a. 4845
b. 6852
c. 3125
d. 5846

Answer : Option A

11. A, B, C rent a pasture. A puts 10 oxen for 7 months, B puts 12 oxen for 5 months and
C puts 15 oxen for 3 months for grazing. If the rent of the pasture is Rs. 175, how much
must C pay as his share of rent?

A. Rs. 45

B. Rs. 50

C. Rs. 55

D. Rs. 60
Answer: Option A

12. A and B invest in a business in the ratio 3 : 2. If 5% of the total profit goes to charity
and A's share is Rs. 855, the total profit is:
A. Rs. 1425

B. Rs. 1500

C. Rs. 1537.50

D. Rs. 1576
Answer: Option B

13. Which of the following statements is not correct?


A. log10 10 = 1

B. log (2 + 3) = log (2 x 3)

C. log10 1 = 0

D. log (1 + 2 + 3) = log 1 + log 2 + log 3


Answer: Option B
14. A boat can travel with a speed of 13 km/hr in still water. If the speed of the stream is
4 km/hr, find the time taken by the boat to go 68 km downstream.
A. 2 hours

B. 3 hours

C. 4 hours

D. 5 hours
Answer: Option C

a x-1 b x-3
15. If = , then the value of x is:
b a

1
A. 2

B. 1

C. 2

7
D. 2

Answer: Option C

16. If 3(x - y) = 27 and 3(x + y) = 243, then x is equal to:


A. 0

B. 2

C. 4

D. 6

Answer: Option C
17. If 5a = 3125, then the value of 5(a - 3) is:
A. 25

B. 125

C. 625

D. 1625
Answer: Option A

18. An aeroplane covers a certain distance at a speed of 240 kmph in 5 hours. To cover
the same distance in 1 hours, it must travel at a speed of:
A. 300 kmph

B. 360 kmph

C. 600 kmph

D. 720 kmph
Answer: Option D

19. In covering a distance of 30 km, Abhay takes 2 hours more than Sameer. If Abhay
doubles his speed, then he would take 1 hour less than Sameer. Abhay's speed is:
A. 5 kmph

B. 6 kmph

C. 6.25 kmph

D. 7.5 kmph
Answer: Option A

20. A batsman makes a score of 87 runs in the 17th inning and thus increases his
averages by 3. What is his average after 17th inning?

A. 39
B. 35
C. 42
D. 40.5

answer:A
21.The sum of ages of 5 children born at the interval of 3 years.each is 50 years what is
the age of the youngest child
A.4
B.8
C.10
D.none

Answer:A

22.In a 100 meters race A runs at a speed of 2 meters per seconds. If A gives B a start of
4 meters and still beats him by 10 seconds, find the speed of b
A.3.2
B.2.3
C.6.1
D.1.6
Answer : D

23. In a certain school, 20% of students are below 8 years of age. The number of
students above 8 years of age is of the number of students of 8 years of age which is

48. What is the total number of students in the school?

A. 72
B. 80
C. 100
D. 150

Ans : C

3 5
24. A student multiplied a number by instead of .
5 3
What is the percentage error in the calculation?

A. 34%
B. 44%
C. 54%
D. 64%
Ans: D
25. The angle between the minute hand and the hour hand of a clock when the time is
8.30, is:
A. 80º
B. 75º
C. 60º
D. 105º

Ans: B

31. A is 30% more efficient than B. How much time will they, working together, take to
complete a job which A alone could have done in 23 days?

A. 11 days

B. 13 days

3
20 days
C. 17

D. None of these

Ans:B

27 .A runs twice as fast as B and B runs thrice a fast as C.The distance covered by C in
72 minutes,will be covered by A in

1.16 minutes
2.12 minutes
3.24 minutes
4.18 minutes

Answer :12 minutes

28 .A box contains 3 blue marbles ,4 red,6 green and 2 yellow marbles .if three marbles
are picked at random ,what is the probability that they are all blue?

1.2/455
2.4/455
3.1/91
4.1/455

Answer: 4
29 .A number when divided by 296 leaves 75 as reminder. When the same number is
divided by 37 the reminder will be?

1. 1
2. 3
3. 5
4. 4

Answer:1

30. On 8th Feb, 2005 it was Tuesday. What was the day of the week on 8th Feb, 2004?

A. Tuesday
B. Monday
C. Sunday
D. Wednesday

Ans: C

Verbal Aptitude
1. Find antonyms?
EXODUS

A. Influx
B. Homecoming
C. Return
D. Restoration

answer: A

2.Choose the appropriate options to complete the sentence in passive or active form:
Millions of tons of coal ---- every day to produce energy.

A. will burn
B. burnt
C. are burning
D. are burn

Answer A.
3..Choose the appropriate word or word phrase to complete the sentence: The cupboard
was ---- big ---- fit through the door, so we had to take it apart first.
A. enough / to
B. too / to
C. so / that
D. more / than

Answer Option B

4. Choose the appropriate options to complete the sentence in passive or active form:
Millions of tons of coal ---- every day to produce energy.
1. will burn
2. burnt
3. are burning
4. are burn

Answer 4.

5.The strange man walked down the road.(pick up the adjective from the given
sentence)
1. None of these
2. Strange
3. Man
4. Walked

Answer:2

6. Antonym of COMMISSIONED
A. Started
B. Closed
C. Finished
D. Terminated

Answer: Option D
7.Antonym of RELINQUISH

A. Abdicate
B. Renounce
C. Possess
D. Deny

Answer: Option C
8. The small child does whatever his father was done.
A. has done
B. did
C. does
D. had done
E. No correction required

Answer: Option C
9. Synonym of CORPULENT
A. Lean
B. Gaunt
C. Emaciated
D. Obese

Answer: Option D

10. The miser gazed ...... at the pile of gold coins in front of him.
A. avidly
B. admiringly
C. thoughtfully
D. earnestly

Answer: Option A
GK

1. Development expenditure of the Central government does not include

A. defence expenditure
B. expenditure on economic services
C. expenditure on social and community services
D. grant to states

Answer: A

2. What invention was first installed at a Hartford, Connecticut bank in 1889?

A. Automatic teller machine


B. Time-lock safe
C. Burglar alarm
D. Pay telephone

Answer: D

3. The Paithan (Jayakwadi) Hydro-electric project, completed with the help of Japan, is
on the river

A. Ganga
B. Cauvery
C. Narmada
D. Godavari
Answer: D

4. The southernmost point of peninsular India, that is, Kanyakumari, is

A. north of Tropic of Cancer


B. south of the Equator
C. south of the Capricorn
D. north of the Equator

Answer: D

5. The Olympic Flame, was, for the first time, ceremonially lighted and burnt in a giant
torch at the entrance of the stadium at

A. Athens Games (1896)


B. London Games (1908)
C. Paris Games (1924)
D. Amsterdam Games (1928)

Answer: D

Das könnte Ihnen auch gefallen