Amazon Interview Questions
- 0of 0 votes
AnswerOutput the second index corresponding to the first one, requiring output only if there is only one match, and false if there is more than one pair
- ajay.raj March 01, 2018 in United States
a b c d e f g a b -> [0,1]
a b b c, a b c -> False| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 0of 0 votes
AnswersCheck if characters of a given string can be swaped to form target string
- ajay.raj March 01, 2018 in United States
ab : ba true
ac : ab false| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 0of 0 votes
Answers1 \ 2 - 3 \ / 4 | 5 - 8 | / 7 For the undirected graph, the LCS is 2,3,4,5, so how can we find it? For a undirected graph, find the Longest Consecutive Sequence
/**
- ajay.raj March 01, 2018 in United States
* Definition for undirected graph.
* class UndirectedGraphNode {
* int label;
* List<UndirectedGraphNode> neighbors;
* UndirectedGraphNode(int x) { label = x; neighbors = new ArrayList<UndirectedGraphNode>(); }
* };
*/
public class Solution {
public List<Integer> longestGraph(List<UndirectedGraphNode> nodes) {
}
}| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 0of 0 votes
Answers/*Coding question: The customers for a particular business, required to use a webpage to select a Browse Node.
- pragramticProgrammer February 22, 2018 in United States
A Browse Node, is an element in the classification structure used to classify products in the Amazon webpage.
The products are classified in 8 categories. Each category has its own sub-classification that looks like a tree with many
children per node and many levels. The UI developer has a tool to paint such tree. He requires from you (You are the backend developer)
to implement 2 interfaces for him:
Node getRoot();
List<Node> getChildren(Node node);
The data is available for you in a text file with this format:
//nodeid, parent_node_id, nodename
Example:
//nodeid, parent_node_id, nodename
10, 1, Comedy Books
20, 2, Tablets
1, -1, Books
11, 1, Novels
12, 11, Terror novels
2, -1, Electronics
-1, 0, GlobalRoot
*/| Report Duplicate | Flag | PURGE
Amazon SDE1 Data Structures - -3of 3 votes
AnswersRemove '_' and print with 1 space separated string from "Amazon_w_e_b_services are___widely__used_acc__ro___ss_the_worl_d", output should be : Amazon web services are widely used accross the world.
- email6689 February 20, 2018 in India for kindle| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
AnswerDesign a system that works like the you see on Amazon search - lets say you enter 'women's sandals'. What happens in the background? Explain all that you can think of.
- pri9 February 12, 2018 in United States| Report Duplicate | Flag | PURGE
Amazon Web Developer System Design - 2of 2 votes
AnswersPartition given string in such manner that i'th substring is sum of (i-1)'th and (i-2)'nd substring. If such partition not possible then return empty arrayList.
- nileshpatil1212 February 05, 2018 in India
eg.
1) given "1111223" then return ["1", "11", "12", "23"]
2) given "1111213" then return ["11", "1", "12", "13"]
3) given "11121114" then return []| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
AnswersMinimum Continuous Subsequence: targetList & availabletTagsList are two lists of string.
- pragramticProgrammer January 31, 2018 in United States
Input:
targetList = {"cat", "dog"};
availableTagsList = { "cat", "test", "dog", "get", "spain", "south" };
Output: [0, 2] //'cat' in position 0; 'dog' in position 2
Input:
targetList = {"east", "in", "south"};
availableTagsList = { "east", "test", "east", "in", "east", "get", "spain", "south" };
Output: [2, 6] //'east' in position 2; 'in' in position 3; 'south' in position 6 (east in position 4 is not outputted as it is coming after 'in')
Input:
targetList = {"east", "in", "south"};
availableTagsList = { "east", "test", "south" };
Output: [0] //'in' not present in availableTagsList
Note: targetList will contain Distinct string objects.| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - -1of 1 vote
AnswersGiven a list of characters, write a function to output a list of length of minimum non overlapping subsequences that can partition the input list.
- Shilpi_Roy January 25, 2018 in United States
For example:
Input : [a,b,c]
Output: [1,1,1]
Explanation: There are no repeated characters.
Input : [a,b,c,a]
Output: [4]
Explanation: The 'a' is repeated so one subsequence is between a to last a.
Input : [a,b,c,b,a,e,b,a,d,f,g,d,f,i,f,k,l,m,n,m,l]
Output: [8,7,6]
Explanation: max length from 1st 'a' to last 'a' is 8.
1st 'f' to last is 6 adding d to it = 7
so on| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 0of 0 votes
AnswersYou are given with a large paragraph and N words.
- avi007 January 09, 2018 in India
You have to find a min length subparagraph of the paragraph which contain all those N words in any order. Here length of a paragraph is the count of words in the paragraph.| Report Duplicate | Flag | PURGE
Amazon SDE1 - 4of 4 votes
AnswersAmazon
- aonecoding January 06, 2018 in United States
Given an ArrayList of Nodes, with each Node having an ID and a parent ID, determine whether the List is given in preorder.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 2of 2 votes
AnswersWrite a program to return nearest elements from a binary search tree for input element.
- mh4wt@virginia.edu December 23, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Java - 0of 0 votes
AnswersThere is a dictionary already implemented. Write a method , which takes input String without space, to replace the characters from the strings which are not present in dictionary with –
- mh4wt@virginia.edu December 23, 2017 in United States
Example: Dictionary – a*
………….Input- aaabaa
………….Output- aaa_aa| Report Duplicate | Flag | PURGE
Amazon Intern Java - 0of 0 votes
AnswersThere is a dictionary already implemented. Write a method, which takes input String without space, to prints all subsets of the input string which is present in dictionary.
- mh4wt@virginia.edu December 23, 2017 in United States
Example: Dictionary – a*
………….Input- aaabaa
………….Output- a,a,a,aa,aa,aaa,a,a,aa| Report Duplicate | Flag | PURGE
Amazon Intern Java - 0of 0 votes
AnswersThere is a door to enter a restroom. Once you enter the restroom there are N toilets starting from 1, 2,... to N. The toilet which is near to entry door starts from 1 and then it serially goes till N. You can use toilet based on below conditions:
- anjali306 December 21, 2017 in United States
1. If none of the toilets are occupied then choose one which is nearest to the entry door(which is toilet#1).
2. If at least one toilet is occupied then choose that unoccupied toilet which is farthest from the occupied ones.
3. If there are more than one unoccupied toilets whose farthest distance from the occupied ones are same then choose one which is near to the door.
For example:
Let's say there are 5 toilets.
-> First person comes and occupies toilet#1(Based on rule#1).
-> 2nd person comes and occupies toilet#5(Based on rule#2).
-> 3rd person comes and occupies toilet#3(Based on rule#2). Note that the farthest distance would have been formed when the new person would have occupied toilet#2(or toilet#4) but with that, the distance between toilet#2(unoccupied) and toilet#1(occupied) would be just 1.
-> 4th person comes in. Now from toilet#1 to toilet#5, only toilet#2 & toilet#4 are unoccupied. Now there are 2 toilets(#2 & #4) whose farthest distance from unoccupied ones are equal(=1). So rule#3 will apply and toilet#2 will be occupied.
You have to find the sum of those toilet numbers which are occupied.
So in above example after 4th person, toilet numbers which are occupied are #1, #5, #3 & #2.
So answer would be 1+5+3+2 = 11.| Report Duplicate | Flag | PURGE
Amazon - 1of 1 vote
AnswersPrint words in order which are occurring once in huge document. The RAM size 100MB and file size 10 GB.
- Optimist December 16, 2017 in India
Example: I am good. You are good.
Answer : I am You are
Note : It's not datastructure problem where we can simply make use of LinkedHashMap. The file size is going to be huge.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
Answersgiven a set of digit from 1 to 9 {1,2,3,4,5,6,7,8,9}, write code to find k elements whose sum is equal to n.
- CoolGuy December 10, 2017 in India
e.g.
k=3, n= 9
{1, 2, 6}, {1, 3, 5}, {2, 3, 4}
vector<vector<int>> findKElementsSum(int k, int n)
{
}| Report Duplicate | Flag | PURGE
Amazon SDE-3 - 1of 1 vote
AnswersHow would you like to efficently find the total number of possible ways with which given string may be converted to whole dictionary words.
- CoolGuy December 08, 2017 in India
Example :
String = “Dogeatscare”
possible combinations – “Dog, eat, scare ” and “Dog, eats, care”
output is 2.| Report Duplicate | Flag | PURGE
Amazon SDE-3 - 0of 0 votes
Answersclass QueryVector
- CoolGuy December 01, 2017 in India
{
QueryVector(vector values)
{
// Implement
}
vector GetIndices(list filters)
{
// Implement
}
}
Say for example vector is like
{“an”, “apple”, “day”, “keeps”, “doctor”, “away”, “apple”, “iphones”, “cool”, “doctor”, “recommends”}.
GetIndices(“apple”) should return (1, 6)
GetIndices(“doctor”,”cool”) should return (4,8,9)
GetIndices(“random”) should return empty vector ()
GetIndices(“random”,”keeps”,”day”,”doctor”) should return empty vector (2,3,4,9)
Important:
1. There can be millions of values in the input vector of string
2. GetIndices can be called repeatedly and it should be optimized
3. How storage optimization is considered and bitmaps etc are used.| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersDesign a task execution service, which accepts tasks from clients and runs them and returns result. Following is how the
- CoolGuy November 27, 2017 in India
Client Registration (client name, callback method)
Submit Job to service
Once executed service will return the result to client
Lets assume that 20k jobs are getting submitted per second, you need to scale it in such a way that we are able to process as much jobs per second as possible.
Further questions:
So the components are going to be a load balancer, workstations, cache, task runner and DB. How will you make sure that data is consistent among them, mimimal duplication of data and every job is ran only once.
If any machine is down, say DB, workstation etc. how that is going to be handled.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 9of 9 votes
AnswersDeveloping Java game
- stallapp November 03, 2017 in United States
creating a RESTful service using which players can play a simple game described
below.
The game should have the following rules:
• The player has an infinite amount of coins.
• The player bets 10 coins to play a normal game round.
• In any round (free or normal), the player has a 30% chance of winning back 20 coins.
• In any round (free or normal), the player also has a 10% chance of triggering a free round where
the player does not have to pay for bet. The free round works in the same way as a normal round except
it costs 0 coins. The free round should follow immediately after the normal round.
• The player can both win coins and free round at the same time.| Report Duplicate | Flag | PURGE
Amazon Backend Developer Java - 0of 0 votes
AnswersI participated interview event with Amazon and receive email from Amazon recruiter that the team was happy with my performance and would be giving me offer at Amazon Vancouver Office, Canada. However,17 days later i still not get an official offer. I did several follow up with the recruiter within the period, just to get some "they are finding team for me" response. What could go wrong? Why is it in my case that the offer is being process so slow?
- FAZ November 02, 2017 in Canada| Report Duplicate | Flag | PURGE
Amazon SDE-2 Experience - 0of 0 votes
AnswersI have a service in Which you need to send below data in SMS with a keyword and in return you will get the availability of flight or you can book a seat in flight.
- AD October 30, 2017 in India
Data - AirlineName, Date, Time, From, To
1. Give Test Data
2. Give Test Scenarios
3. If you have not being given any Mobile phone to send text or any API client to query the webservice, how will you test this?| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 2of 2 votes
AnswersWrite a Java code that take a string of parenthesis as input and return if the string is valid or not . The input will have '(' and ')' and also '*' and * serves as wild card and can be used in place of both '(' and ')' or it can be null.
- ryanray1512 October 16, 2017 in United States
For example,the String (*)(*)(** is a valid String.
Follow up: What if '[]' and '{}' are also in the string along with '()' and * can be used in place of any of them or can be considered as null?| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer - 2of 2 votes
AnswersFind the indices of all anagrams of a given word in a another word.
- aonecoding October 09, 2017 in United States
For example: Find the indices of all the anagrams of AB in ABCDBACDAB (Answer: 0, 4, 8)| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 4of 4 votes
AnswersAll jumbled numbers of n digits in max (worst case) O(n) and min (avg case) O(log n) time.
- mani0119 October 08, 2017 in India
A number is a jumbled number if the _absolute_ difference between adjacent digits is <=1.
For an input n=3
output should be
100
101
110
111
121
122
...
and so on.
The problem is similar to the one listed here https://www.careercup.com/question?id=5729332770111488
But this problem also has a O(n or log n) limitation and the solutions listed in the above mentioned problem at the time of posting this question, do not satisfy the criteria
PS: 001 is not a 3 digit number.
210 is absolutely fine as the absolute difference between adjacent digits is <=1.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow to Design Netflix.(System Design)
- mayankesh911 September 30, 2017 in India| Report Duplicate | Flag | PURGE
Amazon Software Developer System Design - 1of 1 vote
AnswersHow to Design App-Store like google play.(System Design)
- mayankesh911 September 30, 2017 in India| Report Duplicate | Flag | PURGE
Amazon Software Developer System Design - -1of 1 vote
AnswersHow to design a Debugger both HLD and LLD?
- koustav.adorable September 19, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-3 System Design