Amazon Interview Questions
- 0of 0 votes
AnswerDesign a key-value store
- tested.candidate July 13, 2015 in UK| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer System Design - 2of 2 votes
AnswersGiven N meetings with their start time s1, s2 ….sn and end time e1, e2 ….enand K rooms. How to schedule maximum of N meetings in k rooms.
- rahulkumar5july July 08, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon - -1of 1 vote
AnswersDave's Father wants to make chocolates for his birthday. The volume of every chocolate will be 2 cm3. Every chocolate will be cuboid in shape. He has a box of a*b*c dimensions (again a cuboid). Given an input a,b,c write a function to find out if x number of chocolates of 2cm3 volume can fill the box completely. If so, find the number of chocolates too (x).
- arpit.gautam July 08, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Math & Computation - 2of 2 votes
AnswersHow will you serialize the binary tree ?
- algeek July 08, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersCreate an employee database structure in which Employee has id, name, manager. Three functionalities required were
- rahulkumar5july July 07, 2015 in United States
a) Given any id return all the employee details
b) Given any name(or id) list all the subordinates of the given employee.
c) Given a name search with prefix search property
We can use trie,make trie with names of employee,and store information of employee when name finish in trie,with this make a hashmap that hash id as key and name as value.
1st and 3rd condition is satisfied,but how to do 2nd ?
Any other approach that we can do?
only approach,no need of code.| Report Duplicate | Flag | PURGE
Amazon - 0of 0 votes
AnswerYou are planning a big programming conference and have received many proposals which have passed the initial screen process but you're having trouble fitting them into the time constraints of the day -- there are so many possibilities! So you write a program to do it for you.
- Rahul July 07, 2015 in India
The conference has multiple tracks each of which has a morning and afternoon session.
Each session contains multiple talks.
Morning sessions begin at 9am and must finish by 12 noon, for lunch.
Afternoon sessions begin at 1pm and must finish in time for the networking event.
The networking event can start no earlier than 4:00 and no later than 5:00.
No talk title has numbers in it.
All talk lengths are either in minutes (not hours) or lightning (5 minutes).
Presenters will be very punctual; there needs to be no gap between sessions.
Note that depending on how you choose to complete this problem, your solution may give a different ordering or combination of talks into tracks. This is acceptable; you don’t need to exactly duplicate the sample output given here.
Test input:
Writing Fast Tests Against Enterprise Rails 60min
Overdoing it in Python 45min
Lua for the Masses 30min
Ruby Errors from Mismatched Gem Versions 45min
Common Ruby Errors 45min
Rails for Python Developers lightning
Communicating Over Distance 60min
Accounting-Driven Development 45min
Woah 30min
Sit Down and Write 30min
Pair Programming vs Noise 45min
Rails Magic 60min
Ruby on Rails: Why We Should Move On 60min
Clojure Ate Scala (on my project) 45min
Programming in the Boondocks of Seattle 30min
Ruby vs. Clojure for Back-End Development 30min
Ruby on Rails Legacy App Maintenance 60min
A World Without HackerNews 30min
User Interface CSS in Rails Apps 30min
Test output:
Track 1:
09:00AM Writing Fast Tests Against Enterprise Rails 60min
10:00AM Overdoing it in Python 45min
10:45AM Lua for the Masses 30min
11:15AM Ruby Errors from Mismatched Gem Versions 45min
12:00PM Lunch
01:00PM Ruby on Rails: Why We Should Move On 60min
02:00PM Common Ruby Errors 45min
02:45PM Pair Programming vs Noise 45min
03:30PM Programming in the Boondocks of Seattle 30min
04:00PM Ruby vs. Clojure for Back-End Development 30min
04:30PM User Interface CSS in Rails Apps 30min
05:00PM Networking Event
Track 2:
09:00AM Communicating Over Distance 60min
10:00AM Rails Magic 60min
11:00AM Woah 30min
11:30AM Sit Down and Write 30min
12:00PM Lunch
01:00PM Accounting-Driven Development 45min
01:45PM Clojure Ate Scala (on my project) 45min
02:30PM A World Without HackerNews 30min
03:00PM Ruby on Rails Legacy App Maintenance 60min
04:00PM Rails for Python Developers lightning
05:00PM Networking Event| Report Duplicate | Flag | PURGE
Amazon SDE-2 Problem Solving - 1of 1 vote
AnswersGiven a binary tree (not search tree), find the path which adds up to given sum.
- emptycup July 06, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersGiven a array of numbers, find all the numbers which add up to given sum.
- emptycup July 06, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersThere are buses taking various routes and each route has some stops. Given a matrix of stops and distances (distance between two stops for connected stops), find all cluster of stops of any size with all stops in a cluster fully connected and are at a distance not greater than D.
- emptycup July 06, 2015 in India
Assume that the routes are bi-directional.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm Dynamic Programming - 0of 0 votes
AnswersOn a screen, there are multiple rectangles drawn, when a user clicks on any point, find the smallest rectangle enclosing this point.
- ritwik_pandey July 05, 2015 in India
I could not come up with a solution. The end points of rectangles were given and also the the point where the mouse was kept was given.| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 1of 1 vote
AnswersSort a matrix such that rows in ascending order and columns should be in descending order.
- ritwik_pandey July 05, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 C++ - 0of 0 votes
AnswersNot sure what topic this falls under.
- moriarty.rj June 30, 2015 in United States
"Improve metrics on the system."
Intentionally vague requirement to see how I ask questions. In my case, it ended up being a discussion about making database queries faster.| Report Duplicate | Flag | PURGE
Amazon Software Developer Database Ideas Problem Solving System Design - 0of 0 votes
AnswersGiven a string such as "123", convert it to an integer. Basically, write Integer.parseInt(string).
- moriarty.rj June 30, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 0of 0 votes
AnswersGiven a CSV of names and ages, perhaps:
- moriarty.rj June 30, 2015 in United States
Alice, 30
Bob, 17
Clyde, 49
Sort the names by age.| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 0of 0 votes
AnswerDesign an object oriented console application named universe that reads in a file containing the schema of a two
- AnonD June 24, 2015 in United States
dimensional (2D) universe and outputs certain information about the universe.
A 2D universe is a simplified universe that contains galaxies, stars, and planets, all of which are located on a flat plane
specified using 2-coordinates (x-axis and y-axis).
There is only one universe and it contains one or more galaxies.
A galaxy may contain one or more stars located in it.
A star may contain zero or more planets located near it in the same galaxy.
A planet may belong to one or two stars located near it in the same galaxy (Planet E465D in the sample file below is an example).
In order to allow the objects to support more descriptive attributes and functionality in future revisions of the
application, all the object types described above should be represented using separate classes. Parent-Child relationships should also be represented using links between the various object instances.
The program will run with three arguments specified: the input-file, and the name of two objects of any type, A and B.
Example command-line: universe text.txt Alpha_Dra E465D
Based on the command line arguments specified, the program will compute and display:
1. The parents location for both object A and B. (If needed, assume the coordinate of the universe is 0,0)
2. The minimum distance between object A (Alpha_Dra) and B (E465D). This is the distance between the two objects
given locations.
3. Any of the two closest stars in the entire universe.
4. The farthest object from A, that is of the same type as A; and the farthest object from B, that is of the same type as
B. (if one exists)
The input file contains new-line separated lines each describing one object using the format:
Type|Unique-Name|X-Coordinate|Y-Coordinate|Parent’s-Name|
Example test.txt input file:
Galaxy|Draco|75434.2|89151.4|Universe|
Star|Beta_And|23315.83|-2234.73|Andromeda|
Star|Alpha_Dra|75243.25|84123|Draco|
Galaxy|Andromeda|2967.78|-2357.2|Universe|
Planet|P165EU|75242.42|84121.2|Alpha_Dra|
Star|Alpha_And|26413.83|-2727.73|Andromeda|
Planet|E465D|26412.4|-2726.51|Alpha_And|
Planet|E465D|26412.4|-2726.51|Beta_And|
Notes:
The Universe object that serves as a parent to the galaxies is implicit, and will not be explicitly defined in the input
file.
The input lines may occur in any order
The file may contain millions of lines.
Example output of running: universe test.txt Alpha_Dra E465D
Parent of Alpha_Dra is located at: 75434.2,89151.4
Parent of E465D is located at: 26413.83,-2727.73
Distance between Alpha_Dra and E465D: 99635.8
Closest two stars in the universe are: Alpha_And and Beta_And| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 3of 3 votes
AnswersPrint the level of friendship.
- AnonD June 24, 2015 in United States
Given a person and list of his friends, print all his friends by level of association.
The text file will be like one below
A: B,C,D
D: B,E,F
E: C,F,G
If the input is A, the out put should be:
Level 1 - B,C,D
Level 2 - E,F
Level 3 - G| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 2of 2 votes
AnswersAsked like 8 different behavioral questions that were supposed to exemplify Amazon values. I was unprepared for this, as many people say Amazon doesn't do this.
- steez June 22, 2015 in United States for android amazon app, social shopping
For example, I was asked "Tell me about a time when you solved a complex problem with a simple solution", "Tell me about a time when you increased efficiency", "Tell me about a time when you made a judgement call to take an unknown risk", "Tell me about a time when you disagreed with your team about something and how you reconciled it"| Report Duplicate | Flag | PURGE
Amazon SDE-2 General Questions and Comments - 0of 0 votes
AnswersFind all paths in binary tree that add up to a given sum.
Given a tree like this:2 3 5 4 8 6 -2 2
return {3,4}, {2,5}, {2, 5, -2, 2}
- steez June 22, 2015 in United States for android amazon app, social shopping| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures - 0of 0 votes
AnswerDesign the "what other people bought feature." This was focused on database design/creating an api to lie on top of it, and he asked questions to see if I understood how dbs actually work(like what does group by do). I was given an example table with the schema of like
- steez June 22, 2015 in United States for android amazon app, social shopping
itemID, purchaseDate, customerID
He asked big O complexity of sql query as well.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign Amazon Questions and Answers. This question was to see how I code, and how I would modularize things. He wanted me to code every single thing as realistically as possible on a whiteboard.
- steez June 22, 2015 in United States for android amazon app, social shopping| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign a push notification system for android. Assume that we have 1 million users this year, but next year we will have 15 million. Assume that Google can handle infinite notifications per second.
- steez June 22, 2015 in United States for android amazon app, social shopping
I would love to see this answered, as I did not answer it well.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
Answersfind sum of longest increasing subsequence ?
- rahulkumar5july June 18, 2015 in India
Not the maximum sum,sum of longest subsequence.
Eg. 1, 8,2, 3
ans-> 6| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersGiven a N-ary Tree. Return true if it follows Sum Property otherwise false.
- chaturvediprerna03 June 17, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 2of 2 votes
AnswersGiven a sorted array with only 0's and 1's.Count the number of 0's.
- steelrahul June 16, 2015 in India for Hyderabad
e.g: 0 0 0 0 1 1
Ans: 4.| Report Duplicate | Flag | PURGE
Amazon SDE1 - 2of 2 votes
AnswersGiven n (of size m) Linked lists
- steelrahul June 16, 2015 in India for Hyderabad
Print all set(head of linked list) of link list that intersect with each other.
e.g.
1-->2-->3-->4-->5
6-->7-->8-->4-->5
8->9->10->11->12
13->14->15->12
16->17->18
1 6
8 13
16| Report Duplicate | Flag | PURGE
Amazon SDE1 - 2of 2 votes
AnswersAn array consist of elements whose difference is positive or negative 1. I have to find the given elements without using linear search.
- thilaksmile June 15, 2015 in India
Say
Int arr[]={1,2,3,4,3,4,5,6,7
To find : 6
.
Please provide some one code/algorithm for this problem.| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 18of 18 votes
AnswersDesign an Email sender, need to send 100,000000 emails and you have 5 machines how could you do it efficiently.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswerGiven an URL you need to analyze all the images( they may be in 1000’s of number) and return the cumulative quality of images present in that url.
- shaileshagarwal1 June 15, 2015 in India for Transportation Team
lets say: you can configure image quality as very good, good, average, poor..etc, so you have to return one value among them.The given URL may contain several other URLs and they also contain lot of images . you need to consider all of them. lot of questions like how to avoid visiting same url again,
how would you determine the quality of an image if you encounter an url that contains only an image..etc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design