[go: up one dir, main page]

0% found this document useful (0 votes)
40 views5 pages

Amazon Interview Questions - TopTalent

Uploaded by

Technical Novice
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views5 pages

Amazon Interview Questions - TopTalent

Uploaded by

Technical Novice
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Amazon Interview Questions - TopTalent.in https://www.toptalent.

in/blog/2013/09/21/amazon-interview-questions/

Amazon Interview Latest Blogs

Popular Blogs

Questions Top 10 Tips To Crack An


September 21, 2013 by Garima Thakur Interview (/Blog
/2015/06/12/top-
10-tips-to-crack-
an-interview)
Becoming A Super Star
Business Analyst: Tips
From A Consultant
(/Blog/2015/06
/10/becoming-a-super-
star-business-analyst-
tips-from-
a-consultant)
Interview With Ashish
Piplani Who Got Into
(http://www.toptalent.in/blog/wp-content/uploads
Flipkart (/Blog/2015/06
/2013/09/amazon-333-ruby.jpg)If you are looking for all
/05/interview-
the interview questions Of Amazon, you are at the right
with-ashish-piplani-
place. We have compiled the questions that have been who-got-into-flipkart)
asked so far by Amazon together. Arrays, linked lists and
7 Career Benefits Of
trees are the most common data structures that
Having A Strong
Amazon interviewers ask about.�Solve the below Network (/Blog
questions and it might increase your chances of /2015/06/01/7-career-
clearing the technical round.� benefits-of-having-
a-strong-network)
Top 10 Analytics Firms
Question 1.�There is a big file of words which is Offering Highest
dynamically changing. We are continuously adding Salaries In India (/Blog
some words into it. How would you keep track of top 10 /2015/05/26/top-
trending words at each moment? 10-analytics-firms-
offering-highest-
Question 2.�Write code for minHeapify() operation. salaries-in-india)

Question 3.�Design a data structure for the following


operations:
Latest Jobs
I. � Enqueue

1 of 5 14-06-2015 18:47
Amazon Interview Questions - TopTalent.in https://www.toptalent.in/blog/2013/09/21/amazon-interview-questions/

II. �Dequeue
Popular Jobs
III. Delete a given number(if it is present in the queue,
else do nothing) Sales Executive -
IV. isNumberPresent Ed-Tech Startup - SaaS
All these operations should take O(1) time. (/Job/4080/sales-
executive-ed-tech-
Question 4.�Write a function that returns the length of startup-saas-mumbai-
the longest leaf-to-leaf path in a binary tree. powai-india)
Shaastr, Mumbai,
Powai, India
Question �5.�You are given an array of positive
integers. Convert it to a sorted array with minimum cost UI/UX Designer
(minimum number of operations). Only valid operation (/Job/4073/ui-ux-
designer-bangalore-
are
india)
LocalOye, Bangalore,
1) Decrement -> cost = 1
India
2) Delete an element completely from the array -> cost =
UI/UX Developer
value of element
(/Job/4072/ui-ux-
For example:�4,3,5,6, -> cost 1 //cost is 1 to make 4->3
developer-hyderabad-
10,3,11,12 -> cost // cost 3 to remove 3
india)
Thrymr So ware,
Question 6.�Given an array of integers, find Hyderabad, India
Pythagorean triplets.�i.e. find a,b and c which satisfies
So ware Developer
a^2 + b^2 = c^2.�Integers could be positive or negative.
Manager (/Job/4071
/so ware-developer-
Question 7.�Given an array all of whose elements are manager-gurgaon-
positive numbers, find the maximum sum of a haryana-india)
subsequence with the constraint that no 2 numbers in LexInnova,
the sequence should be adjacent in the array. So 3 2 7 Gurgaon/Haryana,
10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 India
should return 15 (sum of 3, 5 and 7) Lead Android
Developer (/Job/4069
Question 8.�There are n petrol bunks arranged in /lead-android-
circle. Each bunk is separated from the rest by a certain developer-bangalore-
distance. You choose some mode of travel which needs india)
1litre of petrol to cover 1km distance. You can't infinitely Evobi Automations Pvt
draw any amount of petrol from each bunk as each Ltd, Bangalore, India
bunk has some limited petrol only. But you know that
the sum of litres of petrol in all the bunks is equal to the
distance to be covered.
ie let P1, P2, ... Pn be n bunks arranged circularly. d1 is
distance between p1 and p2, d2 is distance between p2
and p3. dn is distance between pn and p1.Now find out
the bunk from where the travel can be started such that
your mode of travel never runs out of fuel.

