# Software Companies Placement Papers With Answers- Amazon-Free Download

##

__Amazon Aptitude Test__

** Aptitude Questions**
**
**

1) Bhanu spends 30% of his income on petrol on scooter. Ľ of the
remaining on house rent and the balance on food. If he spends Rs.300 on
petrol then what is the expenditure on house rent?

a) Rs.525 b) Rs.1000 c) Rs.675 d) Rs.175

2) If the numerator of a fraction is increased by 25% and denominator
decreased by 20%, the new value is 5/4. What is the original value?

a) 3/5 b) 4/5 c) 7/8 d) 3/7

3) The length of a rectangle is increased by 60%. By what % would the
width have to be decreased to maintain the same area?

**
a) 30% b) 60% c) 75% d) 37.5%
**

4) The value of ľ + 5 / 36 + 7 / 144 + …….+17 / 5184 + 19 / 8100 is

a) 0.99 b) 0.98 c) 0.95 d) None of these

5) A sporting goods store ordered an equal number of white and yellow
balls. The tennis ball company delivered 45 extra white balls, making
the ratio of white balls to yellow balls 1/5 : 1/6. How many white
tennis balls did the store originally order for?

**
a) 450 b) 270 c) 225 d) None of these
**

6) A student's grade in a course is determined by 6 quizzes and one
examination. If the examination counts thrice as much as each of the
quizzes, what fraction of final grade is determined by the examination?

**
a) 1/6 b) 1/5 c) 1/3 d) 1/4
**

7) A sum of money is divided among A, B and C such that for each rupee
A gets, B gets 65paise and C gets 35paise. If C's share is Rs.560, the
sum is …

a) 2400 b) 2800 c) 3200 d) 3800

8) Joe's father will be twice his age 6 years from now. His mother was
twice his age 2 years before. If Joe will be 24 two years from now,
what is the difference between his father's and mother's age?

a) 4 b) 6 c) 8 d) 10

9) A traveler walks a certain distance. Had he gone half a kilometer an
hour faster \, he would have walked it in 4/5 of the time, and had he
gone half a Kilometer an hour slower, he would have walked 2 ˝ hr
longer. What is the distance?

a) 10 Km b) 15 Km c) 20 Km d) Data Insufficient

10) Two oranges, 3 bananas and 4 apples cost Rs.15. 3 oranges, 2
bananas and 1 apple cost Rs.10. I bought 3 oranges, 3 bananas and 3
apples. How much did I pay?

a) 10 b) 8 c) 15 d) Cannot be determined

11) A report consists of 20 sheets each of 55 lines and each such line
consists of 65 characters. This report is retyped into sheets each of
65 lines such that each line consists of 70 characters. The % reduction
in the number of sheets is closest to

a) 20 b) 5 c) 30 d) 35

12) A ship leaves on a long voyage. When it is 18 miles from the shore,
a seaplane, whose speed is 10 times that of the ship is sent to deliver
mail. How far from the shore does the seaplane catch upo with the ship?

a) 24 miles b) 25 miles c) 22miles d) 20 miles

13) Anand finishes a work in 7 days, Bittu finishes the same job in 8
days and Chandu in 6 days. They take turns to finish the work. Anand on
the first day, Bittu on the second and Chandu on the third day and then
Anand again and so on. On which day will the work get over?

a) 3rd b) 6^{th} c) 9th d) 7th

14) 3 men finish painting a wall in 8 days. Four boys do the same job
in 7 days. In how many days will 2 men and 2 boys working together
paint two such walls of the same size?

a) 6 6/13 days b) 3 3/13 days c) 9 2/5 days d) 12 12/13 days

15) There are 5 distinct pairs of white socks and 5 pairs of black
socks in a cupboard. In the dark, how many socks do I have to pull out
to ensure that I have at least 1 correct pair of white socks?

a) 3 b) 11 c) 12 d) 16

16) In a circular race track of length 100 m, three persons A, B and C
start together. A and B start in the same direction at speeds of 10 m/s
and 8 m/s respectively. While C runs in the opposite at 15 m/s. When
will all the three meet for the first time on the after the start?

a) After 4 s b) After 50 s c) After 100 s d) After 200 s

17) If the distance traveled (s) in time (t) by a partile is given by
the formula s = 1+ 2t+3t2+4t3 , then what is the distance travelled in
the 4th second of its motion?

a) 141m b) 171m c) 243m d) 313m

18) There is a circular pizza with negligible thickness that is cut
into 'x' pieces by 4 straight line cuts. What is the maximum and
minimum value of 'x' respectively?

a) 12,6 b) 11,6 c) 12,5 d) 11,5

19) When ľ of a unit's digit is added to the ten's digit of a two
number, the sum of the digits becomes 10. If Ľ of the ten's digit added
to the unit's digit, then the sum of the digits is 1 less than the
previous. Find the number.

a) 94 b) 84 c) 48 d) 88

20) Amal bought 5 pens, 7 pencils and 4 erasers. Rajan bought 6 pens, 8
erasers and 14 pencils for an amount which was half more than what Amal
had paid. What % of the total amount paid by Amal was paid for pens?

a) 37.5% b) 62.5% c) 50% d) None of these

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

** **

**
1. d 2. b 3. d 4. a 5. c 6. c 7. c 8. c 9. b 10. c 11. a 12. d 13. d
14. d 15. c 16. c 17. b 18. d 19. c 20. b
**

** **

** **

** **

**
**

1. A can copy 50 papers in 10 hrs., while A & B can copy 70 papers
in 10 hrs. How many hours are required for B to copy 26 papers?

A. 10 hours

B. 15 hours

C. 12 hours

D. 13 hours

Explanation:

A can copy 50 papers in 10 hrs., while A & B can copy 70 papers in
10 hrs.

It means B can copy 20 papers in 10 hrs.

Then time taken by B to copy 26 papers = 26*10/20 = 13 hours.

2. A man travels by bus for 20 hours and they by train for 05 hours. if
the average speed of the bus was 20 kmph and that of the entire journey
was 24 kmph. What was the average speed of the train?

A. 44kmph

B. 30 kmph

C. 36 kmph

D. 40 kmph

Explanation:

Total distance travelled = 24*(20+5) = 600 kms

distance travelled by bus = 20*20=400 kms

distance travelled by train = 600-400=200kms

Average speed of train = 200/5=40 kmph.

3. The length and breadth of a square are increased by 40% and 30%
respectively. The area of the resulting rectangle exceeds the area of
the square by:

A. 42%

B. 62%

C. 82%

D. None

Explanation:

Area of square = x2.

Increment of length = 1.4x.

Increment of breadth = 1.3x

Area of rectangle = l×b = 1.82 x2.

Increment in area= 1.82 x2 - x2 = 82%.

4. The average salary per month of 30 employees in a company is Rs.
4000. If the manager's salary is added, the average salary increases to
Rs. 4300, what is the salary of the manager?

A. Rs. 10000

B. Rs. 13000

C. Rs. 12000

D. Rs. 13300

Explanation:

Let total salary of the emp=30*4000=1,20,000

Now,

By adding one member that is Manager =31

So,

Total salary of the emp=31*4300=1,33,300

Net salary of the manager =1,33,300-1,20,000=13300.

5. The ratio of the ages of A and B is 9:5. After 8 years B would reach
the present age of A. Find the present ages of B and A respectively.

A. 9, 5

B. 10, 18

C. 18, 10

D. 5, 9

E. 5, 7

Explanation:

Let the present age of A & B be 9x and 5x.

According to the condition,

=> 5x + 8 = 9x

=> 4x = 8.

=> x = 2.

Therefore, the present age of A = 9 * 2 = 18 and B = 5 * 2 = 10.

6. Find [(4/7) ^3-(3/7) ^3]/ [(4/7) ^2-(3/7) ^2] =?

A. 31/49

B. 39/49

C. 37/49

D. 34/49

Explanation:

From the question,

(4/7) ^3-(3/7) ^3= [(4^3) -(3^3)]/ (7^3)

= (64-27)/ (7^3)

=37/343.

And,

(4/7) ^2-(3/7) ^2= [(4^2) -(3^2)]/ (7^2)

= [16-9]/ (7^2) =7/49.

Therefore, the required answer:

=> (37/343)/ (7/49) = (37*49/343)/7

=> (37/7)/7 = 37/49.

7. The average weight of 8 men is increased by 1.5 kg when one of the
men who weighs 65 kg is replaced by a new man. The weight of the new
man is:

A. 76 kg

B. 76.5 kg

C. 76.7 kg

D. 77 kg

Explanation:

Let x be the average weight of 8 men (before replacement). Therefore
(x+1.5) will be the average weight of 8 men (after replacement)

=> (7*x + 68)/8 = x.

=> x = 65.

=> (7*x + new)/8 = x + 1.5.

