SDE-2 Interview Questions
- 0of 2 votes
AnswersDesign Amazon prime video
- koustav.adorable July 07, 2018 in Dublin for AWS| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - -1of 1 vote
AnswersHow is design review done?
- abc.xyz June 19, 2018 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Software Design - 0of 0 votes
AnswersGiven an alphabet where we do not know the order of the letters also do not know the number of letters.
- teli.vaibhav May 14, 2018 in United States
We are give an input list of tuples where each entry in the list gives an ordering between the 2 letters
Determine the alphabet order.
Ex-
<A, B>
<C, D>
<C, E>
<D, E>
<A, C>
<B, C>
Order is A, B, C, D, E| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersImagine a horizontal corridor bounded by y = y1 and y = y2 lines on a 2D-plane. There are N sensors with centers (x, y) each of which operates in a range (r) on the plane . So, they cover some circular areas on the plane. See the figure below.
o | _____o___o__|____________ y = y1 o |OOO __________oo|_____O______ y = y2 O | O _ _ _ _ _ _ | _ _ _ _ _ _ | o O | o O O | | O | |
The question is whether a path exist from x=-inf to x=+inf via corridor without being detected any radar.
Constraints:
1. You are free to move any direction only if you stay in the corridor.
2. You are free to go through corridor borders.
3. N sensors are given as list of (x, y, r) like [(1, 3, 2), (-1, -3, 4)]. x and y are signed integers. r is a unsigned integer.
4. y1 and y2 are integers.
My solution:
1. Create an intersection graph of N sensors by comparing them each other via Euclidean distance(x1 - x2)^2 + (y1 - y2)^2 <= (r1 + r2)^2
2. If there is a path between y=y1 and y=y2 through intersected sensors, there do not exist any path from x=-inf to x=+inf. Otherwise, there do exist a path. So, I used BFS to search such a path.
Worst Case Complexity:
1. O(n^2)
2. O(V + E) = O(n + intersection_count)Total: O(n^2)
My Best Case Optimization for Intersection Graph:
- engineer06 April 29, 2018 in United States
1. For each sensor, create two events for start and end of circles vertically. y = (y1 - r) and y = (y1 + r)
2. For each sensor, register those two events into an array.
3. Use a line sweep algorithm over 2, which is O(nlogn + intersection_count) and intersection_count may be n^2 at worst case.
I wonder if I should have had a better solution with the worst case < O(n^2).| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswerLongest increasing subsequence, Number of Island, Basic SQL questions like joins, select statement etc, Code for finding the Name in the document. Like based on the property of name (which cannot be written in small case). Find its frequency.
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 Java - 0of 0 votes
AnswersDesign online movie ticket system. Hardware and software capabilities, improvements etc
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 System Design - 0of 0 votes
AnswersA number of islands. All the rounds had basic DB questions
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 Java - 0of 0 votes
AnswersBasic DB questions like joins, aggregations, primary keys etc
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 - 0of 0 votes
AnswersNumber of islands. Big(O).
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 Java - 0of 0 votes
AnswersIn the doc file the "Name" without any dictionary. Like finding the property of the name as Starts with the capital letter. Then find the frequency of only names present in the doc. Whiteboard coding
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 Java - 0of 0 votes
AnswerLongest Increasing Subsequence
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 Java - 0of 0 votes
AnswersOnline movie ticket booking system design
- Aspiring_coder March 29, 2018 in United States| Report Duplicate | Flag | PURGE
Zulily SDE-2 - 0of 0 votes
AnswersDesign a system to forward 20% of your requests to cloud datacenter and rest to onprem data center. comsider you are fwd api.
- somone March 25, 2018 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 - 0of 0 votes
AnswersDesign S3 file storage system.
- somone March 25, 2018 in United States| Report Duplicate | Flag | PURGE
Expedia SDE-2 - 0of 0 votes
AnswersLast Man Standing
- pragramticProgrammer March 09, 2018 in United States
A king gathers all the men in the kingdom who are to be put to death for their crimes, but because of his mercy, he will pardon one. He gathers the men into a circle and gives the sword to one man. The man kills the man to his left, and gives the sword to the man to the dead man's left. The last man alive is pardoned.
With 5 men, the 3rd is the last man alive.
Write a program that accepts a single parameter: a number N that represents the number of criminals to start with. The program should output the number of the last two men alive.
Example #1: myProgram 5
would output:
5, 3
Example #2: myProgram 7
would output:
3, 7| Report Duplicate | Flag | PURGE
Amazon SDE-2 - 0of 0 votes
AnswerThis is a word splitter program, I wanted to know the complexity of this program:
- pragramticProgrammer March 08, 2018 in United StatesString s = //"The quick fox jumped over a lazy dog"; "The Java language provides special support for the string " + "concatenation operator ( + ), and for conversion of other " + "objects to strings. String concatenation is implemented " + "through the StringBuilder(or StringBuffer) class and its " + "append method. String conversions are implemented through " + "the method toString, defined by Object and inherited by " + "all classes in Java."; int charLimit = 13; System.out.println("-------------"); char[] chars = s.toCharArray(); boolean endOfString = false; int start = 0; int end = start; while(start < chars.length-1) { int charCount = 0; int lastSpace = 0; while(charCount < charLimit) { if(chars[charCount+start] == ' ') { lastSpace = charCount; } charCount++; if(charCount+start == s.length()) { endOfString = true; break; } } end = endOfString ? s.length() : (lastSpace > 0) ? lastSpace+start : charCount+start; System.out.println(s.substring(start, end)); start = end+1; }
| Report Duplicate | Flag | PURGE
SDE-2 String Manipulation - 0of 0 votes
AnswersAisles contain products. Product is only going to be in one Aisle.
- plasmalightwave March 04, 2018 in United States
Product{
AisleID: string
ProductID: string
Price: float
}
Given Array<Product>, find the N highest price combinations. Combination is 1 product from each aisle. You can choose only one instance of each product.
So if you had two aisles
1: {$5,$4,$2}
and
2: {$6,$1)
And they asked for the 2 highest combos you would give $6,$5 and $6,$4| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersFill the arrow with zeros in n*n matrix.{{0,0,0,0,0,0,0
- Tom February 19, 2018 in United States
0,0,1,1,1,0,0
0,0,1,0,1,0,0
0,0,1,0,1,0,0
0,1,0,0,0,1,0
0,0,1,0,1,0,0
0,0,0,1,0,0,0}}| Report Duplicate | Flag | PURGE
Honeywell SDE-2 - 0of 0 votes
AnswersGiven a math expression in string format that contains only + & - and numbers. Return the sum in integer format. Eg: Input: "3+4-7+13" Output: 13.
- deepakSU February 19, 2018 in United States
"2+1-8+13" Output: 8| Report Duplicate | Flag | PURGE
Adobe SDE-2 - 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 - 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
Answersgiven two array of elements representing the connection Nodes output the topology used?
- ASimpleCoder October 15, 2017 in India
Topology can be either Bus , circular or Star
input:
Number of nodes 3
Number of Connections : 2
{1,2}
{2,3}
Output Bus
Explanation
the topology formed would be 1->2->3 . hence Bus
input
number of nodes : 3
Number of connections : 3
{1,2,3}
{2,3,1}
Output: Circular
the topology formed is 1->2->3->1
hence circular
input:
number of nodes : 5
Number of connections : 5
2 3 4 5
1 1 1 1
Answer : StarTopology
Explanation : A star can be formed with this input
2 4
1
3 5
StarTopology| Report Duplicate | Flag | PURGE
Starup SDE-2 - 0of 0 votes
AnswersDesign a system which helps to calculate average Skype call duration per day. In which events are tracked from mobile app. Need to take care of all edge cases like events can be logged to server in any sequence & there can be some events missing on server side also.
- gauravkumar1491 October 07, 2017 in India| Report Duplicate | Flag | PURGE
Microsoft SDE-2 System Design - 1of 3 votes
AnswersA message containing letters from A-Z is being encoded to numbers using the following mapping:
- MM September 26, 2017 in United States
'A' -> 1
'B' -> 2
...
'Z' -> 26
Given an encoded message containing digits, determine the total number of ways to decode it.
For example,
Given encoded message "12", it could be decoded as "AB" (1 2) or "L" (12).| Report Duplicate | Flag | PURGE
SDE-2 Algorithm - 0of 0 votes
AnswersDesign online multiplayer generic board game (like chess). How will you store sessions.(RDBMS or REDIS) How will the
- gauravkumar1491 September 13, 2017 in India
competitor be chosen and notified(HTTP or what?).
What are the appropriate classes?| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - 0of 0 votes
AnswerDesign Recommendation system. How will you generate generate recommendations for millions of users. DB Schema, How will you improve latency? if the user is searching a item, when will you show next recommendations. How will you update, latency basically and consistency.
- gauravkumar1491 September 13, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - 0of 0 votes
AnswersYou are provided with 2D char array. You have to provide the 2D char array as response which contains the multiplication od the input array. For eg: input=> {{a,b},{c,d}}, output => {{a,c},{a,d},{b,c},{b,d}}
- gauravkumar1491 September 13, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 Coding - 0of 0 votes
AnswersYou are provided with different Excel files and the data format those files contain. You are also provided with low level parser. You have to design a system which takes the excel file and its data type as the input and returns the list of Data objects in the file.
- gauravkumar1491 September 13, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design - 1of 1 vote
AnswersDesign JProfiler. How will you design datastructure and why, function stacktrace. HLD+LLD
- gauravkumar1491 September 13, 2017 in India| Report Duplicate | Flag | PURGE
Amazon SDE-2 System Design