Amazon Interview Questions
- 2of 2 votes
AnswersGiven MxN matrix which contains 1s and 0s, find the largest sub matrix which contains most number of 1s. condition is that each row in the sub matrix must contain at-least one 1.
- Nascent May 04, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - -5of 7 votes
AnswersFlood fill algorithm. He also asked me what else I would do before checking the code to repository?
- snigda.2000 May 03, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 4of 4 votes
Answersgive an algorithm for finding duplicate parenthesis in a expression.
example :
- rahul May 02, 2014 in United States(( a + b ) + (( c + d )))
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Stacks - 1of 1 vote
Answersgive an algorithm for finding duplicate parenthesis in a expression.
- rahul May 02, 2014 in United States
{{ (( a + b ) * (( c + d ))) }}| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Stacks - 1of 1 vote
AnswersFor a given binary search tree, replace each node with sum of all node which are greater then of equal to current node.
- Razz May 02, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Data Structures - 0of 0 votes
Answerswrite a program to generate random numbers without using the in-built functions?
- vrajendra.singh.mandloi May 02, 2014 in india| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersHe asked me to print root to leaf path WITHOUT using recursion . I got stuck at it and used too much space according to him .
- !@# May 02, 2014 in India
I constructed a visited array , path array and a stack .
Is there any other optimal algorithm ?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Trees and Graphs - 1of 1 vote
Answersa[] is an array containing elements of a BST .
- rahul May 02, 2014 in India
2D array is given where arr[i][j] gives the root of the tree formed by taking elements from index i to j from a[] . construct the BST .| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm Trees and Graphs - 0of 4 votes
AnswersGiven a balanced BST, how would you return the nth smallest element in logn time .
- !@# May 01, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersWrite a test plan for vending machine
- kancharlaratna April 29, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 5of 5 votes
Answerswrite a program to give an array such that:
- doctorking5891 April 29, 2014 in United States
1. the data value is from 1 to n
2. the length of it is 2*n
3. the two elements with same value keep the same number distance.
for example, when n = 3, the length of array is 6, the array should be like: 2, 3, 1, 2, 1, 3. there are two elements between "2" pair, and three elements between "3" pair and one element between "1" pair| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersThe question was:
- puneet.sohi April 28, 2014 in United States for AWS
What are general guidelines you follow while creating new classes in C++
My answer:
1. Keep variables pvt (use setter and getter methods)
2. Use reference counting to do mem management, he asked me to use shared_ptr within the class| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Object Oriented Design - 2of 2 votes
AnswersI have two arrays A and B(each containing 8 bit integers). Find the common elements between them.
- puneet.sohi April 28, 2014 in United States for AWS
The questions started out as a general discussion with the most inefficient method. Then the interviewer asked me to improve the solution (to give a NlogN and finally a linear time solution)| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 2 votes
AnswersGiven a circular linked list with each node either r,g,y or b. number of nodes of each color are same. Arrange the nodes in a specified order. Eg. if list is like "rrrgggyyybbb" and order is "rgyb" then after rearrangement it should be "rgybrgybrgybrgyb". Just a bit more explanation...the question was given in form of students stading in a circular fashion and color denotes the club they are in. Hence adding new node or list is not possible.
- Nitin April 28, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersFor a given array with positive and negative element, find sub array with maximum sum. Sub array must have same sequence of element as that of parental array.
- Razz April 26, 2014 in India
Eg: P = {4,6,-3,1,5,9,-2} then S ={4,6,-3,1,5,9} //Correct output.| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswersGiven 2 sorted lists that are of even and equal size, output the median. If there is no middle number, return the average of the 2 middle numbers
- valheru April 23, 2014 in United States| Report Duplicate | Flag | PURGE
Big Fish iOS Developer Sorting Amazon SDE-2 Algorithm - 1of 1 vote
AnswersWrite test cases for a software which accepts inputs as dd/mm/yyyy and gives output as 4 days after the input.
- Ajit April 22, 2014 in India for QAE
ex-input-07/01/2011..out put should be 11/01/2011.
give boundary values of each test cases..assume dd/mm/yyyy in correct format| Report Duplicate | Flag | PURGE
Amazon Testing / Quality Assurance - 2of 2 votes
Answersimplement division without using division operator in log(n) time.
- !@# April 22, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGive this input: Sea!tle is a nice place. Work Hard! have Fun, make HIStory!
- varsee10 April 21, 2014 in United States
display this output using any C or vb script:
Seattle is a nice place.
Work hard.
Have fun.
Make history.| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test - 1of 1 vote
AnswersDesign a web-site like Paypal.
- hulk April 21, 2014 in India
The interviewer was interested in the
i) Major components & the way they will interact.
ii) Various way of scaling the web-site to support many users
iii) Handling the failure cases like when the DB goes down, etc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - 1of 1 vote
AnswersYou are given a matrix where some pixels are white and some are black. Basically there are different disjoint images in the matrix.
- hulk April 20, 2014 in India
a) Expand/Shrink the images
b) Count the no of images
c) Color the images
d) Rotate the images| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Arrays - 1of 1 vote
AnswersDisconnect two nodes in a graph by removing minimum number of edges.
- hulk April 20, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Trees and Graphs - 1of 1 vote
AnswersGiven a matrix pattern containing only 'plus' & 'dots',search no of times that pattern is present in a very large file which has a very large matrix which contains 'plus' and 'dots'.
- hulk April 20, 2014 in India| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 2 votes
Answerdesign e commerce web site like amazon....
- Nascent April 20, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon - 1of 1 vote
Answersgiven data about students who had taken some subjects.
- Nascent April 20, 2014 in United States
I had to make a data structure such that if I query for no of students in a subject or no of subjects a student has taken, the complexity should be less.| Report Duplicate | Flag | PURGE
Amazon - 1of 1 vote
AnswersGiven an nxn screen, Each pixel is represented by intensity values. Given a specific pixel as an input, find the no. of pixels of the same colour which can reached from this pixel. Assume any suitable data structure for a screen.
- Nascent April 20, 2014 in United States| Report Duplicate | Flag | PURGE
Amazon