New = (8*65+8*1.5 – 8*65) = 65+12 = 77.

8. If radius of a circle is diminished by 10% then its area is
diminished by

A. 10%

B. 19%

C. 20%

D. 36%

Explanation:

Let, the old radius be 'r'.

New r=100-10)/100= 0.9r.

Old area=3.14 *r2

New area=3.14 * 0.81r2

Hence, % decrease= [3.14 r2(1-0.81)] *100/3.14 r2 = 19%.

9. Coding-Decoding:

If GERMANY is written as 7, 5, 18, 13, 1, 14, 25, how can FRANCE be
written in that code?

A. 6, 18, 1, 14, 3, 5

B. 6, 3, 18, 14, 1, 5

C. 8, 2, 14, 5, 13, 6

D. 8, 16, 14, 3, 1, 5

Answer: B.

10. Direction sense:

Rohit walked 25 meters towards South. Then he turned to his left and
walked 20 meters. He then turned to his left and walked 25 meters. He
again turned to his right and walked 16 meters. At what distance is he
from the starting point and in which direction?

A. 35 meters East

B. 35 meters North

C. 40 meters East

D. 60 meters East

Answer: A

11. Seating Arrangement:

A, B, C, D, E, F and G are sitting in a row facing North:

F is to the immediate right of E.

E is 4th to the right of G.

C is the neighbor of B and D.

Person who is third to the left of D is at one of ends. Who are to the
left of C?

A. Only B

B. G, B and D

C. G and B

D. D, E, F and A

Explanation:

Their sitting arrangement is: - G B C D E F A.

12. Blood Relation:

Ankit is the son of Zubin. Manju is the daughter of Anil. Sheela is the
mother of Manju. Mohan is the brother of Manju. How is Mohan related to
Sheela?

A. Brother

B. Father

C. Son

D. Cannot be determined

Explanation:

Manju is the daughter of Anil. 'Sheela is the mother of Manju.
Therefore, Mohan is the son of Sheela.

13. Series Completion:

AYBZC, DWEXF, GUHVI, JSKTL?

A. MQORN

B. MQNRO

C. NQMOR

D. QMONR

Answer: B

14. Data-Sufficiency:

Question: Which word in the code language means 'flower’?

Statements:

(I) 'de fu la pane' means 'rose flower is beautiful' and 'la quiz'
means 'beautiful tree'.

(II) 'de la chin' means 'red rose flower' and 'pa chin' means 'red
tea'.

A. I alone is sufficient while II alone is not sufficient

B. II alone is sufficient while I alone is not sufficient

C. Either I or II is sufficient

D. Neither I nor II is sufficient

E. Both I and II are sufficient

Explanation:

From the two statements given in I, the code for the only common word
'beautiful' can be determined.

From the two statements given in II, the code for the only common word
'red' can be determined.

In I and II, the common words are 'rose and 'flower' and the common
code words are 'de' and 'la'.

So, the code for 'flower' is either 'de' or 'la'.

15. Jumbled Sentence:

S1: A certain young man was entrusted to the care of a teacher.

P: ‘‘This dullard will come to grief if I send him away without a
single lesson’’, thought the teacher.

Q: He was so dull of the mind that he could not, even in three months’
time, learn as much as a single lesson.

R: The young man came to ask the teacher’s permission to go home.

S: “It’s my business to provide a good education to my pupils to get on
in life.”

S6: The teacher asked him to wait.

A. QPSR

B. PSRQ

C. SRQP

D. RQPS

Answer: A

**
**

1.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 donot belong to any dept.

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

3.what is the output of the program

main()

{

int c=5;

printf("%d %d %d",c,c<<2,c>> 2);

}

4.

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]);

}

5.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);

}

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

7.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));

}

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

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

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

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

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

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

14.what is valid in cpp char *cp; const char *cpp; 1) cpp=cp; 2)
cp=cpp;

15.write program to swap 2 variables without using extra memory.

16.write a shell command to find all java files present in nested
directories.

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

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

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

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

Latest Amazon Interview Questions -1

1. How do you convert a decimal number to its hexa-decimal
equivalent.Give a C code to do the same

2. Explain polymorphism citing an example.

3. What are the 4 basics of OOP?

4. Define Data Abstraction. What is its importance?

5. 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)

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

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

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

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

10.Given an array of size n. It contains numbers in the range 1 to n.
Find the numbers which aren't present.

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

2.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 - word1 and word2 - find the minimum number of
steps required to convert word1 to word2. (one operation counts as 1
step.)

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

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

