Amazon Interview Questions
- 0of 0 votes
AnswersThe Unix find command allows you to search for files under a given directory. You can specify criteria for files you are interested in.
- ajangir August 08, 2022 in India
Imagine that you need to write code in a high level language like java, that does things similar to the find command.
I would like you to focus on 2 uses cases at first.
• Find all files over 5 MB somewhere under a directory.
• Find all XML files somewhere under a directory.
I would like you to create a library that lets me do this easily. Keep in mind that these are just 2 uses cases and
that the library should be flexible.| Report Duplicate | Flag | PURGE
Amazon Software Engineer Software Design - 0of 0 votes
AnswersCan anyone please help with the possible by testcases for Alexa.
- dipzglory June 04, 2022 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance Testing - 0of 0 votes
AnswersDesign a simple rule engine system to route internal transactions to different bank. The engine should be flexible to extend to accept more parameters to make the routing decision.
- meghnabit December 23, 2021 in India
- The definition maintain in csv file, variable input and single result as output.
- The application is able to load the rule definition into proper routing.
- The match could be exact match or wildcar match. Exact match is preferred.
- The match priority from left to right is high.
simple rule definition
inputa, inputb, inputc, result
prod1, usd, us, b1
prod1, usd, * , b2
prod1, *,us, b3
prod1,*, ca, b4
Expection against sample rule definition:
sample1: [prod1,usd,us] -> b1
sample2: [prod1,usd,pr] -> b2
sample3: [prod1,eur,us] -> b3
sample4: [prod1,eur,pr] -> null
sample5: [prod1,usd,ca] -> b2
1. Define the data structure to hold the rule definition.
2. Implement the algorithm to do the routing.| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 1of 3 votes
AnswersTell me about a time when you not just met your goals but exceeded the expectations
- yjagger1246 October 09, 2021| Report Duplicate | Flag | PURGE
Amazon SDE-2 Behavioral - 0of 0 votes
AnswerTell me when you did something beyond client expectations
- shyam200goyal July 23, 2021 in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 0of 0 votes
AnswersTell me about when you did something different in your role
- shyam200goyal July 23, 2021 in India| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer - 1of 1 vote
AnswersGiven a string s consisting of items as "*" and closed compartments as an open and close "|", an array of starting indices startIndices, and an array of ending indices endIndices, determine the number of items in closed compartments within the substring between the two indices, inclusive.
- prashant1diwase May 24, 2021 in United States for Tax Systems
An item is represented as an asterisk ('*' = ascii decimal 42)
A compartment is represented as a pair of pipes that may or may not have items between them ('|' = ascii decimal 124).
Example
s = '|**|*|*'
startIndices = [1, 1]
endIndices = [5, 6]
The string has a total of 2 closed compartments, one with 2 items and one with 1 item. For the first pair of indices, (1, 5), the substring is '|**|*'. There are 2 items in a compartment.
For the second pair of indices, (1, 6), the substring is '|**|*|' and there are 2 + 1 = 3 items in compartments.
Both of the answers are returned in an array, [2, 3].
Function Description .
Complete the numberOfItems function in the editor below. The function must return an integer array that contains the results for each of the startIndices[i] and endIndices[i] pairs.
numberOfItems has three parameters:
- s: A string to evaluate
- startIndices: An integer array, the starting indices.
- endIndices: An integer array, the ending indices.
Constraints
1 ≤ m, n ≤ 105
1 ≤ startIndices[i] ≤ endIndices[i] ≤ n
Each character of s is either '*' or '|'
Input Format For Custom Testing
The first line contains a string, s.
The next line contains an integer, n, the number of elements in startIndices.
Each line i of the n subsequent lines (where 1 ≤ i ≤ n) contains an integer, startIndices[i].
The next line repeats the integer, n, the number of elements in endIndices.
Each line i of the n subsequent lines (where 1 ≤ i ≤ n) contains an integer, endIndices[i].
Sample Case 0
Sample Input For Custom Testing
STDIN Function
----- --------
*|*| → s = "*|*|"
1 → startIndices[] size n = 1
1 → startIndices = 1
1 → endIndices[] size n = 1
3 → endIndices = 3
Sample Output
0
Explanation
s = *|*|
n = 1
startIndices = [1]
n = 1
startIndices = [3]
The substring from index = 1 to index = 3 is '*|*'. There is no compartments in this string.
Sample Case 1
Sample Input For Custom Testing
STDIN Function
----- --------
*|*|*| → s = "*|*|*|"
1 → startIndices[] size n = 1
1 → startIndices = 1
1 → endIndices[] size n = 1
6 → endIndices = 6
Sample Output
2
Explanation
s = '*|*|*|'
n = 1
startIndices = [1]
n = 1
endIndices = [6]
The string from index = 1 to index = 6 is '*|*|*|'. There are two compartments in this string at (index = 2, index = 4) and (index = 4, index = 6). There are 2 items between these compartments.| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Data Structures - 0of 0 votes
AnswersCome up with a low-level design for an In-Memory Database.
- zapper.ethan March 19, 2021 in United States| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer design - 1of 1 vote
Answersdesign an ip blocking system
- nitinthakur5654 March 05, 2021 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 design - 0of 0 votes
AnswersAs we all know that poker cards have four suites: Spades, Hearts, Clubs and Diamonds with figures from 1 to 13.
- holmespanda2 December 28, 2020 in United States
Now you are given a set of poker cards, you can pick any one card as the first card. And except for the first card, you can only pick the card that has the same suit or figure with the previous one.
Return the max number of cards you can.
For example: [(H, 3), (H, 4), (S, 4), (D, 5), (D, 1)], it returns 3 as follows: (H,3)-->(H,4)-->(S,4)| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersHey anyone got the 90 minutes online assessment test from Amazon for MBA interns? I would like to know what type of questions they ask in the assessment. I need an example if any one of you attended it.
- falguni.mehrotra25 December 04, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Online Test - 0of 0 votes
AnswersGiven n number of persons in a park. One of them is having a virus. But we don't know whom. Also, the position of all persons is given. A contaminated person can spread it up to d distance. When the best case (Spread is minimum) and the worst case(Spread is maximum) would occur?e.g.
- Voyager October 10, 2020 in India
N=5
Position=[1, 3, 5, 9, 14]
d=5| Report Duplicate | Flag | PURGE
Amazon Software Developer - 0of 0 votes
AnswerWrite test Case for Amazon search plugin with a drop-down, search text box and submit button
- A V September 23, 2020 in India for Ring| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Testing - 0of 0 votes
AnswersAmazon website was working fine till yesterday.
- A V September 23, 2020 in India for Ring
//However in last 24 hours, the order processing(Delivery Estimates) has been taking longer than usual.| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Debugging - 0of 0 votes
AnswersWrite Test data for the program which finds the distance between 2 given character of a sentence.
- A V September 23, 2020 in United States for Ring
// SAMPLE INPUT: findDistance("Ajay is here", A, h) => 10| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer test - 0of 0 votes
AnswersQuestion 2) You have given a 2D binary matrix of size M[N-1][N-1]. Consider 1's as a
- A V September 23, 2020 in India for Ring
path and 0's as a deadend. The person starts from M[0][0] and needs to reach at point
M[N-1][N-1]. He can either move forward and down. You need to calculate the path to
reach the destination.
M[N][N] = 1 0 0 0
1 1 0 0
0 1 1 0
1 1 1 1| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Coding - 0of 0 votes
AnswersExamples:
- kamal suthar August 26, 2020 in India
(((abc))) --> abc
(ab(c)) --> ab(c)
(abc09%(c)) --> abc09%(c)
ab(c) --> ab(c)
(ab)c --> (ab)c
abc(c)) → INVALID
(abc)(def) --> (abc)(def)
(abc)typ(def) --> (abc)typ(def)
((abc)(def)) --> (abc)(def)| Report Duplicate | Flag | PURGE
Amazon Computer Scientist Algorithm - 1of 1 vote
AnswerWrite all possible scenarios for youtube app on your TV
- anonymous August 25, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Quality Assurance - 1of 1 vote
AnswersProgram to find the frequency of each element in the array OR write a program to count the occurrence of each number in a given string
- anonymous August 25, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Coding - 0of 0 votes
AnswersGiven an n-ary tree and some queries for the tree, in every query you’ll be given a node you are supposed to print preorder traversal of the subtree rooted at that node.
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 4of 4 votes
AnswersYou have an array of numbers. You have to give the range in which each number is the maximum element. For Example, If array is 1, 5, 4, 3, 6 The output would be
- neer.1304 July 12, 2020 in United States
1 [1, 1]
5 [1, 4]
4 [3, 4]
3 [4, 4]
6 [1, 5]| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswerGiven an array of billion of numbers. Billions of queries are generated with parameters as starting and an ending index. Both these indices lie within that array. Find the maximum number between these two indices in less than O(N)
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersMultiply two numbers without using * and only be using bitwise operations
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersDisplay nodes of a tree in level order using DFS
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersImplement a deque using stacks
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersGiven the entire dictionary of English words, what data structure will you use to efficiently store and match the custom regex string like "D*sk", where * represents any single alphabet, and return the list of matched words?
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswerGiven a skewed tree, an insect is sitting at the root of the tree at t = 0min, every minute insect steps down in the tree, find the probability of the insect being at any node at t = infinity. Once I came up with a solution various other complexities has been added to the problem such as: What if the tree is binary tree (written code for this) What if three is n-ary What if it is now a directed acyclic graph Handle cases that there can be more than one entry point There can be more that one way to reach a node
- neer.1304 July 12, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm