You are on page 1of 63

Q1.

A student got twice as A student got twice as many sums wrong as he


got right. If he attempted 48 sums in all, how many did he solve correctly?
many sums wrong as he got right. If he attempted 48 sums in all, how many
did he solve correctly?

A.12
B.16
C.18
D.24

ANS:B

Explanation:

Suppose the boy got x sums right and 2x sums wrong. Then, x + 2x = 48 3x =
48 x = 16.

Q2. A man fixed an appointment to meet the manager, Manager asked him
to come two days after the day before the day after tomorrow. Today is
Friday. When will the manager expect him?

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

ANS:B

Explanation:

Do not confuse it with Tuesday.the correct answer is Monday

Q3. There is a merry-go-round race going on.One person says,"1/3 of those


in front of me and 3/4 of those behind me, give the total number of children
in the race". Then the number of children took part in the race?

A.12
B.11
C.13
D.14

ANS:C

Explanation:

Assume there are x participants in the race. In a round race, number of


participants in front of a person wil be x-1 and that behind him wil be x-1. i.e,
1/3(x-1) + 3/4(x-1) = x solving x = 13

Q4. Find the value of X,Y and Z in the following

XXXX
YYYY
ZZZZ
................
YXXXZ

A.X=9 , Y=2; Z=8


B.X=9 , Y=1; Z=9
C.X=8 , Y=1; Z=8
D.X=9 , Y=1; Z=8

ANS:D

Q5. The smallest number which when diminished by 7, is divisible 12, 16,
18, 21 and 28 is:

A.1008
B.1015
C.1022
D.1032

ANS:B

Explanation:

Required number = (L.C.M. of 12,16, 18, 21, 28) + 7 = 1008 + 7 = 1015


Q6. The ratio of two numbers is 3 : 4 and their H.C.F. is 4. Their L.C.M. is

A.12
B.16
C.24
D.48

ANS:D

Explanation:

Let the numbers be 3x and 4x. Then, their H.C.F. = x. So, x = 4. So, the
numbers 12 and 16. L.C.M. of 12 and 16 = 48.

Q7. 252 can be expressed as a product of primes as:

A.2 x 2 x 3 x 3 x 7
B.2 x 2 x 2 x 3 x 7
C.3 x 3 x 3 x 3 x 7
D.2 x 3 x 3 x 3 x 7

ANS:A

Explanation:

Clearly, 252 = 2 x 2 x 3 x 3 x 7.

Q8. 21, 9, 21, 11, 21, 13, 21, .......

A.14
B.15
C.21
D.23

ANS:B

Explanation:

In this alternating repetition series, the random number 21 is interpolated every


other number into an otherwise simple addition series that increases by 2,
beginning with the number 9.

Q9. Two trains, one from Howrah to Patna and the other from Patna to
Howrah, start simultaneously. After they meet, the trains reach their
destinations after 9 hours and 16 hours respectively. The ratio of their
speeds is

A.2 : 3
B.4 : 3
C.6 : 7
D.9 : 16

ANS:B

Explanation:

Let us name the trains as A and B. Then, (As speed) : (Bs speed) = b : a = 16 :
9 = 4 : 3.

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

A.b < a
B.b > a
C.b = a
D.b >= a

ANS:A

Q11. If 5 women or 8 girls can do a work in 84 days. In how many days can
10 women and 5 girls can do the same work ?

A.31 days
B.30 days
C.33 days
D.32 days

ANS:D
Explanation:

Given that 5 women is equal to 8 girls to complete a work so, 10 women=16


girls. Therefore 10women +5girls=16girls+5girls=21girls. 8 girls can do a
work in 84 days then 21 girls= (8*84/21)=32days. Therefore 10 women and 5
girls can a work in 32days

Q12. SECTION-1 If 9 men working 6 hours a day can do a work in 88


days. Then 6 men working 8 hours a day can do it in how many days?

A.89
B.99
C.86
D.76

ANS:B

Explanation:

If men is fixed,work is proportional to time. If work is fixed, then time is


inversely proportional to men therefore, (M1*T1/W1)=(M2*T2/W2) From the
above formula i.e (m1*t1/w1)=(m2*t2/w2) so (9*6*88/1)=(6*8*d/1) on
solving, d=99 days.

Q13. Walking at 3/4 of his usual speed ,a man is late by 2 1/2 hr. the usual
time is

A.7
B.7 1/2
C.8 1/2
D.8

ANS:B

Explanation:

Usual speed = S Usual time = T Distance = D New Speed is 3/4 S New time is
4/3 T 4/3 T, T = 5/2 T=15/2 = 7 1/2
Q14. In a boat 25 persons were sitting. Their average weight increased one
kilogram when One man goes and a new man comes in. The weight of the
new man is 70kgs. Find the Weight of the man who is going ?

A.45
B.25
C.36
D.73

ANS:A

Explanation:

Weight increased per person is 1 kg. Total increase in weight = 25 kgs Weight
of new man is 70 kgs, (Which means his weight is 25 kgs heavier) The weight of
the old man was 70 - 25 = 45 kgs

Q15. A man can row 4.5 km/hr in still water. It takes him twice as long to
row upstream as to row downstream. What is the rate of the current ?

A.3.5 km/hr
B.2.5 km/hr.
C.4.5 km/hr.
D.1.5 km/hr

ANS:D

Explanation:

Speed of boat in still water (b) = 4.5 km/hr. Speed of boat with stream (Down
Stream), D = b + u Speed of boat against stream (Up stream), U = b u It is
given upstream time is twice to that of down stream. Downstream speed is
twice to that of upstream. So b + u = 2(b u) u =b/3 = 1.5 km/hr.

Q16. A sum of money amounts to Rs. 9800 after 5 years and Rs. 12005 after
8 years at the same rate of simple interest. The rate of interest per annum
is
A.5%
B.8%
C.12%
D.18%

ANS:C

Explanation:

S.I. for 3 years = Rs. (12005 - 9800) = Rs. 2205. S.I. for 5 years = Rs. (2205/3)
x 5 = Rs. 3675 Principal = Rs. (9800 - 3675) = Rs. 6125. Hence, rate = (100 x
3675)/( 6125 x 5) % = 12%

Q17. A man starts walking at 3 pm . he walks at a speed of 4 km/hr on level


ground and at a speed of 3 km/hr on uphill , 6 km/hr downhill and then 4
km/hr on level ground to reach home at 9 pm. What is the distance covered
on one way?

A.12 km
B.23 km
C.45 km
D.65 km

ANS:A

Explanation:

lets us consider t1 = time taken on level road. t2 = uphill. t3 = down hill; the
distance traveled uphill and down hill same so t2*3 = 6*t3; => t2 = 2t3;--->
(1) total time = 2*t1 + t2 + t3 = 6 hours ---> (2) 2t1+3t3 = 6 -->(3) total
distance = 2*(4t1) + 3*t2+ 6*t3 ---> (4) substitute (1) in (4) 8t1 + 12t3 =>
4(2t1+3t3) then from (3) the total distance will become 4*6= 24 => one way
distance = 12km

Q18. In a group of cows and hens, the number of legs are 14 more than
twice the number of heads. The number of cows is

A.5
B.7
C.10
D.12

ANS:B

Explanation:

Let the number of cows be x and the number of hens be y. Then, 4x + 2y = 2 (x


+ y) + 14 4x + 2y = 2x + 2y + 14 2x = 14 x = 7.

Q19. I have a few sweets to be distributed. If I keep 2, 3 or 4 in a pack, I am


left with one sweet. If I keep 5 in a pack, I am left with none. What is the
minimum number of sweets I have to pack and distribute ?

A.25
B.37
C.54
D.65

ANS:A

Explanation:

Clearly, the required number would be such that it leaves a remainder of 1


when divided by 2, 3 or 4 and no remainder when divided by 5.

Q20. 2 trains starting at the same time from 2 stations 200 km apart and
going in opposite direction cross each other at a distance of 110 km from
one of the stations.what is the ratio of their speeds ?

A.11:9
B.11:8
C.10:9
D.10:90

ANS:A

Explanation:
In same time ,they cover 110 km & 90 km respectively so ratio of their speed
=110:90 = 11:9

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

A.-5
B.4
C.2
D.8

ANS:D

Explanation:

Consider 9x - 3y = 12.........divide both sides by 3: 3x - y = 4............now


