Amazon Interview Questions
- 0of 0 votes
AnswerWrite test cases for an analog watch
- testsync012345 October 23, 2015 in United States for Kindle| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 4of 4 votes
AnswersGiven a linkedlist, write an algorithm to divide the linkedlist into two linkedlists, the first contains the Fibonacci numbers in the list and the second contains the non-Fibonacci numbers.
- a.ahmed.shalabey October 23, 2015 in United States for Software Development
Test the algorithm after developing the code| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm C Data Structures - 1of 1 vote
AnswersInput argument of a method is a list of char array. The method have to print all the possible combination of input char(s)...For example if the input argument has ['A','B','C','D'] the output should be A,B,C,AB,AC,AD,BC,BD,CD,ABC,ACD,BCD,ABCD
- kumar October 19, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 0of 0 votes
AnswersGiven a list of sorted arrays, like List<int[]>. Prepare and return a single sorted list.
- teli.vaibhav October 11, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersAn employee class has id, name and a vector of employees who reports him. Given two employees find the common manager of them.CEO pointer is provided.
- rsl October 10, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 0of 0 votes
AnswersGiven two Binary Trees (not BST). Each node of both trees has an integer value. Validate whether both trees have the same integers, there could be repetitive integers.
- teli.vaibhav October 02, 2015 in United States
ex-
Tree1:
5
1 6
5 4 3 6
Tree2:
1
3 4
6 5
have identical integers.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersGiven a string which may contain parenthesis. We must verify the validity of the string.
- teli.vaibhav October 02, 2015 in United States
ex-
1) "<ad675+-fkmfd>" is a valid string
2) "<[((kskfhdbh7)" is invalid
3) "[<<((shfs8))>>]" is valid
Extension to the question -
Suppose you had a hash table that told you how a parenthesis starts and how it ends as a key value pair, how would you then validate the string.
ex - <key,value> = < '(' , ')' > indicates '(' is a start parenthesis and ')' should be the end of that paranthesis.
<'A','&'> indicates that 'A' is a start parenthesis and '&' is the end parenthesis.
Note: Validity means a parenthesis that starts, must end.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 2of 2 votes
AnswersFind the largest substring palindrome in a given string.
- revanthpobala October 01, 2015 in United States
ex: input: abbac output: abba
Solution: Use Hashmap| Report Duplicate | Flag | PURGE
Amazon SDET Algorithm - 0of 0 votes
AnswersGiven a grid of m*n size. Each block in grid has some amount of gold.
- neer.1304 September 22, 2015 in United States
We start from first column of the grid(any row) and we can move in 3 direction - right, right-up and right-down.
What is the maximum amount of gold we can collect from the grid.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersPrint first and last node of all the levels of a tree.
- neer.1304 September 19, 2015 in United States
Ex if tree is -
root->data = 1
root->left->data = 2
root->right->data = 3
root->left->right->data = 4
root->right->right->data = 6
root->right->left->data = 5
root->right->left->left->data = 7
root->right->left->left->right->data = 8
Output - 1 2 3 4 6 7 8| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersThe truck monitoring app is installed on the truck driver's phone. This app sends the
- Ghost September 18, 2015 in India
location info back to the truck supervising application. there is a supervisor who monitors
the route, drop off locations and time for the trucks from the head office to make sure the
SLA's with the vendors(time, location, goods sign off) are honored. List the test cases and
certify this application| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Application / UI Design - 1of 1 vote
Answers3. Implement a function that returns the i-th most popular item sold at Amazon. You cannot rely on any libraries.
- laurentr September 18, 2015 in United States
class Item {
String itemId;
int quantitySold;
}
/**
* Find the ith most popular item in the list.
*/
String find(List<Item> items, int i) {
// your code goes here
}| Report Duplicate | Flag | PURGE
Amazon Software Developer - 1of 1 vote
Answers2. Suppose you are given a puzzle that is represented as a matrix with 0s and 1s, where a 0 indicates you’re allowed to move into that position and 1 means you’re not allowed to move in that position. Write a function that given a start position and an end position, returns a boolean value indicating if there exists a path from start to end. You are only allowed to move up, down, right or left. Diagonal movement is not allowed.
- laurentr September 18, 2015 in United States
Example #1
Input
0 0 1 0 1
0 0 0 0 0
0 1 1 1 1
0 1 1 0 0
start: 4,1
end: 0,3
Output
true
Example #2
Input
0 0 1 1 1
0 1 0 0 0
1 1 1 1 1
0 0 0 0 1
start: 0,0
end: 1,2
Output
false
Example #3
Input
0 0 1 1 1
0 1 0 0 0
0 1 1 1 1
start: 0,0
end: 2,1
Output
False
class Position {
final int x, y;
public Position(final int x, final int y) {
this.x = x;
this.y = y;
}
}
boolean pathExists(int[][] puzzle, Position start, Position end) {
// your code goes here
}| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
Answers1. Write a function that removes the duplicate of a collection of numbers and returns the number of elements remaining in the collection after the duplicates have been removed. You must ensure that duplicates are actually removed from the list.
- laurentr September 18, 2015 in United States
Example #1
Input
{1, 1, 5, 3, 8, 3, 7, 32, 32}
Output
6
Example #2
Input
{21, 10, 24, 2, 21}
Output
4
int removeDuplicates(List numbers) {
// your code goes here
}| Report Duplicate | Flag | PURGE
Amazon Software Developer - 4of 4 votes
AnswersGiven three arrays A,B,C containing unsorted numbers. Find three numbers a, b, c from each of array A, B, C such that |a-b|+|b-c| +|c-a| is minimum.
- Rahul Sharma September 16, 2015 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
AnswersGiven a 2D matrix which contains 0’s and 1’s. Given two points of matrix whose value is 1. Find the path(with only 1’s) between the given points
- neer.1304 September 16, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswerThere is a graph which represent average number of days the defects spent in status over a
- sivakreddyc September 14, 2015 in India
duration of time say in progress, ready for Qa etc. For example the X asis of the graph
will project the daily/weekly/monthly duration and the y axis would be the count of days.
List the test condtions to test and certify this graph| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersA registration form, to get user details has phone number field. This field is javaScript
- sivakreddyc September 14, 2015 in India
validated to get only numbers as input. But internally in the database they are stored as
text. Do think there is an issue ? High/Medium/Low ? Justify| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersThe client sends a string to server and the server respnds with the same string appended
- sivakreddyc September 14, 2015 in India
with date and time. List down the tests| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersKth largest element
- sivakreddyc September 14, 2015 in India
Consider that there are 2 lists that contain numeric values S1 and S2. the developer has
written a program to find the kth largest element in the merge of two sorted sequences S1
and S2. The developer has written a program implementing the same. List down the test
conditions to test and certify| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswerThe truck monitoring app is installed on the truck driver's phone. This app sends the
- sivakreddyc September 14, 2015 in India
location info back to the truck supervising application. there is a supervisor who monitors
the route, drop off locations and time for the trucks from the head office to make sure the
SLA's with the vendors(time, location, goods sign off) are honored. List the test cases and
certify this application| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 2of 2 votes
AnswersGiven an array of strings with only lowercase letters , create a function that returns an array of those same strings, but each string has its letters rearranged such that it becomes a palindrome (if possible, if not, return -1)
- makingworldcode September 13, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Java Developer Java - -1of 1 vote
AnswersConnect nodes at same level of a binary tree recursively using O(1) space (we can ignore stack space used for recursion)
Tree node is like following.struct node { int data; struct node* left; struct node* right; struct node* nextRight; }
Initially, all the nextRight pointers point to garbage values. Your function should set these pointers to point next right for each node. You can use only constant extra space.
- neer.1304 September 12, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 2of 2 votes
AnswersIn a string detect the smallest window length with highest number of distinct characters. For eg.
- neer.1304 September 12, 2015 in United States
A = “aabcbcdbca”, then ans would be 4 as of “dbca”| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswersHow would you implement X-ray for Kindle? X-ray is an index of characters in a book that shows how often a character appears in the book, and at which places. I was explained how this index works, and what it will look like on the book. There re more details here: http://www.amazon.com/gp/help/customer/display.html?nodeId=200729910
- ravishchawla September 10, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 2of 2 votes
AnswersGiven two strings, return true if they are one edit away from each other, else return false. An edit is insert/replace/delete a character.
- codewarrior September 07, 2015 in United States
Ex. {"abc","ab"}->true, {"abc","adc"}->true, {"abc","cab"}->false| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersGiven a linked list and a positive integer n, reverse the order of nodes in between n and last but n nodes.
- codewarrior September 05, 2015 in United States
example: 1->2->3->4->5, n=2. Output is 1->4->3->2->5| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersGiven a postfix expression as a string, evaluate it and return the result. example : "423+*" ->20. The Postfix expression is well formed(need not check for bad expression)
- codewarrior September 05, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersFind the total number of connected components in a graph (there can be forests)
- codewarrior September 05, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersGiven a 2-dimensional square matrix, rotate the matrix clockwise. Imagine concentric circles. Input from stdin: first line is length, subsequent lines are rows of the matrix. Output the matrix to stdout. This was one of the questions. You have 2 hrs to complete it.
- Yev September 02, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer Java