5. What is the time and space complexities of merge sort and when is it
preferred over quick sort?

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

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

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

9. Given an array of size n ,containing every element from 1 to n+1,
except one. Find the missing element.

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

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

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

13 How do you kill a process?

14 What is the functionality of a top command?

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

from 0 to 1 instead of 1 to n?

16 Design a data structure to represent the movement of a knight on a
chess board

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

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

19)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.

20If 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" .

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

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

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

2. What are the differences between new and malloc?

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

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

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

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

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

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

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

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

11. What is the order of initialization for data?

12. What is name mangling/name decoration?

13. What kind of problems does name mangling cause?

14. How do you work around them?

15. What is a class?

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

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

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

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

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

21. What is a constructor initializer list?

22. When must you use a constructor initializer list?

What is a:

* Constructor?

* Destructor?

* Default constructor?

* Copy constructor?

* Conversion constructor?

What does it mean to declare a...

* member function as virtual?

* member function as static?

* member variable as static?

* destructor as static?

1.Can you explain the term "resource acquisition is initialization?"

2.What is a "pure virtual" member function?

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

4.What is virtual inheritance?

5.What is placement new?

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

7.What is exception handling?

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

9.What happens if an exception is not caught?

10.What happens if an exception is throws from an object's constructor?

11.What happens if an exception is throws from an object's destructor?

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

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

14.What is a template?

15.What is partial specialization or template specialization?

16.How can you force instantiation of a template?

17.What is an iterator?

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

19.What is std::auto_ptr?

20What is wrong with this statement?

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:

* What is a vtbl ?

* What is RTTI and why do you need it?

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

To separate sheep from goats (for those claiming C++ Guru status):

* What is a partial template? Why would you use one?

* How to I create a binary functor in the STL?

Given the following code:

class A;

class B;

class C {

A* a_;

B* b_;

public:

};

*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;

}

};

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 ctor and op=
are not programmed, so we will have some serious trouble.

Gradual hinting: what happens when we make a copy? [correct answer:
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, what's the cookie-cutter pattern for operator= that uses
them?

answer:

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

if (this != &rhs) {

C tmp(rhs);

this->swap(tmp);

}

return *this;

}

]]

There were two subjective questions

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

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

1.There was an aptitude?s 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.

2.What is the probability that the the 4 digit?s no. which is formed by
using the digits 1,2,3,4,5,6 is divisible by 4.

3.What tree traversal gives the no. in sorted order.Inorder,preorder or
postorder ?

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

Amazon Interview questions

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

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

3. 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 who's familiar with
data structures and recursion should be fine with this, just don't
freak out when they propose the question.

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

5. Generate words from a n *n matrix

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

In an Amazon Fulfillment center, it takes a quality specialist 20
minutes to perform a damage-free check of one laptop. A temporary
contractor takes 60 minutes to perform the same task.

1How 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?

135 hours 40 hours 60 hours 24 hours

2An 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?

1,080 1,16064, 80066, 600

3If x-4 is 6 more than y, then x+9 is how much more than y+5?

10 12 14 17

4The 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?

24 hours 26 hours 30 hours 36 hours

5Exactly 1/5 of the clients who entered Mike's 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?

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

15 thousand 25 thousand 35 thousand 75 thousand

7Amazon is negotiating with a carrier (SEUR) that will ship products
from Amazon's wharehouse in Madrid to clients within the same city.
SEUR charges Amazon per shipment based on the DISTANCE between Amazon's
wharehouse to the client's 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 Amazon?s wharehouse in Madrid - on
average they live 1 km away. If all Amazon?s clients in Madrid live on
average 4.5 kilometers away from Amazon's wharehouse, what is the
estimated average shipping cost per delivery in Madrid, with SEUR?

8A 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
year?s stock acquisition. , By what % should Amazon reduce the quantity
of ?Cooking for Children? books that will buys,with regards to last
year?

19.5% 12% 8%

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?

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?

5 9 8 11

5 10 15 20

** **

**
**

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;l

printf("%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;

}s,*st;

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);

}

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.#include

main()

{

int i=4;

if(i=0)

printf("statement 1");

else

printf("statement 2");

}

/* statement 2 */

** **

## Source: Contents are provided by Technicalsymposium Google Group Members.

Disclaimer: All the above contents are provided by technicalsymposium.com Google Group members.

Further, this content is not intended to be used for commercial purpose. Technicalsymposium.com is not liable/responsible for any copyright issues.