Amazon Interview Questions
- 15of 15 votes
AnswersImplement a stack that in addition to push and pop has a function that returns the min value of the stack.
- theProgrammer April 10, 2017 in United States for Alexa
I came up with a O(logn) solution, but he wanted a O(1) for the whole algorithm.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 2of 2 votes
AnswersGiven a sorted array with "n" elements, distributed them into "k" nearly equally weighing buckets.
- reddy88 April 02, 2017 in United States
Space is not constraint.
Ex: [1,3,6,9,10]
bucket size: 3
output:[10],[9,1],[3,6]| Report Duplicate | Flag | PURGE
Amazon SDE-2 Dynamic Programming - 3of 3 votes
AnswersDesign backend system for bookMyShow.com like system which supports below use cases:
- Priyanka March 29, 2017 in India
1) When user selects cities, list of cities is displayed.
2) When user selects city, movie list is displayed.
3) When user selects movie, list of theatre is displayed.
4) When user selects theatre, show timing is displayed.
5) When show timing is selected, user is asked for no of seats that he wants to book
6) When user selects no of seats, seats are displayed to choose from.
7) When user selects seats, then total price is displayed.
8) When total price is selected, then user is directed to payment gateway and payment is done and on payment success, ticket is mailed to him.
More questions on how can we scale the system, and handle concurrent users request for same seat etc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - 2of 2 votes
AnswerDesign a movie ticket booking system like bookmyshow.com
- neer.1304 March 29, 2017 in United States
Follow-up question -
1) How do you handle issues like scalability, concurrency, fault-tolerance etc.
2) Show movie theaters near to user where movie is playing and seats are available
3) Design database. What kind of DB would you use SQL or No-SQL
4) In real time how would you show which seats are booked which are free
5) If theaters do not have any api for fetching information then what can we do about it.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 1of 1 vote
AnswersDesign Uber. Low level Design needed (OOPS based - classes, relations, message flow etc.)
- neer.1304 March 28, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswerDesign Cricinfo website
- neer.1304 March 28, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersDesign snake n ladder game to be played online
- neer.1304 March 28, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersThis is a system design question. Design a Event booking system. Imagine that event registry etc is all implemented. A user can log in, check the available events and then books it. Design a system for event booking
- milindarjunparab March 27, 2017 in Canada| Report Duplicate | Flag | PURGE
Amazon Software Development Manager - -1of 1 vote
AnswersFind K which decides the number of open brackets are equal to the number of closed brackets.
- AlgoBaba March 21, 2017 in United States
input : (())
output : 2
Reason : if we divide the string at 2nd position, we get two open brackets and two closing brackets, and they are same .
input : (())))(
output : 4
Reason : if we divide the string(not necessarily equally) at 4rth position, we have (()) on the left side and on the right side we have ))( , as you can see, on the left half, we have two opening brackets and on the right half we have two closing brackets and they are equal .
input : ))
output : 2
Reason : there is no open brackets , so if we divide taking the whole string's length, we have )) on the left half and nothing on the right half. Now you can see that on the left half there is no open brackets and on the right half there is no closed brackets.
This question should be clear by now and remember you have to find out that K .| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - -5of 5 votes
AnswersFill the arrray with elements from 0 to 9.
- algoLearner March 21, 2017 in India
based on thier frequency.
a[1]=3 means, 1 is repeated for 3 times(1 must present 3 times in that array)
a[2]=4 means 2 is repeated for 4 times.(2 must present twice in that array)| Report Duplicate | Flag | PURGE
Amazon Developer Program Engineer Arrays - 0of 0 votes
AnswersFind the Maximum number of distinct nodes in a binary tree path
- AlgoBaba March 20, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersWrite test cases to test a browser App
- SPS March 14, 2017 in India| Report Duplicate | Flag | PURGE
Amazon Testing / Quality Assurance test - 1of 1 vote
AnswersA = "ffgggtvshjsdhjfffffffhvjbjcharu"
- SPS March 14, 2017 in India
Find the max consecutive repitative chracter
Output : f -> 7| Report Duplicate | Flag | PURGE
Amazon Testing / Quality Assurance Online Test - 0of 0 votes
AnswersA = {1,2,4,-6,5,7,9,....}
- SPS March 14, 2017 in India
B = {3, 6, 3, 4, 0 .......}
n = 5 -> pairs whose sum is n
Output = (1,4), (5,0)....| Report Duplicate | Flag | PURGE
Amazon Testing / Quality Assurance Online Test - 0of 0 votes
Answersfind the given Binary tree is mirrored tree or not
- Jagadeesh March 12, 2017 in India for Kindle
should be like
60
/ \
30 30
/ \ / \
20 50 50 20| Report Duplicate | Flag | PURGE
Amazon SDE-2 Trees and Graphs - 0of 0 votes
AnswersGiven a BST (Binary Search Tree) , Each node value should replace with sum of the node which are greater-than the given node.
- Jagadeesh March 12, 2017 in India for Kindle
conditions :
No Extra space / variable can use
Modify the existing tree in optimal way.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Trees and Graphs - 0of 0 votes
AnswersDesign a system having multiple jobs, interacting with each other such that :
- neer.1304 March 10, 2017 in United States
1) A job can run for very long periods (1-2 days)
2) A node can fail/crash on which certain job is running
system should be scalable
3) Amount of data getting transferred is huge
4) Data in the system is very sensitive and needs security
job/s can fail| Report Duplicate | Flag | PURGE
Amazon SDE-3 Software Design - 0of 0 votes
AnswersTop View of a Binary Tree in constant space
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven a pattern containing only Is and Ds. I for increasing and D for decreasing. Devise an algorithm to print the MINIMUM number following that pattern. Digits from 1-9 and digits can’t repeat.
- neer.1304 March 10, 2017 in United States
Example:
1. Input: D Output: 21
2. Input: I Output: 12
3. Input: DD Output: 321
4. Input: II Output: 123
5. Input: DIDI Output: 21435
6. Input: IIDDD Output: 126543
7. Input: DDIDDIID Output: 321654798| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersImplement ConcurrentHashMap class in Java
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersImplement LinkedHashMap class in Java
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersYou have been given a grid with some doors, walls and some empty spaces.
- neer.1304 March 10, 2017 in United States
1st part : You have to tell the least no of moves to go from random position in the grid to the nearest door. You can move in four directions only, i.e, left, right, above, below.
2nd part : Least distance of every empty cell to the nearest door. Lots of discussion was done on both the parts of the problem.| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersDesign garbage collector in Java
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Software Design - 0of 0 votes
AnswersMaximum triangle path Sum : Starting from the top of a pyramid of numbers like below, you can walk down going one step on the right or on the left, until you reach the bottom row:
- neer.1304 March 10, 2017 in United States
55
94 48
95 30 96
77 71 26 67
One of such walks is 55 -> 94 >- 30 -> 26. You can compute the total of the numbers you have seen in such walk, in this case it’s 205.
Your problem is to find the maximum total among all possible paths from the top to the bottom row of the triangle. In the little example above it’s 321.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersDesign a online shipment tracking system.
- neer.1304 March 10, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - -1of 1 vote
AnswersDesign a system to upload images and tag them. Ability to search images with single and multiple tags.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 1of 1 vote
AnswersGiven a very large binary number which cannot be stored in a variable, determine the remainder of the decimal equivalent of the binary number when divided by 3. Generalize to find the remainder for any number k.
- neer.1304 March 09, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven a file having many lines of text(words) and given a dictionary having an API function boolean isValid(String word), which will return true is a word passed to this function is valid word in dic.,and will return false if given passed argument is not a valid word in dic.
- neer.1304 March 09, 2017 in United States
Now read the file and check if each word as well as all possible words from its L to R and R to L combinations, are valid words in dic. or not.| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm