Amazon Interview Questions
- 1of 1 vote
AnswersWrite a Junit test for the following 2 methods in the class which test for properties file as well:
- newbieJunit September 16, 2016 in India
public class Test{
private HashMap<String, String> aTCN;
private static final String alpha= "alpha.";
private static final String beta = "beta.";
private Properties exporterConfig;
private static final ADFLogger LOG = ADFLoggerFactory.getLogger("R",R.class);
public Map<String, String> getATCN() {
if (aTCN== null) {
aTCN= new HashMap<>();
Properties demo= new Properties();
try {
demo.load(ClassLoader.getSystemResourceAsStream("r1.properties"));
} catch (IOException e) {
LOG.emitError("", e.getMessage());
}
for (String columnName : demo.stringPropertyNames()) {
aTCN.put(columnName.replace(beta, ""),
demo.getProperty(columnName).replace(alpha, ""));
}
}
return aTCN;
}
public Properties getEC() {
if (eC== null) {
try {
exporterConfig = new Properties();
exporterConfig.load(ClassLoader.getSystemResourceAsStream("r2.properties"));
} catch (IOException e) {
LOG.emitError("", e.getMessage());
}
}
return eC;
}
}
I was unable to figure out the same. Let me know if any one has any solution.| Report Duplicate | Flag | PURGE
Amazon Intern Testing - 3of 3 votes
AnswersGiven two sorted lists and an integer k, merge the lists up to a maximum of k elements.
- codebrkr September 15, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 1of 1 vote
AnswersGiven two sorted lists (or arrays) and a number k, create an algorithm to fetch the least k numbers of the two lists.
- codebrkr September 15, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
AnswersYou are given a dictionary of fixed words, you need to find the maximum chain of words that can be formed by any of these words. A chain is formed by picking a word and removing one character from it and this newly formed word should be present in the dictionary.
- rd22 September 15, 2016 in India
As an example say the dictionary consists of {a, b, ba, bca, bda, bdca}, then the word that forms the biggest chain will be bdca -> bca -> ba -> (a or b), i.e. a chain of length 4.| Report Duplicate | Flag | PURGE
Amazon Algorithm - -1of 1 vote
AnswersYou are given the arrival and departure times of airplanes at an airport for a single day. Schedules for the airplanes remain the same across all days. You are to determine the number of gates the airport should have so that no plane spends time waiting for a gate.
- funktional September 12, 2016 in United States for AWS
arr = [9:30, 11:15, 16:30]
dep = [11:45, 11:30, 16:45]
Arr array is sorted by time. And departure array is sorted by corresponding arrival times. Plane 'i' arrives at time arr[i] and departs at time dep[i]
Notes:
After some questions, it was decided that minute was the smallest unit of time we cared about. Gate was considered occupied on the arriving minute, but empty on the departing minute. And that the arrival and departure times could be represented as such as integers. e.g. Day runs from minute 0 to minute 1339 (since using a zero-based index). So our example times represented as:
arr = [570, 675, 990]
dept = [705, 690, 1005]| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Coding - 0of 0 votes
Answerstest plan for gmail login screen.areas you test.tools you use,test cases and estimated time.
- royalprince September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
Answershow do you test google translate.test plan.different types of testing and testcases
- royalprince September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET - 0of 0 votes
AnswerTest plan for Angry birds game with 80% coverage.what areas you will concentrate on.
- royalprince September 02, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon SDET Testing - 0of 0 votes
AnswersTime Complexity ?
- Ragesh September 02, 2016 in United States for Seattle
a. Inserting a node in Linked List?
b. HashMap time complexity?| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswersFind missing number from sequence of numbers in an array? Time Complexity?
- Ragesh September 02, 2016 in United States for Seattle| Report Duplicate | Flag | PURGE
Amazon Software Engineer - 0of 0 votes
AnswerTime Complexity ?
- Ragesh September 02, 2016 in United States for Seattle
a. Inserting a node in Linked List?
b. HashMap time complexity?| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 0of 0 votes
AnswersFind missing number from sequence of numbers in an array? Time Complexity?
- Ragesh September 02, 2016 in United States for Seattle| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 0of 0 votes
AnswersReverse a String using Recursion and unit tests?
- Ragesh September 02, 2016 in United States for Seattle| Report Duplicate | Flag | PURGE
Amazon Software Engineer Algorithm - 0of 0 votes
AnswersSame question asked in 27th Aug 2016 face to face interview.
- Mallikarjun Birajdar September 01, 2016 in India for Kindle
Find length of longest palindrome string, you can shuffle or remove any characters in string.| Report Duplicate | Flag | PURGE
Amazon Quality Assurance Engineer Coding - 0of 0 votes
Answersobject oriented design for robot vacuum cleaner.
- akash.umang August 30, 2016 in United States
write use cases, draw class diagram and interfaces
between them.| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 1of 1 vote
AnswersA company is looking for algorithm to show item recommendations.
- maksymas August 29, 2016 in United States
If a customer bought A and B items and another buys A item, B should come as recommendations.
There are two types of recommendations based on the connections
1) Two items are strongly connected if a customer buys those items.
2) Two items are weakly connected if each items are strongly/weakly connected to another third item.
Provided the sample input
ABC
10
first:ABC
first:HIJ
sec:HIJ
sec:KLM
third:NOP
fourth:ABC
fourth:QRS
first:DEF
fifth:KLM
fifth:TUV
first, sec, third.. represents the customer names
ABC, HIJ... represents the item codes
For the Input item Id "ABC", since "ABC" is strongly connected to HIJ, DEF, QRS
and whereas ABC is weakly connected to KLM and TUV
the output should be count of strong and weak connection i.e., [3,2]| Report Duplicate | Flag | PURGE
Amazon Software Developer Algorithm - 4of 4 votes
AnswersLets say someone accidentally deleted all the whitespaces from a sentence. Write a program to reconstruct the sentence from that stripped out string. Assume you have access to a dictionary function that returns if a given string is a valid word or not.
- NS August 23, 2016 in United States
Example input: thisisavalidsentence
Output: this is a valid sentence
If multiple solutions are possible, any one valid solution should be given. Assume there is always a valid solution. No invalid input will be given.| Report Duplicate | Flag | PURGE
Amazon Algorithm - 0of 0 votes
AnswersIdeal goal:
- stella.rafailov August 23, 2016 in India
Given data set of strings divide them into equivalence classes such that the equivalence relation is fuzzyMatchingOfString
Problem: as far as I know there isn’t a relation function fuzzyMatchingOfString such that it is transitive, i.e. given A,B,C and fuzzyMatchingOfString(A,B), fuzzyMatchingOfString(B,C) does not imply fuzzyMatchingOfString(A,C)
e.g. foo ~ goo and goo~gol but not foo~gol
given that I think we have to compromise about our goal and create a set to each string In our data set – that is n^2 for each run when the basic action is fuzzyMatchingOfString| Report Duplicate | Flag | PURGE
Amazon Algorithm - 1of 1 vote
AnswersDesign a deck of cards that can be used for different card game applications.
- gurunathchoukekar August 17, 2016 in United States for AWS
Please code out what you would need for the deck class and a card class.
Implement a deal method.| Report Duplicate | Flag | PURGE
Amazon SDE-2 Object Oriented Design - -2of 2 votes
AnswersDesign unix file system in database.
- mohit.kum85 August 16, 2016 in United States| Report Duplicate | Flag | PURGE
Amazon Software Developer Database - 0of 0 votes
AnswersGiven the following inputs, return a list of rooms that are available and large enough:
- MM August 04, 2016 in United States
# of people
Start Time
End Time
You should return
total list of rooms
capacity of each rooms
availability| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 2of 2 votes
Answers10000 cameras, 100 hours of video each. 30 fps. Police need to input a plate number and find the path of a suspicious vehicle. (Estimate the size of the video, e.g., blueray disc is 2 hours and 20 GB. No need to scan all of the videos. Estimate the time that a vehicle can be seen between 2 traffic cameras, e.g., 0.3 miles and 30 miles per hour, then select 1 out of 100). Web client, load balancer, servers, db.
- kwangrand July 31, 2016 in United States for Kindle| Report Duplicate | Flag | PURGE
Amazon SDE1 System Design - -3of 3 votes
AnswersGiven a number n.find (l X b) dimension such that it is maximally close .
- ganesh.eng2015 July 30, 2016 in India
E.g:--
12---o/p->4X3 not 6X2
13---o/p->5X3 // as it is close| Report Duplicate | Flag | PURGE
Amazon Backend Developer - 1of 1 vote
Answersgiven a LinkedList like 1->2->3->4->5->6
- ganesh.eng2015 July 30, 2016 in India
Modify it as:
1->6->2->5->3->4| Report Duplicate | Flag | PURGE
Amazon Backend Developer - -1of 1 vote
AnswersThe question is in the image.
- axaysd July 30, 2016 in India
https://s32.postimg.org/xv0x002p1/mcq_1.jpg| Report Duplicate | Flag | PURGE
Amazon - 2of 2 votes
AnswersSwap the elements in Kth position from the start and end of a link list.
- Aussie July 27, 2016 in United States
ex:
input: list: 1,2,4,5,7,8 & K=2
output: 1,7,4,5,2,8| Report Duplicate | Flag | PURGE
Amazon Senior Software Development Engineer Algorithm - 1of 1 vote
AnswersGiven two strings, print all the inter-leavings of the Strings in which characters from two strings should be in same order as they were in original strings.
- mrityunjay21 July 26, 2016 in United States for Payments
e.g.
for "abc", "de", print all of these:
adebc, abdec, adbce, deabc, dabce, etc, etc| Report Duplicate | Flag | PURGE
Amazon SDE-2 Behavioral - 2of 2 votes
AnswersGiven a matrix of positive integers, you have to reach from the top left corner to the bottom right in minimum cost. You can only go one square right, down or diagonally right-down. Cost is the sum of squares you've covered. Return the minimum cost.
- mrityunjay21 July 26, 2016 in India for Payments
e.g.
4 5 6
1 2 3
0 1 2
Answer: 8 (4+1+0+1+2)| Report Duplicate | Flag | PURGE
Amazon SDE-2 Dynamic Programming - 2of 2 votes
AnswersFind the length of maximum number of consecutive numbers jumbled up in an array.
- mrityunjay21 July 26, 2016 in India for Payments
e.g.: 1, 94, 93, 1000, 2, 92, 1001 should return 3 for 92, 93, 94| Report Duplicate | Flag | PURGE
Amazon SDE-2 Arrays - 2of 2 votes
AnswersGiven some resources in the form of linked list you have to canceled out all the resources whose sum up to 0(Zero) and return the remaining list.
- ganesh.eng2015 July 24, 2016 in India
E.g-->> 6 -6 8 4 -12 9 8 -8
the above example lists which gets canceled :
6 -6
8 4 -12
8 -8
o/p : 9
case 3 : 4 6 -10 8 9 10 -19 10 -18 20 25
O/P : 20 25| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm