Amazon Interview Questions
- 1of 1 vote
AnswersYou have a BST and you need to assign an appropriate value to neighbor of all nodes (Explained in below example)
Node Structurenode { node leftChild, node rightChild, T data, node neighbor }
A
- avinash.setty December 12, 2015 in United States for Marketplace
/ \
B C
/ \ \
D E F
Based on above tree,
Node: Neighbor
A: NULL
B: C
D: E
E: F| Report Duplicate | Flag | PURGE
Amazon SDE-2 Trees and Graphs - 0of 0 votes
AnswersGiven an array of stock values of a company. Find out the time when a user would have bought the stock and sold the sock. Basically find the maximum positive difference of any two given elements in an array?
- avinash.setty December 12, 2015 in United States for Marketplace| Report Duplicate | Flag | PURGE
Amazon SDE-2 Arrays - 2of 2 votes
AnswersGiven a binary tree print it in inward spiral order i.e first print level 1, then level n, then level 2, then n-1 and so on.
- neer.1304 December 10, 2015 in United States
For Ex -
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15
Print- 1 15 14 13 12 11 10 9 8 2 3 7 6 5 4
Follow up question - Extend the algorithm to n-ary tree.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 2 votes
AnswersFind the highest time difference in the below log file Using single Unix command
- Srinivas December 04, 2015 in United States
STARTTIME:2015-12-01 04:13:15
ENDTIME :2015-12-01 04:14:16
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:11:15
ENDTIME :2015-12-01 04:11:17
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:12:15
ENDTIME :2015-12-01 04:15:15
----------------------------------------------
----------------------------------------------
STARTTIME:2015-12-01 04:10:10
ENDTIME :2015-12-01 04:10:11
----------------------------------------------
----------------------------------------------| Report Duplicate | Flag | PURGE
Amazon Development Support Engineer Unix - 3of 3 votes
AnswerDesign Uber or Lyft like architecture keeping scale, latency and availability in mind. The design can be at macro level first, that is, major components like persistent store (SQL/NoSQL/redundant), cache, communication/messaging. The design and if time permits, details will then be discussed/challenged.
- Blue Ocean November 29, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Principal Software Engineer Distributed Computing - 0of 0 votes
AnswersFace to Face
- siva.sai.2020 November 29, 2015 in United States
Q4) two arrays given to you. First array contains number s. Second array contains key values.
We need to find smallest window in first array which covers all second array elements.
e.g:
Input= {6,7,1,3,2,4,5,2,3,1,2,5}
Keys = {2,5,1}
answer: from 9th index to 11th index is the smallest window.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersFace to face
- siva.sai.2020 November 29, 2015 in India
Q3) stream of numbers coming, get 'n' min elements at any point of time| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersWritten test:
- siva.sai.2020 November 29, 2015 in India
Q2) in single linked list reverse alternative k nodes.
e.g. k=3 , 1->2->3->4->5->6->7->8->9->10
3->2->1->4->5->6->9->8->7->10
void reverseAlternativeKNodes(node *&head, int k);| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersWritten Test question:
- siva.sai.2020 November 29, 2015 in India
Q1) Given binary tree find largestPath size from one leaf to another leaf.
int getLargestPathSize(node *root);| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersWrite a method that takes in a positive integer, return the number of 2s between 0 and the input number.
- J@sper November 26, 2015 in United States
If the input value given is 13, it should return 2 as the number 2 and 12 are between 0 and 13.
If the input value given is 21, it should return 3 as the number 2,12 and 20 are between 0 and 21.| Report Duplicate | Flag | PURGE
Amazon Jr. Software Engineer Java - 1of 1 vote
AnswersDesign a restaurant reservation system - You need to design everything from scratch - Identify actors in the system, identify what all data should be stored in persistence storage (and why). How would you make your design scalable?
- Abhigyan Mehra November 25, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 1of 1 vote
AnswersDesign a data structure which could perform the following operations in O(1):
- Abhigyan Mehra November 25, 2015 in India
- Insert(), Delete(), Search(), getRandom()
getRandom() should pick a "random" element from your data structure, and should not be predictable (for instance always picking the "first" element from your DS)| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures - 0of 0 votes
AnswersGiven a very large array of sorted integers, find the number of times a particular integer has been repeated in the array. Required complexity : O(logN)
- Abhigyan Mehra November 25, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersAt regular interval, we are receiving data (Price,Quantity). We need to find Most Sold Price(MSP). Need to design the solution to print the current MSP with total Qty of that price, every time a set of price and its quantity sold is provided as input.
Time Price Qty MSP(Total Qty) 11:01AM $10.01 100 $10.01(100) 11:03AM $11.01 200 $11.01(200) 11:04AM $12.81 150 $11.01(200) 11:06AM $10.01 210 $10.01(310) 11:07AM $10.01 180 $10.01(490) 11:08AM $12.81 400 $12.81(550) 11:09AM $11.01 200 $12.81(550)
In the interview, I wrote a solution using priority queue where each element of the priority queue is a tuple consisting of price and quantity. The priority queue arranges itself based on the quantity value of each tuple. When new value comes we access the tuple having the particular price, retrieve its quantity. Delete this tuple and insert a new tuple with the same price and updated quantity.
- Edd November 24, 2015 in United States
The interviewer was not satisfied with the solution and commented this is not how a large scale application will be build which is running throughout the day.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 0of 0 votes
AnswersGiven 2D Array of only 0s and 1s, Find the row which gives max decimal value.
- Rajarathinam Antony November 22, 2015 in India
Input: int array[3][3] = {{0,1,0,}{1,1,0},{1,0,1}};
Output : 2(second row)...decimal value is 6| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersWrite a code to find out the median in an array of integers (array could have even number of elements or odd number of elements)
- Megha Maheshwari November 18, 2015 in United States
(To update some hint at the end from the interviewer : he would look for a binary tree and find out some way to balance the tree and than obtain the median)| Report Duplicate | Flag | PURGE
Amazon Algorithm - 0of 0 votes
AnswersGiven employee information in an organisation in the formal - emp_id,firstname,lastname,reports_to in the following way
- Megha Maheshwari November 18, 2015 in Singapore
{
string[] Values = new[] { "Mc Grill,Mc,Grill,Karmon","Karmon,Zech,Karmon,Joe","Mithun,Try,Mithun,Joe","Joe,Top,Joe,","Zara,Aman,Zara,Mc Grill","Fizzy,Dude,Fizzy,Mc Grill"};
}
Print the information from the top to bottom level in the way
1) Top Joe
2) Try Mithun
2) Zech Karmon
3) Mc Grill
4)Aman Zara
4) Dude Fizzy| Report Duplicate | Flag | PURGE
Amazon - 2of 2 votes
AnswerHow do we achieve (google news) personalization.
- sati November 05, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
Answershow to find all paths of a graph?
- KabhaD82 November 01, 2015 for RMCC
hi ,
i have a directed graph as an input and i want to find in that graph subGraphs that fit to some path
for example : i have the following graph 1[E] ->2[E] ->3[M]->4[E]->5[M]->6[M]->7[E]->8[M] .and i have the path E->M->E
then the program output should be the subGraph 2->3->4
note that the solution should be implemented as ADJ Matrix
the Graph is directed DAG
the program should be with C language| Report Duplicate | Flag | PURGE
Amazon Dev Lead C - -1of 3 votes
AnswersGiven a 1D array, implement function Sum(x1,x2) where x1 and x2 are indices of array. Find sum of all elements in between the given indices inclusive of them. Do in Time complexity of O(1)
- lol12345 October 27, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersGiven a system in which a musician is selling his CD's. User can enter how many CD"s he/she wants. Enter his/her address detail and click on next. The cost for the number of CD's, tax for the order, Shipping cost for the order and Total values are displayed. User enter the credit card / debit card details. Click on next. If the transaction successful/unsuccessful display the message accordingly. There is a bank web service which reads card information and a response is sent based on if it is a valid card or not. A database which stores all the information about user orders and their status. An admin portal which accesses the database to edit/update on user order status and user information. Test the complete system.
- testsync012345 October 23, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 1of 1 vote
AnswersTest Amazon Website
- testsync012345 October 23, 2015 in United States
Functionalities: Two categories with 100 products each, Buying a product, Customer information, Order tracking| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersExplain the complete automation design and What have you contributed in the automation framework
- testsync012345 October 23, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersHow do you test search functionality of Amazon. Include category based searches as well. What tests you will automate and what tests you will not automate
- testsync012345 October 23, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 1of 1 vote
AnswersGiven a string and two words which are present in the string, find the minimum distance between the words
- testsync012345 October 23, 2015 in United States
Eg: "the brown qucik frog quick the", "the" "quick" O/P -> 1
"the quick the brown quick brown the frog", "the" "the" O/P -> 2| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Algorithm - 1of 1 vote
AnswersHow to find if a given expression is a valid arithmetic expression?
- testsync012345 October 23, 2015 in United States
Eg:(())()) - Invalid expression, (()()) - Valid expression| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Data Structures - 0of 0 votes
AnswersFind the first and last occurrence of a number in a sorted array of integers
- testsync012345 October 23, 2015 in United States for Kindle
For Example: int[] a = {1,2,3,4,5,5,7,8}| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Algorithm - 0of 0 votes
AnswersThe Echo device light's up when a question is asked, but does not answer the question. Troubleshoot the scenario
- testsync012345 October 23, 2015 in United States for Kindle| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Trouble shooting