Amazon Interview Report
- 0of 0 votes
AnswersSuppose 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, left, right and down. Diagonal movement is not allowed.
- anom May 28, 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| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java - 1of 1 vote
AnswersImplement a function that returns the i-th most popular item sold
- anom May 28, 2015 in United States
at xyz company. You cannot rely on any libraries.
Class Item {
String itemId;
int quantitySold;
}
/**
find the i-th most popular item in the list
**/
String find(List<Item> items, int i) {
// your code goes here
}| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Java