Amazon Interview Questions
- 0of 0 votes
AnswersYou are given 2 arrays: one representing the time people arrive at a door and other representing the direction they want to go(in or out) You have to find at what time each person will use the door provided no 2 people can use the door at the same time. Constraints: the door starts with ‘in’ position, in case of a conflict(2 or more people trying to use the door at the same time), the direction previously used holds precedence. If there is no conflict whoever comes first uses the door. Also if no one uses the door, it reverts back to the starting ‘in’ position. Should be linear time complexity.
- neer.1304 April 21, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersA 2d array has 0 and 1 as values. In one flip, 0's are changed to 1 if and only if any of the neighbors (left, right, top, bottom) is 1. Return the total number of flips required to convert the whole grid to 1's
- abhi.mathur.us February 11, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 1of 1 vote
AnswersGiven an unsorted array A of size N of non-negative integers, find a continuous sub-array which adds to a given number S.
- Nits January 30, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon Dev Lead - 0of 0 votes
AnswersProblem:
- giridharikhandelwal1 January 03, 2020 in India
1. Given a Mix of all types of characters which includes Special characters, Numbers, String in a Log file.
for eg: "HappyI%&&87Christmas %%$^%&NewYear"
2. Get the largest substring which
"contains the Characters in Even Position followed by a Special Character and
then a meaningful word should be coming up"| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Problem Solving - 1of 1 vote
AnswersA startup website has a lot of real-time traffic . I want to see the real-time view (refreshed every 1 min) of top 20 users by hit count within last 10 mins. Full distributed system, I have to resolve all the concurrency issues.
- acharyashailendra1 December 22, 2019 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 2of 2 votes
AnswersHere is a question from the "Cracking The Coding Interview" book with a twist.
- fz December 17, 2019 in United States
Implement a method to perform basic string compression using the counts of repeated characters. (p. 73 5th edition)
The twist: the string can also contain digits. Think of encoding and decode protocol. How the compression can be reversed properly?
For example, ab2ccccd -> ab24cd| Report Duplicate | Flag | PURGE
Amazon Algorithm - 0of 0 votes
AnswersPrepare test plan for a new feature of " deposit cheque via mobile app " which is added under menu tab.
- raghunath.e November 14, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test test - 1of 1 vote
AnswersWrite a function to return string when passed integer . Note : do not use tostring() in built function.
- raghunath.e November 14, 2019 in United States
E.g 123 --> "123"| Report Duplicate | Flag | PURGE
Amazon Software Engineer in Test technical - -2of 2 votes
AnswersGiving a the following:
- xi.text.xi October 22, 2019 in United States for none
A list of a store items T={t_1, t_2,...,t_n}.
A list of prices of each item P={p_1, p_2,...,p_n}.
A list of quantities of each item Q={q_1, q_2,...,q_n}, respectively.
And total bill M.
Our goal is to find any possible list of items that its total value is equal to M using dynamic problem.
Write down a recursive solution.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 0of 0 votes
AnswersGiven an array of positive and negative integers {-1,6,9,-4,-10,-9,8,8,4} (repetition allowed) sort the array in a way such that the starting from a positive number, the elements should be arranged as one positive and one negative element maintaining insertion order. First element should be starting from positive integer and the resultant array should look like {6,-1,9,-4,8,-10,8,-9,4}
- sameerasusmitha October 21, 2019 in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Arrays - 1of 1 vote
AnswerDesign a service to scan photos/videos for any malware
- novastorm123 October 16, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon System Design - 0of 0 votes
AnswersWrite a method that merges a fixed number of streams containing an infinite sequence of monotonically increasing integers into an output stream of monotonically increasing integers. It is important to note that the input stream are infinite, so any solution based on the length of the streams would be considered incorrect.
Note that the question was given in the context of Java with the below code given as the base contract for the method.public void merge(List<Stream> inputStreams, Stream outputStream) { // Implement me }
This was also provided as the definition of "Stream" in this case, and not what is defined in java.util.stream.Stream.
- gr1ml0ck October 05, 2019 in United Statesinterface Stream { // Retrieves but does not remove the next item from the stream int peek(); // Retrieves and removes the next item from the stream. int poll(); // Puts an item into the stream void put(int i); }
| Report Duplicate | Flag | PURGE
Amazon Solutions Engineer Algorithm - 0of 0 votes
AnswersWrite test cases for earring with diamond, gold clamp, diameter 13mm, width 4mm
- roman.khomitsky19 October 05, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon Testing / Quality Assurance - 0of 0 votes
AnswersImplement union and intersection of two array(in a efficient way).
- dhruvjoshi43 October 04, 2019 in india for none
Additional information given by the interviewer was: elements of the two given array may be repeated but cannot be repeated in union and intersection array.| Report Duplicate | Flag | PURGE
Amazon Data Engineer test - 0of 0 votes
AnswersA co-ordinate plane was given. On each point (x, y) there are x+y number of apples on it. A person is standing on (0, 0) and he wants to buy a square plot having N number of apples inside it (including the periphery). Question was to return the value of perimeter of that square plot given N.
- 200MITTALGAUTAM August 26, 2019 in India| Report Duplicate | Flag | PURGE
Amazon SDE1 - 0of 0 votes
AnswersDesign distributed crawling system which would be feeded a source url.
- neer.1304 August 09, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Distributed Computing - 1of 1 vote
AnswersGiven 'n' servers each having millions of sorted integers. Find distributed median of all the 'n' servers.
- neer.1304 August 09, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Distributed Computing - 1of 1 vote
AnswersGiven a binary matrix of 0 and 1 where we can move in 4 directions left, right, top, down and we can only pass through 1's. Find the shortest path from given source coordinate (a,b) to destination (m,n) given we can flip any one of the zero to one.
- neer.1304 August 09, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersProgram for the given boolean matrix print size of matrix that forms X by 1s
- Rising star August 08, 2019 in United States
Input:
1 1 1
1 1 1
1 1 1
Otput:3
1 1
1
1 1
That form x and size is 3| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 1of 1 vote
AnswerSuppose there is a function given to you that:
def get_friends( person_id ) { /* returns friends of person */ }
How you are now going to recommend friends to a person based on number of mutual friends? So, come up with the function:
- NoOne August 02, 2019 in Indiadef friend_reco( person_id, max_no_of_friends ){ }
| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven billions of Identity cards of the form :
card : { my_id : "my id", "moms_id" : "mom id", "dad_id" : "dads id" }
If one gives you two Person's id, how can you tell if these 2 persons are blood related.
So, write a function that is:
- NoOne August 02, 2019 in Indiadef is_blood_related( person_id_1, person_id_2 ) // go on..
| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersDesign election voting system. Election would be country wide. System should be scalable, available and consistent.
- neer.1304 July 26, 2019 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersGiven a string select two non-overlapping strings that are same and remove them. Perform this operation recursively till there are no desired strings.
- neer.1304 July 20, 2019 in United States
Print the number of possible substring after completing above operation.
Ex - abcc
Duplicate non-overlapping substring - abc
After removing abc from we are left with 1 substring abc.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersIn a 2-D matrix of m*n select m-1 elements from each row such that that the resulting sum is minimum and each column is selected atleast once.
- neer.1304 July 20, 2019 in United States
Ex -
2 3 5
3 2 5
4 4 7
Selecting (2,3) from 1st row, (2,5) from 2nd row and (4,4) from 3rd row would result in minimum sum of 20| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersFind LCA for list of nodes of a tree
- neer.1304 July 17, 2019 in United States
Function defined as below -
TreeNode findLCA(TreeNode root, List<TreeNode> nodes)| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersGiven two numbers m and n. Find all numbers between these two numbers such that difference between adjacent digit is 1
- neer.1304 July 01, 2019 in United States
For ex m =0 n =22
O/p - 0,1,2,3,4,5,6,7,8,9,10,12,21| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 1of 1 vote
AnswersGet the sum of all prime numbers up to N. primeSum(N).
- acoding167 July 01, 2019 in United States
Follow-up: If primeSum(N) is frequently called, how to optimize it.| Report Duplicate | Flag | PURGE
Amazon - 0of 0 votes
AnswersIn a garden, there are several apples trees planted in a grid format. Each point (i,j) in the grid has |i| + |j| apples.
Allie can buy a square plot centred at (0,0). Find the minimum perimeter of the plot (1 unit having length = 1) such that she can collect at
least X apples. All plants on the perimeter of the plot are also included.
Sample:
- bertram_gilfoyle June 27, 2019 in IndiaInput = 1 Output = 8 input = 11 Output = 8 Input = 13 Output = 16
| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm
Open Chat in New Window