2 of 5 14-06-2015 18:47
Amazon Interview Questions - TopTalent.in https://www.toptalent.in/blog/2013/09/21/amazon-interview-questions/

Question 9.�A tree is represented in a matrix form such


that A[i,j] = 1 if j is the ancestor of i. Otherwise A[i,j] = 0. Find us on Facebook
Given this construct a normal binary search tree.
TopTalent.in
Like
Question 10.��A 2D array is such that each row in it is
in ascending order and each column is in ascending
76,645 people like
order. How will you search for an element in this array? TopTalent.in.

Question 11.�A city is represented as a grid where


each line represents a road. As it is a grid, all the
horizontal roads intersect with all vertical roads. A bus
may enter the city in the le -bottom junction with a
North seeing face (direction of the bus). You can move to
any of the intersections with a proper control string. Eg
"LLMMR" L, R, M representes that the bus has to be
turned to its le , right and then has to move one step
forward and reach the next intersection. How will you
design this scenario? What classes are needed? What
member variables and functions are needed?

Question 12.�Java has an inbuilt hashmap class. It


usually takes object id as a reference to hash the key
values. Instead how could you make it take the state of (http://www.interviewbay.com
the object (if both the objects have same set of values /index.php?affiliate=15)
for all the member variables, they are in the same state)
to hash the key?

hashmap.hash(new foo(), "xyz");


hashmap.hash(new foo(), "xyz");
Both of them should hash into the same. How will you
do that?

Question 13.�There is a binary tree of size N. All nodes


are numbered between 1-N(inclusive). There is a N*N
integer matrix Arr[N][N], all elements are initialized to
zero. So for all the nodes A and B, put Arr[A][B] = 1 if A is
an ancestor of B (NOT�just the immediate ancestor).

Question 14.�There is a N*N integer matrix Arr[N][N].


From the row r and column c, we can go to any of the
following three indices:

I.����������������Arr[ r+1 ][ c-1 ]


(valid only if c-1>=0)
II.���������������Arr[ r+1 ][ c ]

3 of 5 14-06-2015 18:47
Amazon Interview Questions - TopTalent.in https://www.toptalent.in/blog/2013/09/21/amazon-interview-questions/

III.��������������Arr[ r+1 ][ c+1 ]


(valid only if c+1<=N-1)
So if we start at any column index on row 0, what is the
largest sum of any of the paths till row N-1.

Question 15.�Two robots land with their parachutes


on an infinite one-dimensional number line. They both
release their parachutes as soon as they land and start
moving. They are allowed only to make use of the
following functions.

I.�� moveLe () // robot moves to le by 1 unit in 1


unit time
II.� moveRight() // robot moves to right by 1 unit in 1
unit time
III. noOperation() // robot does not move and takes 1
unit time
IV.��onTopOfParachute() // returns true if the robot is
standing on top of either of the parachute, else false
V.���didWeMeet() // returns true if the robot meets
to the other robot, else false

Write a function in order to make the robots meet each


other. Robots will be executing the same copy of this
function.

Question 16.�Given a linked list containing character


in each node, segregate its nodes in such a way that all
nodes containing a vowel are moved to the end of the
linked list. We will have to maintain�the order.

Question �17.�You are given a linked list and a


parameter...Read more → (/jobseeker-
login.php?redirectURL=aHR0cHM6Ly93d3cudG9wdGFsZW50LmluL2Jsb2cvMj

Like 0 Share 13 Tweet 0

Facebook social plugin

4 of 5 14-06-2015 18:47
Amazon Interview Questions - TopTalent.in https://www.toptalent.in/blog/2013/09/21/amazon-interview-questions/

TOPTALENT About Us
An exclusive pre-screened job site for top tier Team (/team.php)
professionals. We provide a platform for jobseekers Blog (http://www.toptalent.in/blog/)
to apply for jobs in IT, Engineering, Finance, Brand Ambassadors (/add_ambassadors.php)
Consulting, Sales, Marketing, HR, Education, Media, Careers (/careers/341/toptalent-in)
Legal etc. Contact Us (/contact-us.php)

Products
Post Jobs (/employers)
Database Access (/employers)
TopTalent Social (/employers)
Jobseeker Premium (/premium-membership.php)

Additionals
Terms (/faq.php?id=60)
FAQs (/faq.php?id=67)
Privacy (/privacy.php?id=47)
Site Map (/site_map.php)

(http://www.facebook.com/toptalent.in) (http://twitter.com/#!/toptalentindia)

(http://www.linkedin.com/groups?gid=3224387) (/affiliate_mgmt/affiliate_signup.php)

© Copyright 2015 TopTalent.in

5 of 5 14-06-2015 18:47

You might also like