Amazon Interview Questions
- 0of 0 votes
AnswersGiven a very large file of 10GB containing product price . Sort the file of product if memory available is 1 GB
- ashishsaraswat.iips June 06, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 - -1of 1 vote
AnswersGiven a stream of objects, O1, O2, O1, O3, O4... Provide an algorithm to identify the first unique object at any given point in time.
- abhi10901 May 31, 2017 in United States for AWS Auto Scaling
So for example, in the above, after receiving the first Object, it is unique. After receiving the second, the first is still the first unique object. After receiving the 3rd, the 1st object is no longer unique (you've not seen O1 twice), so O2 is not the first unique object. etc...| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 0of 0 votes
Answershow to implement a Wish List like this one
- ajay.raj May 30, 2017 in United States
https://www.amazon.com/hz/wishlist/intro| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersFind the first non repeating character in a string. For example if the input string "abcdeabc", non repeating character is "e"
- kag May 24, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - -1of 1 vote
AnswersFind if a mathematical string is balanced in terms of parenthesis. For example "(1+2)" is balanced and "(1+2" is not balanced.
- kag May 24, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersImplement power function. The function should take two numbers as input (e.g. 2,3) and return 8 as output
- Syed May 22, 2017 in India
See link below for hints and answer https://baquerrizvinotes.blogspot.in/2017/05/how-to-crack-amazoncom-technical.html| Report Duplicate | Flag | PURGE
Amazon Software Engineer Coding - 0of 0 votes
AnswerThere is 3D space, limited with a cube, with edge=2000.
- John.Ackerman.jb May 17, 2017 in United States
The center of coordinate system is point (0; 0; 0), so the maximum/minimal coordinate value is 1000/-1000.
There are 10000 points generated with discrete uniform distribution inside of K spheres, located in the cube.
Radius (R) of each sphere is 250.
Centers of spheres are located at the distance of not less than 2*R.
It is required to determine which point related to which sphere.
Input: array of 10000 structures, like:
struct Point {
int number;
int x;
int y;
int z;
}
where number is unique id of the point, x,y,z - it's coordinates.
Output:
array of 10000 structures, like:
struct Point {
int number;
int cluster_id;
}
where cluster_id is unique cluster id of a sphere that point belongs to.
Initially I considered a following solution:
1) Find Euclidian distance for each point from center of coordinates (0;0;0) to point's coordinates.
2) Sort this array of distances in descending order.
3) Get the point from the sorted array of distances and put in a new Set of Cluster Maximals.
4) Compare following point from the array to each value from the Set of Cluster Maximals (initially 1 value).
If it's Euclidian distance less than or equal to 2*R, then
mark this point as belonging to Kth cluster (range=1..N), otherwise add the point to the Set of Cluster Maximals.
5) Repeat step 4.
Two concerns I have:
1) There is an issue that my algorithm would work only in case if Claster Maximals are located on the surface of the spheres.
2) Plus, according to the task requirements, there could be the case when 2 spheres can have 1 and only common point.
I think in case if point belongs to 2 spheres, it is ok to mark it with cluster_id of any of these 2 shperes.
Could you please provide a proper solution to the task?| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 0of 0 votes
AnswersThere are three row of houses. There are N houses in each row. Each house can be painted with three colors: red, blue and green. The cost of painting each house with a certain color is different. You have to paint all the houses with following constaints
- jmincoder2 May 16, 2017 in United States
No two adjacent houses in a row have the same color.
Houses in a column have three different colors
You have to paint the houses with minimum cost. How would you do it?
Note: The cost of painting house 1 red is different from that of painting house 2 red in any row. Each combination of house and color has its own cost.| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 0of 0 votes
AnswersQuestion 2: Write code for the following: given a text file containing this information (Date the customer logged-in, Tab, Customer ID) Example: 04/11/2017 \t 0003 04/12/2017 \t 0003 04/13/2017 \t 0004 04/13/2017 \t 0003 04/13/2017 \t 0003 04/15/2017 \t 0004
- mhannsari May 13, 2017 in United States
How to get the list of those customers that log in on four consecutive days?
Please give good solution| Report Duplicate | Flag | PURGE
Amazon Java Developer - 0of 0 votes
AnswersQuestion 1: Given input file with the following set of strings, Download input file: https://www.google.com/basepages/producttype/taxonomy.en-US.txt
- mhannsari May 13, 2017 in United States
Example: Electronics Electronics > Arcade Equipment Electronics > Arcade Equipment > Basketball Arcade Games Electronics > Arcade Equipment > Pinball Machine Accessories Electronics > Arcade Equipment > Pinball Machines Electronics > Arcade Equipment > Skee-Ball Machines Electronics > Arcade Equipment > Video Game Arcade Cabinet Accessories Electronics > Arcade Equipment > Video Game Arcade Cabinets Electronics > Audio Electronics > Audio > Audio Accessories Electronics > Audio > Audio Accessories > Audio & Video Receiver Accessories Electronics > Audio > Audio Accessories > Headphone & Headset Accessories Electronics > Audio > Audio Accessories > Headphone & Headset Accessories > Headphone Cushions & Tips Electronics > Audio > Audio Accessories > Karaoke System Accessories
write a function that stores this information. Your data structure should be able to provide information as Electronics = 14 Electronics > Arcade Equipment = 7 Electronics > Arcade Equipment > Video Game Arcade Cabinets = 1 Electronics > Arcade Equipment > Skee-Ball Machines = 1| Report Duplicate | Flag | PURGE
Amazon Java Developer - 0of 0 votes
AnswersFind the label with max width of a tree.
- Md Omar Faroque May 12, 2017 in United States for Amazon Business
// 0 A
// /|\
// 1 B C D
// /| | \
// 2 E F G H
Answer is 2 here.| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer - 0of 0 votes
AnswerDesign entity(model) structure of a file systems. You don't have to write any interfaces, just various models and their properties.
- sonesh May 11, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 design - 0of 0 votes
AnswersYou have to desing a system for a shop kepper to keep his/her inventory managed. He/she have furniture at the begining, but he may add more items to it. His/her furnitures are wood char, wood table, steel chair, etc.
- sonesh May 11, 2017 in United States
Each furniture have one property, a boolean one, called isChildSafe.
Later, he said, what if the shopkeeper wants to add new type of items, such as phone or may be something else, and he/she might also wants to add two new properties, such as isFireSafe, isWaterSafe etc.
How would you design extend to these types.| Report Duplicate | Flag | PURGE
Amazon SDE-2 design - 0of 0 votes
AnswersYou have to design a job scheduler. The job schedular should be able to accept all kind of jobs, small or long running. Multiple systems might be adding jobs to it and multiple systems should be able to execute jobs simultaneously.
- sonesh May 11, 2017 in United States
Please list down the components and data flows between them, what kind of interfaces you will be having, what kind of retry logic you will be providing, storage and middle tier design was also asked.| Report Duplicate | Flag | PURGE
Amazon SDE-2 design - 2of 2 votes
AnswersYou are given set of strings, You have return anagrams subsets from it. An anagram set is that one where every string is an anagram of another string. If the subset contains only one string, don't include that in the result.
- sonesh May 11, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm String Manipulation - 0of 0 votes
AnswersYou are given a NxN boolean matrix, where matrix(i,j) will be one if 'i' is a parent of 'j' in a tree, otherwise, it is zero.
- sonesh May 11, 2017 in United States
Construct this tree.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm Trees and Graphs - 0of 0 votes
AnswerDesign/Implement an LRU cache so that Read/Write/Find operation only takes constant time.
- sonesh May 11, 2017 in United States
Now, Let's say, we will be considering the frequency as well. It means to keep the most used processes and in a case of the tie, use lease recently used to remove an element.
Now, as this new algorithm can cause many hits, or no new process will come to the cache if the last process of the cache has two hits., What can you do to prevent this, and how would you implement that.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm design - 1of 1 vote
AnswersThere is a cluster of servers. In this cluster some group of servers are running application A, some group are running B, etc. Each application server produces huge logs and the log file sizes run into GBs. Each minute there are millions of log entries.
- Curious May 09, 2017 in India
You need to design a system that allows you to:
1. Specify the name of the application whose logs you want to search.
2. Search any text that the log message may contain.
3. Search within a time stamp range.
4. Search within the specified log level(s).
The system should be real-time.| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - 0of 0 votes
AnswersWhat is the cost / complexity of a String.indexof() function call in java?
- ajay.raj May 08, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersHow to check the validity of a 4 digit credit card expiration date (mm/yy)
- ajay.raj May 06, 2017 in United States
that still works 100 years from now.
public boolean isValid(String s){
}| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
Answerswhat is the time complexity for java.util.Random.nextInt()
- ajay.raj May 05, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon Java Developer - 0of 0 votes
AnswersIf you are given 20 test cases, and you are asked to execute only one test case, which test case will you execute which will cover the main functionality.
- amu0dha May 04, 2017 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 0of 0 votes
AnswersWrite the test cases for below logic.
- amu0dha May 04, 2017 in United States
i/p: string, strong
o/p: strng| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 1of 1 vote
AnswersYou are given 2 strings: string, strong. Find the common alphabets in two strings and print it.
- amu0dha May 04, 2017 in United States
i/p: string , strong
o/p: strng| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance - 1of 1 vote
AnswersIt is presidential election time.Mr X is fighting for the president.The country has N number of cities.
- hitansu166 May 04, 2017 in India for Aelxa
The cities are divided into developed & developing city on basis of a developemt index A.
If A is 1, then the city is developed. If A is 0, then the city is developing.
A close source to Mr X told that all the people from developing cities will vote for him while people
from only k number of developed cities will vote for him.
Find out the no of maximum vote in favour & minimum vote in against Mr X will get.
Input
------
10 3
0 12
0 6
0 7
1 8
1 12
1 17
1 20
1 22
1 5
1 6
First 2 line gives no of cities N= 10 & number of developed cities vote for Mr X k= 3
Next 10 lines give the development index A & number of people in the city
For example in the first line A= 0, no of people= 12| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 1of 1 vote
AnswersWrite a function that returns true if the binary representation of an integer is a palindrome.
- maxxwizard May 03, 2017 in United States for Marketplace
9 = 1001 = palindrome
8 = 1000 = not palindrome| Report Duplicate | Flag | PURGE
Amazon SDE1 Java - 2of 2 votes
AnswersPassword Suggestor: Replace s with $ and a with @ and produce all password suggestions.
- Interviewee2017 May 03, 2017 in United States
For Example: Password : P@ssword, P@$$word,pas$word etc..| Report Duplicate | Flag | PURGE
Amazon Software Developer - 1of 1 vote
AnswersConstructing City
- hitansu166 May 03, 2017 in India for Alexa
In a country the cities are connected through roads of 3 types 1, 2, 3.
All the roads are bi-directional. The roads of a city has some restriction.
Road of type 3: both men and women can walk
Road of type 2: only women can walk
Road of type 1: only men can walk
Now the govt. wants to remove extra roads.But the cities should be connected for both men & women.
Connected means one should able to reach from one city to other & vice-versa.
Find out the maximum no of roads can be removed so that the cities can be accessible to both men & women.
Input:
5 5
1 2 3
2 3 3
3 4 3
5 3 2
5 4 1
First line gives no of cities & no of roads. Next each 5 lines gives city source, city destination, type for a roads.
5: no of cities 5: no of roads
1: city-1 2: city-2 3: type 3 road
o/p: 2| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
Answershow does java implement priority queue?
- ajay.raj April 25, 2017 in United States
i answered min heap, the interviewer seemed it was not right| Report Duplicate | Flag | PURGE
Amazon SDE1
Open Chat in New Window