## Amazon Placement Papers

Amazon Aptitude Questions 2016 & Interview Questions

Amazon Technical paper 19 Feb 2012 , 2013

Amazon Reasoning Ability

Amazon Verbal Ability

Amazon Placement Paper Pattern - Hyderabad

Amazon Language Paper 2015

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

# Amazon Interview Questions paper

Posted on :11-02-2016

__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 nodeb) when the else are sorted in non decreasing orderc) when the else are sorted in non increasing order

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

a)x is always a primeb)x is a power of 2c)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 canÃ¢Â€Â™t 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 characterb) Insert a characterc) 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 numbers from 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?**

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

__ANS:__[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.

**Inorder, preorder or postorder ?**

__ANS:__**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 hoursb) 40 hoursc) 60 hoursd) 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,080b) 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) 10b) 12c) 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 hoursb) 26 hoursc) 30 hoursd) 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 thousandb) 25 thousandc) 35 thousandd) 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?**

## Amazon Placement Papers

➤ Amazon Aptitude Questions 2016 & Interview Questions

➤ Amazon Technical paper 19 Feb 2012 , 2013

➤ Amazon Reasoning Ability

➤ Amazon Verbal Ability

➤ Amazon Placement Paper Pattern - Hyderabad

➤ Amazon Language Paper 2015

➤ 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

## Top Companies Placement Papers

TCS Papers

Wipro Papers

HCL Papers

IBM Papers

Amazon Papers

CISCO System Papers

Cognizant Papers

CSC Papers

Tata Motors Papers

Tech Mahindra Papers

L&T Papers

Facebook Papers

Dell Papers

L & T Infotech Papers

Capgemini Papers

HP Papers

Microsoft Papers

Google Papers

Samsung Papers