multiply both sides by 2: 6x - 2y = 8 So, it`s (d)

Q22. Two bus tickets from city A to B and three tickets from city A to C
cost Rs. 77 but three tickets from city A to B and two tickets from city A to
C cost Rs. 73. What are the fares for cities B and C from A ?

A.Rs. 4, Rs. 23
B.Rs. 13, Rs. 17
C.Rs. 15, Rs. 14
D.Rs. 17, Rs. 13

ANS:B

Explanation:

Let Rs. x be the fare of city B from city A and Rs. y be the fare of city C from city
A. Then, 2x + 3y = 77 ...(i) and 3x + 2y = 73 ...(ii) Multiplying (i) by 3 and (ii)
by 2 and subtracting, we get: 5y = 85 or y = 17. Putting y = 17 in (i), we get: x
= 13.

Q23. The total of the ages of Amar, Akbar and Anthony is 80 years. What
was the total of their ages three years ago ?
A.71 years
B.72 years
C.74 years
D.77 years

ANS:A

Explanation:

Required sum = (80 - 3 x 3) years = (80 - 9) years = 71 years.

Q24. A man took loan from a bank at the rate of 12% p.a. simple interest.
After 3 years he had to pay Rs. 5400 interest only for the period. The
principal amount borrowed by him was.

A.Rs. 2000
B.Rs. 10,000
C.Rs. 15,000
D.Rs. 20,000

ANS:C

Explanation:

Principal = Rs. (100 x 5400)/(12*3) = Rs. 15000.

Q25. The total age of A & B is 12 years more than the total age of B & C. C
is how many year younger than A.

A.C is 12 years younger than A


B.C is 11 years younger than A
C.C is 18 years younger than A
D.C is 22 years younger than A

ANS:A

Explanation:

From the given data A+B = 12+(B+C) A+B-(B+C) = 12 A-C=12 years. C is


12 years younger than A

Q26. The present age of a father is 3 years more than three times the age of
his son.Three years hence,father as age will be 10 years more than twice the
age of the son.Find the present age of the father.

A.23 years
B.30 years
C.33 years
D.42 years

ANS:C

Explanation:

Let the present age be x years. Then fathers present age is 3x+3 years. Three
years hence (3x+3)+3=2(x+3)+10 x=10 Hence fathers present age = 3x+3
=[ (3 x 10) + 3] = 33 years.

Q27. In one hour a boat goes 11 km long the stream and 5 km against the
stream.The speed of the boat in still water is?

A.8 kmph
B.7 kmph
C.8.5 kmph
D.9 kmph

ANS:A

Explanation:

Speed in still water A = ( 11+5) km/hr A= 8 kmph

Q28. A train 110 m long travels at 60 kmph. How long does it take to pass a
telegraph post by the side of the track ?

A.5.6 seconds
B.6.5 seconds
C.6.6 seconds
D.6.7 seconds

ANS:C

Explanation:

Speed of train = 60 - 5/18 m/s = 50/3 m/s, Time taken to cross the telegraph
post = 110/(50/3) = 6.6 seconds

Q29. The average ages of three persons is 27 years. Their ages are in the
proportion of 1:3:5. What is the age in years of the youngest one among
them ?

A.8
B.6
C.7
D.9

ANS:D

Explanation:

Let the age of three persons be x, 3x and 5x => 9x/3 = 27 = > x = 9

Q30. The greatest number of four digits which is divisible by 15, 25, 40 and
75 is:

A.9000
B.9400
C.9600
D.9800

ANS:C

Explanation:

Greatest number of 4-digits is 9999. L.C.M. of 15, 25, 40 and 75 is 600. On


dividing 9999 by 600, the remainder is 399. Required number (9999 - 399) =
9600.
Technical

Q1. Write a program which employs Recursion

Q2. Write a program to generate theFibonacciseries.

Q3. Which bit wise operator is suitable for checking whether a particular
bit is on or off?

Q4. Write a C program which when compiled and run, prints out a
message indicating whether the compiler that it is compiled withallows /*
*/ commentsto nest.

Q5. You are given a singly link-list such that each node of this list is also a
head of another link list of the same type:

struct node {
void *data; /* could be anything */
struct node *next;
struct node *down;

Describe an algorithm for flattening the list.

Q6. Find the output



int c[ ]={2.8,3.4,4,6.7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++) {
printf(" %d ",*c);
++q; }
printf(" %d ",*p);
++p; }

ANS:2 2 2 2 2 2 3 4 6 5

Q7. Find the output of the Program?

char s[]={a,b,c,c,};
char *p,*str,*str1;
p=&s[3];
str=p;
str1=s;
printf("%d",++*p + ++*str1-32);

Q8. Find the error in the following program?

struct xx
int x=3;
char name[]="hello";
struct xx *s;

ANS:compiler error

Q9.Find the output of the Program?

#include
struct xx
int x;
struct yy
char s;
struct xx *p;
struct yy *q;

Q10. A default catch block catches

A. all thrown objects


B. no thrown objects
C. any thrown object that has not been caught by an earlier catch block
D. all thrown objects that have been caught by an earlier catch block

ANS:C

Q11. The standard input stream, which refers to the keyboard, is called

A. cin
B. cout
C. stin
D. stout
E. None of the above

ANS:A

Q12. When a break statement is used in a loop, the control skips the rest of
the statements in the loop after it and jumps

A. to the last lines in the program


B. to the next statement written after the body of the loop
C. to the first statement in the body of the loop
D. All. of the above
E. None of the above

ANS:B

Q13. When two types are used in a function template and one is labeled T,
the other

A. must also be named T


B. must be named U
C. can be any legal C++ identifier
D. it is illegal to have two types

Q14. The continue statement is used to

A. permit two different expressions to appear in situations where only one


expression would ordinarily be used
B. terminate loops or to exit from a switch
C. alter the normal sequence of program execution by transferring control to
some other part of the program
D. All of the above
E. None of the above

ANS:E

Q15. What will be the content of file.c after executing the following
program?

int main()
FILE *fp1, *fp2;
fp1=fopen("file.c", "w");
fp2=fopen("file.c", "w");
fputc(A, fp1);
fputc(B, fp2);
return 0;

A. B
B. A, B
C. B, B
D. Error in opening file file1.c

ANS:A

Q16. What will be the output of the program ?

int main()
float a=3.15529;
printf("%2.1f ", a);
return 0;

A. 3.00
B. 3.15
C. 3.2
D. 3

Q17. Which of the following statement is correct about the program?

int main()
FILE *fp;
char str[11], ch;
int i=0;
fp = fopen("INPUT.TXT", "r");
if(ch == || ch == )
printf("%s", str);
}
else
str[i++]=ch;
}
fclose(fp);
return 0;

A. The code writes a text to a file
B. The code reads a text files and display its content in reverse order
C. The code writes a text to a file in reverse order
D. None of above

Q18. What function should be used to free the memory allocated by
calloc()?

A. dealloc();
B. malloc(variable_name, 0)
C. free();
D. memalloc(variable_name, 0)

Q19. What will be the output of the program?

int main()
char *s;
char *fun();
s = fun();
printf("%s ", s);
return 0;
char *fun()
char buffer[30];
strcpy(buffer, "RAM");
return (buffer);

A. 0xffff
B. Garbage value
C. 0xffee
D. Error

Q20. The generic type in a template function

A. must be T
B. can be T
C. cannot be T for functions you create, but may be for C++s built-in functions
D. cannot be T

Q21. Predict the error in the following program:

int main()
void v = 0;
printf("%d", v);
return 0;

A. Error: Declaration syntax error v (or) Size of v is unknown or zero.
B. Program terminates abnormally.
C. No error.
D. None of these.

Q22. Which of the following statements mentioning the name of the array
begins DOES NOT yield the base address?

1: When array name is used with the sizeof operator.


2: When array name is operand of the & operator.
3: When array name is passed to scanf() function.
4: When array name is passed to printf() function.

A. A
B. A, B
C. B
D. B, D

Q23. Which of the following statements are correct about 6 used in the
program?

int num[6];
num[6]=21;

A. In the first statement 6 specifies a particular element, whereas in the second


statement it specifies a type.
B. In the first statement 6 specifies a array size, whereas in the second statement
it specifies a particular element of array.
C. In the first statement 6 specifies a particular element, whereas in the second
statement it specifies a array size.
D. In both the statement 6 specifies array size.

Q24. Format flags may be combined using

A. the bitwise OR operator (|)


B. the logical OR operator (||)
C. the bitwise AND operator (&)
D. the logical AND operator (&&)

Q25. Programmer-defined functions can be

A. value-returning functions only


B. void functions only
C. either value-returning or void functions

AMAZON Reasoning Ability

NOTE: This section is not present in this companys placement process. If


you still want to practise, some questions are provided below.

DIRECTIONS for the question 1 to 3:

Go through all the options and mark the one which does not belong to the
group.

Q1.

A) 71-55
B) 517-523
C) 248-231
D) 547-563

ANS:C

Explanation:

248-231 = 17
563-547=16
71-55=16
523-517=06

Except in the number pair 248-231, in all others number pair, the difference
between the two numbers is an even number.

Q2.10, 13, 234, 681, 997

A) 681
B) 13
C) 234
D) 10

ANS:A

Explanation:

10 => 1+0 =1 or 1^2


13 =>1+3 = 4 or 2^2
234 =>2+3+4 = 9 or 3^2
681=> 6+8+1 = [15]
997 => 9+9+7 = 25 or 5^2

So the sum of the digits in all the numbers is a perfect square except for 681,
hence that is odd.

Q3.Choose amongst the Options below.

A) Heed
B) Led
C) Heap
D) Head
AMAZON Verbal Ability

DIRECTIONS for the question 1:

In the sentence provided a part of the sentence is underlined. Beneath the


sentence, four/five different ways of paraphrasing the underlined part are
indicated. Choose the best alternative amongst the four/five.
Q1.Living with compassion and contributing to others lives would helping
us add happiness to our lives as

1) will helping us
2) will help us
3) would helped them
4) will helped us
5) No correction required

ANS:2

Explanation:

"Will help" indicates surety whereas "would help indicates chance/may be.
Hence, the correct phrase is "will help us" as it is grammatically correct.. Also
would is past form of will and here present form is required.

Q2.The easiest way for prevent stress caused by work or home pressures is
to indulge in high levels of physical activity

1) easily way to
2) easier ways for
3) easiest way to
4) easier way from
5) No correction required

ANS:3

Explanation:

Prevent will take "to" as preposition and not "for" Therefore to preventis
correct.

DIRECTIONS for the question 3-5:

Read the sentence to find out whether there is any grammatical error or
idiomatic error in it. The error, if any, will be in one part of the sentence.
The number of that part is the answer. if there is No Error" the answer is
(E). (Ignore errors of punctuation if any.)

Q3. For all of sadness, poverty and diseases (1)/ in this world(2) / every one
of us(3) / possesses unlimited ways of making a positive difference(4) / No
Error(5)

1) 1
2) 2
3) 3
4) 4
5) 5

ANS:1

Explanation:

For all sadness, poverty and disease...the use of "of" is redundant.

Q4. Excess weight is the result of (1)/ unhealthy eating habits (2)/ which are
inherent risk factors (3)/ responsible for many diseases.(4) / No Error(5)

1) 1
2) 2
3) 3
4) 4
5) 5

ANS:5

Explanation:

The sentence is correct.

Q5. The therapeutic benefits (1)/ at helping others(2) / have long been(3) /
recognised by people.(4) / No Error(5)

1) 1
2) 2
3) 3
4) 4
5) 5

ANS:5

Explanation:

"Of" helping others, instead of preposition "at" At is a preposition of time and


place.

DIRECTION for question 6-10:

Read the given passage and answer the questions.

A new generation of scientists is not convinced that language is innate and


hard-wired into our brain and they say that small, even apparently
insignificant differences between languages do affect the way speakers
perceive the world. The brain is shaped by experience, says Dan Slobin of
the University of California at Berkeley. Some people argue that language
just changes what you attend to , says Lera Boroditsky of the
Massachusetts Institute of Technology. But what you attend to changes
what you encode and remember. In short, it changes how you think. (BEC
Higher Cambridge University Press 2008)

Q6.Choose the word which means Innate

1) Essential
2) Inbred
3) Integral
4) All of the above

ANS:2

Explanation:
Inbred means inherent

Q7.Choose the word which means hard -wired

1) Intrinsic
2) Extraneous
3) Adventitious
4) All of the above

ANS:1

Explanation:

Intrinsic means inborn or inherent

Q8. The word Perceive means


I. To regard as being such
II. To become aware through the senses
Choose the correct option:

1) I
2) II
3) I and II
4) None of the above< /li>

ANS:1

Explanation:

The word perceive means to form an opinion about something

Q9.What is the synonym for Encode

1) Code
2) Cipher
3) Encipher
4) All of the above
ANS:2

Explanation:

Cipher is a synonym for encode and like the word encode, cipher is used as a
verb

Q10.What does language change?

1) What you encode and remember


2) What you attend to
3) How you think
4) All of the above

ANS:3

Explanation:

It has been mentioned in the paragraph that language changes what we attend
to which changes how we think. The answer therefore, is option no. 3

ANS:B

Explanation:

Except in the word Led, in all other words there are two vowels.
Hence the answer is option 2.

DIRECTIONS for the question 4-8:

What should come in place of question mark (?) in the following number/
alphabetic series?

Q4. C 3, E 5, G 7, I 9, ?, ?

A) K 11, M 13
B) O 15, X 24
C) M 18, K 14
D) X 24, M 21

ANS:A

Explanation:

Q5. 5, 16, 51, 158, ?

A) 483
B) 481
C) 1454
D) 1452

ANS:B

Explanation:

5 - 3 + 1 = 16
16 - 3 + 3 = 51
51 - 3 + 5 = 158
158 - 3 + 7 = [481]

Q6. 9 - 2: 9 - 9 : : 9 - 5 : ?

A) 9 - 6
B) 9 - 7
C) 9 - 8
D) 9 - 4

ANS:A

Explanation:

9-2=18
9-9=81
The digits of resultant have interchanged positions therefore,
9-5=45
9-6=54

Q7. AFI, JOR, MRU, ?

A) HMP
B) PMO
C) RJL
D) GJN

ANS:A

Explanation:

Q8.bc, cde, de, efg, fg, ?

A) fgh
B) hij
C) ijk
D) Ghi

ANS:D

Explanation:

The answer should be the last alphabhet of fg ( i.e g ) and the next two
alphabets i.e hi . Hence answer is ghi
bc cde de efg fg ghi

Q9.A man showed a boy next to him and said He is the son of my wifes
sister-in-law, but I am the only child of my parents. How is mans son
related to him?

A) Brother
B) Uncle
C) Nephew
D) Cousin
ANS:D

Explanation:

The boy is the son of mans brother-in-law. Therefore, mans son is the cousin of
that boy.

Q10.Find the correct group of signs to solve the equation. 24 * 16 * 8 * 32

A) - + =
B) x / =
C) + - =
D) / - =

ANS:C

Explanation:

The best way to solve this question is by hit and trial . Use the answer options
and find the value.
24 * 16 * 8 * 32
24 + 16 - 8 = 32
40-8 = 32
In this case, option C is correct.
Written Test has 2 Sections A, B In Section A there were 20 Questions:

Aptitude:

Q1. Two tables emp (empid, name, deptid, sal) and dept (deptid, deptname)
are there. write a query which displays empname, corresponding deptname
also display those employee names who do not belong to any dept.

Q2. Display the employees whose salary is less than average salary.

Q3. What is the output of the program?

main()
{
int c=5;
printf("%d
%d
%d",c,c<<2,c>> 2);
}

Q4.What is the output of the program?

main()
{
int a[8][10],c=0,i,j;
for(i=0;i<10;
i++) for(j=0;
j<8;j++) a[j][i]=c++;
printf("%d",a[3][6]);
}

Q5. What is the wrong in this program?

main()
{
char *p,*q;
p=(char *)malloc(25);
q=(char*) malloc(25);
strcpy(p,"amazon" );
strcpy(q,"hyd");
strcat(p,q);
printf("%s",p);
}

Q6. Write prefix and post fix notation for

(a+b)*c-(d+e)^(f-g)

Q7. What is the output of the program?

main()
{
int i=5;
printf("%d",fun(fun(fun(fun( fun(i))))));
}
void fun(int i)
{ if(i%2) return (i+(7*4)-(5/2)+(2*2));
else return (i+(17/5)-(34/15)+(5/2));
}

Q8. When it is always true boolean fun

(node *p)
{
return ((p==null)||(p->next==null)|| (p->info<=p->next->info)&&( fun(p-
>next)));
}

a) when list is empty or has one node


b) when the ele are sorted in non decreasing order
c) when the ele are sorted in non increasing order

Q9. What is x here (x&&!(x&(x-1))==1)

a) x is always a prime
b) x is a power of 2
c) x is even d)x is odd

Q10. What is the difference between deep copy and shallow copy

Q11. In java what is the difference between sleep() and wait() .

Q12. What happens when the parent process of a child process exits before
the child?

Q13. There are three persons A,B,C .A shots the target 6 times out of 7
shots. B shots 4 out of 5 shots .Then what is the probability of hitting the
target twice when 2 persons are selected at random.

Q14. What is valid in


cpp char *cp; const char *cpp;

1) cpp=cp;
2) cp=cpp;

Q15. Write program to swap 2 variables without using extra memory.

Q16. Write a shell command to find all java files present in nested
directories.

Q17. There are 6 pairs of black socks and 6 pairs of white socks.What is the
probability to pick a pair of black or white socks when 2 socks are selected
randomly in darkness.

Q18. A string of alphanumeric is there. Find a string that starts with b and
ends with 3 characters. section B (we have to write programs) time:30 min

Q19. There is a sorted array which is of very large size.In that all except
one no. are repeated once. How to find that non repeated no.

Q20. There are 2 linked lists. Those 2 lists are meeting at a point. How to
find that meeting point.
The two codings where as below.

Q1) Finding all possible UNIQUE sub strings of and array of char. And
displaying it in sorted order.

Q2)It was on tree was easy. I do not remember the exact question.

Some Sample Questions:

Q1. Two tables emp (empid,name,deptid,sal) and dept (deptid,deptname)


are there.write a query which displays empname, corresponding deptname
also display those employee names who do not belong to any dept.

Q2. Display the employees whose salary is less than average salary.

Q3. What is the output of the program?


main()
{
int c=5;
printf("%d %d %d",c,c<<2,c>> 2);
}

Q4.What is the wrong in this program?

main()
{
int a[8][10],c=0,i,j;
for(i=0;i<10;
i++) for(j=0;
j<8;j++) a[j][i]=c++;
printf("%d",a[3][6]);
}

Q5. What is the wrong in this program?

main()
{
char *p,*q;
p=(char *)malloc(25);
q=(char*) malloc(25);
strcpy(p,"amazon" );
strcpy(q,"hyd");
strcat(p,q);
printf("%s",p);
}

Q6. Write prefix and post fix notation for (a+b)*c-(d+e)^(f-g)

Q7. What is the output of the program?

main()
{
int i=5;
printf("%d",fun(fun(fun(fun( fun(i))))));
}
void fun(int i)
{ if(i%2) return (i+(7*4)-(5/2)+(2*2));
else return (i+(17/5)-(34/15)+(5/2));
}

Q8. When it is always true boolean function

(node *p)
{
return ((p==null)||(p->next==null)|| (p->info<=p->next->info)&&( fun(p-
>next)));
}

a) when list is empty or has one node


b) when the else are sorted in non decreasing order
c) when theelseare sorted in non increasing order

Q9. What is x here (x&&!(x&(x-1))==1)

a)x is always a prime


b)x is a power of 2
c)x is even d)x is odd

Q10.What is the difference between deep copy and shallow copy?

Q11.In java what is the difference between sleep() and wait().

Q12.What happens when the parent process of a child process exits before the
child?

Q13. There are three persons A, B, C. A shots the target 6 times out of 7
shots.B shots 4 out of 5 shots. Then what is the probability of hitting the target
twice when 2 persons are selected at random.

Q14. What is valid in

cpp char *cp; const char *cpp;


1) cpp=cp;
2) cp=cpp;

Q15.Write program to swap 2 variables without using extra memory.

Q16.Write a shell command to find all java files present in nested directories.

Q17.There are 6 pairs of black socks and 6 pairs of white socks. What is the
probability to pick a pair of black or white socks when 2 socks are selected
randomly in darkness.

Q18.A string of alphanumeric is there. Find a string that starts with b and ends
with 3 characters. section B (we have to write programs) time:30 min

Q19.There is a sorted array which is of very large size. In that all except one
number are repeated once. How to find that non repeated number?

Q20.There are 2 linked lists.Those 2 lists are meeting at a point. How to find
that meeting point.

Latest Amazon Interview Questions -1

Q1.How do you convert a decimal number to its hexa-decimal equivalent. Give


a C code to do the same

Q2.Explain polymorphism citing an example.

Q3.What are the 4 basics of OOPS?

Q4.Define Data Abstraction. What is its importance?

Q5. Given an array all of whose elements are positive numbers, find the
maximum sum of a subsequence with the constraint that no 2 numbers in the
sequence should be adjacent in the array.

Eg.
i) 3 2 7 10 should return 13 (sum of 3 and 10)
ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

Q6. Given a Binary Search Tree, write a program to print the kth smallest
element without using any static/global variable. You cant pass the value k to
any function also.

Q7.You are given some denominations of coins in an array (int denom[])and


infinite supply of all of them. Given an amount (int amount), find the minimum
number of coins required to get the exact amount. What is the method called?

Q8.Given an array of size n. It contains numbers in the range 1 to n. Each


number is present at least once except for 1 number. Find the missing number.

Q9.Given an array of size n. It contains numbers in the range 1 to n. Each


number is present at least once except for 2 numbers. Find the missing numbers.

Q10.Given an array of size n. It contains numbers in the range 1 to n. Find the


numbers which are not present.

Q11.Given a string,find the first un-repeated character in it? Give some test
cases

Q12. You are given a dictionary of all valid words. You have the following
3 operations permitted on a word:

a) Delete a character
b) Insert a character
c) Replace a character

Now given two words - word 1 and word 2 - find the minimum number of steps
required to convert word 1 to word 2. (one operation counts as 1 step.)

Q13.Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the
number of smaller cubes on the surface. Extend this to k-dimension.

Q14.What is a C array and illustrate the how is it different from a list.

Q15.What is the time and space complexities of merge sort and when is it
preferred over quick sort?
Q16.Write a function which takes as parameters one regular expression(only ?
and * are the special characters) and a string and returns whether the string
matched the regular expression.

Q17.Given n red balls and m blue balls and some containers, how would you
distribute those balls among the containers such that the probability of picking a
red ball is maximized, assuming that the user randomly chooses a container and
then randomly picks a ball from that.

Q18. Find the second largest element in an array with minimum no of


comparisons and give the minimum no of comparisons needed on an array of
size N to do the same.

Q19.Given an array of size n ,containing every element from 1 to n+1, except


one. Find the missing element.

Q20.There are two urns A and B and an equal number of red balls and blue
balls.How do u place the balls in the urns such that the probability of picking up
the red ball is greater?

Q21.Two trains enter at the opposite sides of a tunnel of length L with speeds
V. A particle enters the tunnel at the same time with a speed v and it vibrates in
the tunnel[i.e. if it reaches the end of the tunnel then it comes back]. What is the
position of the particle by the time the 2 trains meet?

Q22.Write an sql query to sort a table according to the amounts in a row and
find the second largest amount.

Q23.How do you kill a process?

Q24.What is the functionality of a top command?

Q25.Given an array of size n+1 which contains all the numbers from 1 to
n.Find the number which is repeated in O(n) time .How do you proceed with the
same with floating numbersfrom 0 to 1 instead of 1 to n?

Q26.Design a data structure to represent the movement of a knight on a chess


board
Q27. Write an algorithm to traverse a knight covering all the squares on a
chessboard starting at a particular point.

Q28.Place a red ball in a urn and all the further balls in the other urn.The
probability for picking out the red ball is now greater than 0.5.

Q29.If v<=2V then the position is (v*L)/(2*V) from the starting point else it is
2*L -(v*L)/(2*V) from the starting point.

Q30.If we know the process then we can kill it by killall -9 "process name" else
we can kill it using its process id obtained by the command ps -x by kill -9
"processid" .

Q31. Top command displays all the Linux tasks running at that particular
time.It provides their running time and the resources used.

Q32.The number appearing 2 times is (sum of all the numbers in the array) -
(sum of the numbers from 1 to n).
For floating numbers multiply it with 100 and proceed.

Amazon OOPS Interview Questions

Q1.What are the major differences between C and C++?

Q2.What are the differences between new and malloc?

Q3.What is the difference between delete and delete[?

Q4.What are the differences between a struct in C and in C++?

Q5.What are the advantages/disadvantages of using #define?

Q6.What are the advantages/disadvantages of using inline and const?

Q7.What is the difference between a pointer and a reference?

Q8.When would you use a pointer? A reference?

Q9.What does it mean to take the address of a reference?



Q10.What does it mean to declare a function or variable as static?

Q11.What is the order of initialization for data?

Q12.What is name mangling/name decoration?

Q13.What kind of problems does name mangling cause?

Q14.How do you work around them?

Q15.What is a class?

Q16.What are the differences between a struct and a class in C++?

Q17. What is the difference between public, private, protected, and friend
access?

Q18.For class CFoo { }; what default methods will the compiler generate for
you>?

Q19.How can you force the compiler to not generate them?

Q20.What is the purpose of a constructor? Destructor?

Q21.What is a constructor initializer list?

Q22.When must you use a constructor initializer list?

Q23.What is a:

* Constructor?
* Destructor?
* Default constructor?
* Copy constructor?
* Conversion constructor?

Q24.What does it mean to declare a...


* member function as virtual?
* member function as static?
* member variable as static?
* destructor as static?

Q25.Can you explain the term resource acquisition is initialization?

Q26.What is a pure virtual member function?

Q27.What is the difference between public, private, and protected inheritance?

Q28.What is virtual inheritance?

Q29.What is placement new?

Q30.What is the difference between operator new and the new operator?

Q31.What is exception handling?

Q32.Explain what happens when an exception is thrown in C++.

Q33.What happens if an exception is not caught?

Q34.What happens if an exception is throws from an objects constructor?

Q35.What happens if an exception is throws from an objects destructor?

Q36.What are the costs and benefits of using exceptions?

Q37.When would you choose to return an error code rather than throw an
exception?

Q38.What is a template?

Q39.What is partial specialization or template specialization?

Q40.How can you force instantiation of a template?

Q41.What is an iterator?
Q42.What is an algorithm (in terms of the STL/C++ standard library)?

Q43.What is std::auto_ptr?

Q44.What is wrong with this statement?

Q45.
std::auto_ptr ptr(new char[10]);
It is possible to build a C++ compiler on top of a C compiler. How would you
do this?

More advanced questions:

Q1.What is a vtbl?

Q2.What is RTTI and why do you need it?

Q3.How do I specialize a template? Give an example.

Q4.What is a partial template? Why would you use one?

Q5. How to I create a binary function in the STL?


Given the following code:

class A;
class B;
class C {
A* a_;
B* b_;
public:
};

Q6. Implement a copy constructor and assignment operator for C. A


sample solution is something like:

class C {
A* a_;
B* b_;
void swap(C& rhs) { rhs.a_ = a_; rhs.b_ = b_; }
public:
C(const C& rhs) {
auto_ptr<> a(new A(rhs.a_));
auto_ptr<> b(new B(rhs.b_)):
delete a_;
delete b_;
a_ = a.release();
b_ = b.release();
}
C& operator=(const C& rhs) {
C temp(rhs);
temp.swap(*this);
return *this;
}
};

Q7. What is wrong with this class, assuming that this is its complete
interface?

class C {
char *p;
public:
C() { p = new char[64]; strcpy(p, "Hello world"); }
~C() { delete p; }
void foo() { cout << "My ptr is: << p << << endl; }
};

Since this has an overtly programmed destructor, the member wise semantics
for destruction are not good enough; therefore, they are not good enough for
copy and assignment either. But, the copy destructor and op= are not
programmed, so we will have some serious trouble.

Gradual hinting:

What happens when we make a copy?


ANS:Pointer is copied. Now, the original goes out of scope, what happens to
the copy?

[pointer dangles]. How would you fix it?

[also, that delete p should be delete[ p since p was allocated with the array new]

Assuming that swap() and copy construction are part of your interface for
class C, whats the cookie-cutter pattern for operator= that uses them?

ANS:

C& C:perator=(const C &rhs) {


if (this != &rhs) {
C tmp(rhs);
this->swap(tmp);
}
return *this;
}
]

There were two subjective questions:

Q1.The first one was given two lists write a function which returns a list which
is the intersection of the two lists.the original lists should remain same.

(Intersection if first list is say,1,20 3,45 and second list is 3,24 ,45,90,68 then
intersection should be 3,45 )

Q2.The second was given two nodes of a binary tree find the closest ancestor of
the two nodes.
Note:consider binary tree and binary search tree also.

In short answer type questions, the questions were

Q1.There was an aptitudes question in which P(A) and P(B) were given and we
had to find P(B/A) and P(A/B) when A and B are independent events.
Q2.What is the probability that the the 4 digits no. which is formed by using
the digits 1,2,3,4,5,6 is divisible by 4.

Q3.What tree traversal gives the no. in sorted order.

ANS:Inorder,preorder or postorder ?

Q4.Preorder and inorder traversal was given and we had to find the tree.

Amazon Interview questions

Q1.Write an algorithm to determine if 2 linked lists intersect

Q2.Find the 2nd-largest node in a binary tree

Q3.Probably the most difficult question they asked me was, he put a binary tree
on the whiteboard and I had to write a function that would find if the tree was
symmetrical or not. Anyone whos familiar with data structures and recursion
should be fine with this, just dont freak out when they propose the question.

Q4.Find the element from the array that has odd number of occurences

Q5.Generate words from a n *n matrix

Q6.How would you, specifically, build Amazon Web Services?

Q7. How many hours does it take a quality specialist and a temporary
contractor together to perform a damage-free check of a batch of 160
laptops?

a) 135 hours
b) 40 hours
c) 60 hours
d) 24 hours

Q8. An space rocket travels around the Earth at a speed of approximately


18.5 miles per second. This approximate speed is how many miles per
hour?

a) 1,080
b) 1,16064,
c) 80066,
d) 600

Q9. f x-4 is 6 more than y, then x+9 is how much more than y+5?

a) 10
b) 12
c) 14
d) 17

Q10. The first generation of the Galaxy 1 smartphone used to have a


battery life of 20 hours. The new Galaxy 2 has smaller batteries with 40%
less capacity. Also, the operating system of the Galaxy 2 consumes on
average 50% less battery than the one of Galaxy 1. What is the battery life
of Galaxy 2?

a) 24 hours
b) 26 hours
c) 30 hours
d) 36 hours

Q11. Exactly 1/5 of the clients who entered Mikes shop yesterday were
women. If exactly one third of the women were blonde, what is the
minimum possible number of clients that entered the shop yesterday?

Q12. Amazon.it had 140 thousand visits on Friday, including new and
returning visitors. Statistics show that for 5 new visitors there were 3
returning visitors (ratio of 5:3). What was the difference between new
visitors and returning visitors on Friday?

a) 15 thousand
b) 25 thousand
c) 35 thousand
d) 75 thousand
Q13. Amazon is negotiating with a carrier (SEUR) that will ship products
from Amazons wharehouse in Madrid to clients within the same city.
SEUR charges Amazon per shipment based on the DISTANCE between
Amazons wharehouse to the clients address - 2 fixed for the first 2
kilometers and 0.5 per additional kilometer (measured by the meter, not by
whole kilometers) for each delivery within a given city. 20% of clients live
within 2 kilometers of Amazons wharehouse in Madrid - on average they
live 1 km away. If all Amazons clients in Madrid live on average 4.5
kilometers away from Amazons wharehouse, what is the estimated average
shipping cost per delivery in Madrid, with SEUR?

Q14. A supplier of Amazon increases the price of a Book Cooking for


Children) by 30% from last year and Amazon has planned to acquire
additional stock with total (cost) value of 10,5% higher than last years
stock acquisition. , By what % should Amazon reduce the quantity of
Cooking for Children books that will buys,with regards to last year?

a) 19.5%
b) 12%
c) 8%

Q15. There are ONLY 3 brands of video consoles (A, B and C). In 2010 A
and B together represented 50% of units sold. C sold 3 million more units
than A. Also, C sold 2.5 times the same units sold by B. If all video consoles
had the same price of 300, what was the total video console market value in
2010?

Q16. Three years ago, a son was 25 years younger than his father. At
present the father is 6 times as old as the son. How old will the son be three
years from now?
Ability
Amazon Verbal Ability
Amazon Placement Paper Pattern - Hyderabad
Amazon Interview Questions paper
Amazon interview questions
Amazon Previous Years Questions 2015
Amazon Aptitude Questions
Related Companies
Polaris
Yahoo
Honeywell
SAP labs India
Cognizant
Infosys
Syntel
TCS
Wipro
Polaris
Google
Dell
EMC Corporation
Verizon

Placement Papers for All Companies


3i infotech
Abacus Infotech
Abatix
Abaxis
ABB
ACC Limited
Accel Frontline
Accenture
Aditi Technologies
Adobe System
ADP
Agilysys
AgreeYa
AIG
AirNet
Alanco Technologies
Alle Technologies
Allfon
Alter Systems
Amazon
AMDL
Amdocs
AMI
Amiti Software Technologies
ANZ
Apple
Applied Materials
Apps Associates
Aricent
ASDC
Ashok Leyland Ltd
Asian Paints
Aspire System
AT & T
Atlas Copco
Atos Origin
AXA Technology Services
Axes Technology
Bain
Bajaj
Bayer
Bharti Airtel Ltd
Bhawan Cybertek
Birlasoft
Blue Star Infotech
BMC
BOB
Brakes India
C-DOT
CA Technologies
Cadence
Calsoft
Canarys
Capgemini
Caterpillar
Celstream
CGI Group
Changepond Technologies
Cimtrix Systems
Cisco system
Citicorp Overseas Software Ltd
ClinTech
CMC Limited
CMS
Cognizant
Compaq
Consagous Technologies
Convergys
CORDYS
CRISIL
Crompton Greaves
CSC
CSFB
CtrlS Datacenters Ltd
Cummins
Cyient
Daffodil
Daimler
Dell
Deloitte
Delphi-TVS
Dharma Systems
Directi
DSRC
Eicher
ELGI
ELICO
EMC Corporation
Emphasis
Ericsson
Ernst & Young
ESKO
Essar
Facebook
Fanuc Corporation
Fidelity
Flextronics
Flipkart
Freescale
Fujitsu
Gajshield
GE
Genpact India
Geodesic
Geometric Limited
GlobalEdge
GlobalLogic
GMR Group
Godrej Infotech
Google
Grapecity
Harita - TVS
HCL
HCL Technologies
Headstrong
Healthasyst
HEC Ltd
Hexaware
HFCL
Holool
Honeywell
HP
HTC Global Services
Huawei
Hughes
Hyundai
IBM
IBS Software Services
IGate
Ikanos
IKOS
Impetus
iNautix
Indecomm
IndiaBulls Power Limited
Inductis-EXL
Industrial Alliance
Infineon
Infogain
Infosys
Intec
Integra
Intel
Intergraph
ITC Infotech
Jindal Steel and Power Limited
KPIT
L&T
L & T Infotech
LG Soft
Linde India Ltd
LnT Emsys
LnT-ECC
Lucas - TVS
Mahindra Engineering Services Ltd
Mahindra Ltd
Maruti
Matrix
Maveric Systems
McAfee
Microland
Microsoft
Mindtree
Miraclesoft
MKCL
Motorola
Mu-Sigma
Nagarro
NASSCOM
NCR Corporation
Ness Technologies
Neudesic
NIIT Technologies
Novell
Nvidia
Oracle
Persistent
Philips
Planetasia
Polaris
Poornam Info Vision
PSI Data Systems Limited
Quest-Global
Quinnox
R Systems
Redpine
Reliance Energy
Robert Bosch
RS Software
Samsung
SAP labs India
Sapient
Sasken Communications
Schneider India
Serco
Siemens
Sierra Atlantic
SkyTECH
Soliton
Sonata Software
Sony India
SQL Star
Steria
Subex Limited
Sutherland Global Services
Syntel
Talisma
Tata motors
Tata technologies
Tata-ELXSI
TCE
TCS
Tech Mahindra
Temenos
Tesco
Texas Instruments
Thermax
ThoughtWorks
Torry Harris
Triad
Trianz
Trilogy
TVS Motor
Unisys
UnitedHealth Group
UST Global
UTC Aerospace System
Valuelabs
Vedanta
Verifone
Verizon
Virtusa
Vision Infotech
Vizual
VMware
Wipro
Yahoo
YASH Technologies
Zenith
Zensar Technologies
ZTE
Previous Paper
Next Paper
Amazon Language Paper 2015
Posted on :11-02-2016
APTITUDE

Q1. What are the files which are automatically opened when a C file is
executed?

Q2. What will be the position of the file marker?

a: fseek(ptr,0,SEEK_SET);
b: fseek(ptr,0,SEEK_CUR);

Q3. What is the problem with the following code segment?

while ((fgets(receiving array,50,file_ptr)) != EOF)

Q4. Predict the output or error(s)

Q5. Predict the output or error(s)

Q6. In the following pgm add a stmt in the function fun such that the
address ofa gets stored in j.

ANS:*k = &a

Q7. What are the following notations of defining functions known as?

ANS:
i. ANSI C notation
ii. Kernighan & Ritche notation

Q8. Is the following statement a declaration/definition. Find what does it


mean?

int (*x)[10];

ANS:Definition-x is a pointer to array of(size 10) integers.

Q9. What is the output for the program given below

typedef enum errorType{warning, error, exception,}error;


main()
{
error g1;
g1=1;
printf("%d",g1);
}

ANS:Compiler error: Multiple declaration for error

Q10. What is the output for the program given below

typedef struct error{int warning, error, exception;}error;


main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
}

ANS:1

Q11. What is the output for the program given below

ANS:bye

Q12. What is the output for the program given below

ANS: 1 1 1 1
2424
3737
4242
5555
6868
7373
8686
9999

Q13. Declare an array of N pointers to functions returning pointers to


functions returning pointers to characters?

ANS:
(char*(*)( )) (*ptr[N])( );

Q14. There were 10 records stored in some file. data but the following
program printed 11 names. What went wrong?

Q15. Is there any difference between the two declarations,

1. int foo(int *arr[]) and


2. int foo(int *arr[2])

ANS:No

Q16. What is the subtle error in the following code segment?

Q17. What is wrong with the following code?

Q18. What is the hidden bug with the following statement?

assert(val++ != 0);

Q19. Is the following code legal?

struct a
{
int x;
struct a b;
}

ANS:No

Q20. Is the following code legal?

void main()
{
typedef struct a aType;
aType someVariable;
struct a
{
int x;
aType *b;
};
}

ANS:No

Q21. Which version do you prefer of the following two,

1) printf(%s, str); // or the more curt one


2) printf(str);

ANS:1

Q22. Find the output.

main()
{
char a[4]="HELL";
printf("%s",a);
}

ANS:
HELL%@!~@!@???@~~!

Q23. Printf can be implemented by using __________ list.

ANS:Verbal Length argument

Q24. The command which gives the device of our system

ANS:Who

Q25. Which of following is correct:

a)For loops can be nested


b)For Loops may use the same Index
c)For loops cannot be overl lapped

ANS:a,c

Q26. when the system starts which will execute?

ANS:Booting loader

Q27. ada is _____________ language



a) modular
b) object based
c) object oriented
d) functional

Q28. The maximum level of the tree is

ANS:depth of the tree

Q29. Which is used for storing pictures or graphics?

a) mbr
b) mar
c) frame buffer
d) sdram

Latest Amazon Interview Questions -1

Q1. Given an array all of whose elements are positive numbers, find the
maximum sum of a subsequence with the constraint that no 2 numbers in the
sequence should be adjacent in the array.

i) 3 2 7 10 should return 13 (sum of 3 and 10)


ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)

Q2.Given an array of size n. It contains numbers in the range 1 to n. Each


number is present at least once except for 1 number. Find the missing number.

Q3.What are the 4 basics of OOP?


Q4. Given a Binary Search Tree, write a program to print the kth smallest
element without using any static/global variable. You cant pass the value k to
any function also.

Q5.How do you convert a decimal number to its hexa-decimal equivalent.Give


a C code to do the same

Q6.Define Data Abstraction. What is its importance?

Q7.You are given some denominations of coins in an array (int denom[])and


infinite supply of all of them. Given an amount (int amount),
find the minimum number of coins required to get the exact amount. What is the
method called?

Q8.Explain polymorphism citing an example

Q9.Given an array of size n. It contains numbers in the range 1 to n. Each


number is present at least once except for 2 numbers. Find the missing numbers.

Q10.Given an array of size n. It contains numbers in the range 1 to n. Find the


numbers which are not present.

Latest Amazon Interview Questions -2

Q1.How would you find the second largest element in an array using minimum
no of comparisons?

Q2.Write a C program for level order traversal of a tree?

Q3.You are given: 3 types of vehicles: Motorbike, Car, and a special type of
car for the handicapped.

Q4. Types of parking: Motorbike parking, Car parking, handicapped car


parking.
Motorbikes and cars can only park in their designated parkings, while the
handicapped cars can park either in their own parking or the regular car parking.
How would you model this as classes? Explain your methods.
Q5. Given 2 tables: Employee (Employee_Name,Dept_No) Department
(Dept_No, Dept_Name)

Write an SQL query which outputs all the employees, and their department nos
and names, including all those departments which have no employees working
for them.

Q6.Explain about Inodes?

Q7.Give a Linux shell command to find all files in a directory which contain ip
addresses.

Q8.Given a table Employee which has columns name and salary, write an SQL
query to find the employee with the second highest salary.

Q9. Given a string A, and a string B, and a dictionary, how would you
convert A to B in the minimum no of operations, given that:
i) All the intermediate words must be from the dictionary
ii) An operation is defined as:

a) Delete any character from a string ex dog do


b) Insert any character into a string ex cat cart
c) Replace any character in the string with another ex cat cot

Q10.Given a table of Player which contains S.no and player name, write a
query which finds all possible Table Tennis doubles pairings.
AMAZON Aptitude Questions

Q1.A function f(x) is defined as f(x) = f(x - 2) - x(x + 2) for all the integer
values of x and f(1) + f(4) = 0. What is the value of f(1) + f(2) + f(3) + f(4) +
f(5) + f(6)?

A) 0
B) 89
C) 89
D) None of these

ANS:C
Explanation:

Let S = f(1) + f(2) + f(3) + f(4) + f(5) + f(6)


As f(1) + f(4) = 0, therefore S = f(2) + f(3) + f(5) + f(6) ------ (1)
f(2) = f(0) - 8
f(3) = f(1) - 15
f(4) = f(2) - 24 = f(0) - 32
f(5) = f(3) - 35 = f(1) - 50
f(6) = f(4) - 48 = f(0) - 80
Put the above values in equation (1), we get
S = f(0) - 8 + f(1) - 15 + f(1) - 50 + f(0) - 80
S = 2(f(0) + f(1)) - 153 ------ (2)
As we already know f(1) + f(4) = 0 f(1) + f(0) - 32 = 0 f(1) + f(0) = 32
Putting this value in equation 2, we get S = 2(32) - 153 = -89
So, Ans is option C.

Q2.In ABC, the internal bisectors of ABC and ACB met at 1 and BAC =
50.The measure of BIC is

A) 105
B) 115
C) 125
D) 130

ANS:B.

Explanation:

I is the In-centre
So, BIC = 90 + 1/2 BAC
= 90 + 1/2 50 = 115

Q3.The difference between [3/5] of [2/3] a number and [2/5] of[1/4] of the
same number is 288. What is the number?

A) 960
B) 850
C) 895
D) 955
E) 44%

ANS:A.

Explanation:

Let the current price be Rs. 100.


For getting 12% profit he should sell it at Rs. 112.
Let the label price be x.
Let the no. Be [3/5]*[{2/5}x]-[2/5]*[1/4]x,then = 288 Solving it we will get 960

Q4.A, B, C and D are four consecutive odd numbers and their average is
42. What is the product of B and D?

A) 1860
B) 1890
C) 1845
D) 1677
E) None of these

ANS:C.

Explanation:

Work done by A and B in 12 days is


12[112*5/4]=12*5/120=.5
As diff. Is same so average should lie between B and C so B is 41 & C is 43 so
D must be 45 as we have to find the product of B and D so it would be 1845

Q5.BL and CM are medians of ABC right angled at A and BC =5 cm. If


BL =3- 5/2 cm, then the length of CM is

A) 2 5
B) 5 2
C) 10 2
D) 4 5

ANS:A.
Explanation:

Here, BC = 5cm
BL = 3 5/2 cm
By using the formula
4(BL2 + CM2) = 5BC2

Q6.A sum of Rs 731 is divided among A, B and C such that A receive 25%
more than B and B receive 25% less than C. What is Cs share in the
amount?

A) Rs. 172
B) Rs. 200
C) Rs. 262
D) Rs. 258
E) None of these

ANS:E.

Explanation:

A + B + C = 731 ..... (i) A = 1.25B, gives A = 1.25 * 0.75 C = 0.9375 C....(ii) B


= 0.75C....(iii) Using (ii) and (iii) in (i) we get 0.9375C + 0.75C + C = 731,
gives C = 272. So option E is the answer.

Q7. In how many different ways can letters of the word "PRAISE" be
arranged?

A) 720
B) 610
C) 360
D) 210
E) None of these

ANS:A.

Explanation:
As total number of alphabets in PRAISE are 6, so total no. of ways is 6!=720 So
option A is the answer

Q8. If the numerator of a fraction is increased by 150% and the


denominator of the fraction is increased by 300%, the resultant fraction is
[5/18]. What is original fraction?

A) 4/9
B) 4/5
C) 8/9
D)8/11
E) None of these

ANS:A.

Explanation:

Let the fraction be [n/d] & after that it becomes [2.5 n / 4 d]=5/18 . So we get
the result as [4/9]

Q9. A car covers the first 30 km of its journey in 45 minutes and the
remaining 25 km in 30 minutes. What is the average speed of the car?

A) 60
B) 64
C) 49
D) 48
E) None of these

ANS:E.

Explanation:

Total distance/Total time =(30+25)/[(3/4)+(1/2)]


Average Speed=44kmph

Q10.Four examiners can examine a certain number of answer papers in 10


days by working for 5 hours a day. For how many hours a day would 2
examiners have to work in order to examine twice the number of answer
papers in 20 days?

A) 8
B) 7.5
C) 10
D) 8.5
E) None of The above

ANS:C.

Explanation:

You might also like