SDE-3 Interview Questions
- 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 - 1of 1 vote
AnswerI was asked during a virtual onsite to design a chat server. I was interviewing for a senior software engineer position. Here are some of the requirements:
- codemonkey August 11, 2020 in United States
- real time communication.
- offline handling
- multi-device supports.
Luckily, I was well prepared for system design interview questions. Thanks to system design interview - an insider's guide book on amazon and system design primer. Still waiting for the response. Wish me luck!| Report Duplicate | Flag | PURGE
Google SDE-3 System Design - 0of 0 votes
AnswersGiven array of ball size we need to return the sum of shadow balls
- Dinesh Pant June 01, 2020 in India
For example
7 3 2 8 1
shadow ball of 7 ---> 3, 2, 1
shadow ball of 3 ---> 2, 1
shadow ball of 2 ---> 1
shadow ball of 8 ---> 1
Output ---> 3+2+1+1 --> 7
Complexity should be better than 0(n^2)| Report Duplicate | Flag | PURGE
Microsoft SDE-3 Algorithm - 0of 0 votes
AnswersDesign twitter trending topics feature to show trending topics in past 24 hours.
- neer.1304 May 24, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Computer Architecture & Low Level - 0of 0 votes
AnswersGiven a binary matrix of size M * N. You are given H and V where H denotes the number of horizontal cuts and V represents number of vertical cuts. You need to find whether you can make H and V amount of cuts such that each submatrix formed after the cuts will have equal number of 1. E.g.
- neer.1304 May 16, 2020 in United States
4 5
1 1 1 1 1
0 0 1 1 1
0 1 1 1 1
1 0 1 1 1
Given H=1 and V=3, we can make 1st horizontal cut after 2nd row and 3 vertical cuts after 2nd, 3rd and 4th column such that each of the sub matrix will have equal number of 1s.
| ----------------|
| 1 1 | 1 | 1 | 1 |
| 0 0 | 1 | 1 | 1 |
| ----------------|
| 0 1 | 1 | 1 | 1 |
| 1 0 | 1 | 1 | 1 |
| ----------------|| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven a remote having 0-9 digits, plus button (to increase channel), minus (to decrease) and previous channel button (to go to previous channel). We were given 2 numbers stating start and end channel number and an array having various channel numbers. The task is to go to all channel numbers given in array with minimum number of clicks.
- neer.1304 May 16, 2020 in United States| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersSmallest string
- sobby May 03, 2020 in India
You are given the following :
1. Two strings S and T each of Length N
2. K Pairs of integers L(i) and R(i) (0 <= l(i) < R(i) <= N-1)
You can perform any of the following two operations any number of time.
1. You can replace the character of string S at the ith position with the character of string T at the ith position
2. You can select from any provided K pairs and you are allowed to swap characters at position L(i) and R(i) in string T
Now, you are required to perform all the operations optimally so that string S can be lexographically smallest.
All characters of S and T are of lowercase English letters and there are only two ways to perform all the operations either(111...1) then (2222...2) or (2222...2) then (1111.1)
Input Format :
1. First line contains number of test cases:
2. Second line contains the lengths of string and the number of pairs of integers.
3. Next two line contains S and T two strings.
4. The next K lines contains the space separated integers.
Sample Input :
1
8 4
abagfiab
cbacbcda
0 1
1 2
3 4
4 5
sample output : aaabccaa| Report Duplicate | Flag | PURGE
PayPal SDE-3 Algorithm - 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 - 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 - 1of 1 vote
AnswersGiven directory change command -
- neer.1304 June 10, 2019 in United States
cd a/b/../c/d/e/../../
Output the visit count for each directory such as -
Root - 1
a - 2
b - 1
c - 2
d - 2
e - 1| Report Duplicate | Flag | PURGE
Amazon SDE-3 Algorithm - 0of 0 votes
AnswersGiven multiple tuples in the form of (A,B) where A is the parent and B is the child in a binary tree, find if the input is valid or not. 4 error conditions were provided:
- neer.1304 May 31, 2019 in United States
1. If a parent has more than 2 children,
2. If duplicate tuples entered,
3. If the tree has a cycle,
4. If more than one root possible.
For violation of multiple validity conditions, print the condition coming first in the above order.
If the input is valid, print the tree in a serial representation. For eg: If input is (A,B), (B,C), (A,D), (C,E) , output: (A(B(C(E)))(D))| Report Duplicate | Flag | PURGE
Swiggy SDE-3 Algorithm - 0of 0 votes
AnswersDesign a catalog system – Restaurants, Items, Categories, VariantGroups like Size, Variants like (S,M,L), AddOnGroups like Extra cheese, AddOns like White Cheese, Yellow Cheese. Price of item will vary on variant selected and even addon price will vary on variant selected.
- neer.1304 May 31, 2019 in United States| Report Duplicate | Flag | PURGE
Swiggy SDE-3 Software Design - 1of 1 vote
AnswersDesign Flipkart Flash sale architecture. 2 million hits and 20k orders in 2 sec.
- neer.1304 May 31, 2019 in United States| Report Duplicate | Flag | PURGE
Swiggy SDE-3 Software Design - 0of 0 votes
AnswersGiven character a-z find out nth permutation. Where all permutation are only ascending. For e.g
- neer.1304 May 31, 2019 in United States
Given characters a,b,c. valid permutations are : a,b,c,aa,ab,ac,bb,bc,cc,aaa,aab,aac,abb,acc,baa,bab,bac,bbb,bbc,bcc,caa,cab,cac,cbb,cbc,ccc
Ex- 4th permutation is : aa| Report Duplicate | Flag | PURGE
Swiggy SDE-3 Algorithm - 0of 0 votes
AnswersGiven customer Geo Location(Lat-Long) and List of Restaurants. Each restaurant consist of :
- neer.1304 May 31, 2019 in United States
- Lat long of restaurant
- Name
- List of Items, where each item has
- Item Name
- Prep Time
- Sensitivity ( Low, Medium, High). Lower sensitive items like Icecream cannot be delivered more than 2 KM.
- Find out List of Restaurant Given Customer and Cart is Empty
- Find out SLA(Time to deliver) given cart, restaurant and Cutomer
- Parameters should be Configurable like Sensitivity, Max prep time etc| Report Duplicate | Flag | PURGE
Swiggy SDE-3 design - 1of 1 vote
AnswersYou have a plot with a limited amount of points on it.
Find the cluster of points, which contains the biggest amount of point grouped together.
Conditions:
The cluster means, that points are placed not farther than 5 units (Can be measured px, cm, etc.) between each other. The distance is calculated by where|x1-x| < 5
and
|y1-y| < 5
The cluster should contain at least 3 points.
- denis.zayats May 30, 2019 in United States
If there are a few clusters with the same amount of points - return all of them.
Example:
The points are:
(15,116), (1345, 123), (456, 11), (34, 17), (19, 112), (556, 111), (454, 15), (12, 120).
In this case, the best cluster is (15,116), (19, 112), (12, 120)| Report Duplicate | Flag | PURGE
Google SDE-3 Algorithm - 0of 0 votes
AnswerThere is a queue which contains some data. There are multiple applications running as distributed systems. These application reads data from the queue and stores them in the DB. But it should store the data in the same order in which it is present in the queue.
- Juvenik May 05, 2019 in India| Report Duplicate | Flag | PURGE
makemytrip SDE-3 - 0of 0 votes
AnswersYou have a database table that stores information about the price change of various product with time. It's append only table. Whenever the price of the product p1 is changed to c1 at time t1, a new row will be appended.
- neer.1304 April 11, 2019 in United States
product_id price time
p1 10 4
p2 40 4
p1 20 5
p1 25 6
p2 55 7
...
Write an SQL query that will give the price of every product at time t1.
e.g. at time 6
product_id price
p1 25
p2 40
Note: Consider the case where two updates are made at the same time. Don't assume that the table is sorted by time.| Report Duplicate | Flag | PURGE
Walmart Labs SDE-3 SQL - 0of 0 votes
AnswersFind a subarray with a give sum
- Nits April 08, 2019 in India| Report Duplicate | Flag | PURGE
Amazon SDE-3 - 0of 0 votes
AnswersDesign payments system like Google Pay or Paytm.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design - 0of 0 votes
AnswersDesign QR code system for a grocery shop.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design - 1of 1 vote
AnswersYou have a bit pattern and an infinite stream of bits coming in. You need to raise an alarm whenever the given pattern comes. Storing the stream is not allowed.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 Algorithm - 0of 0 votes
AnswerDesign a Notification Service. Notification can be sent to multiple devices.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design - 0of 0 votes
AnswersDesign a job workflow system wherein a job is defined as sequence of steps. This system will take jobs and execute as per the steps in job. The steps can be conditional(if this then do this else do that). This system should be able to handle multiple jobs, should be fault tolerant etc
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design - 0of 0 votes
AnswersDesign and implement a Message broker which can handle high throughput and is fault tolerant.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design - 0of 0 votes
AnswersDesign a workflow system. You need to implement pause/continue operations of the workflow using your database. Essentially, the interviewer was looking completely manage workflow system using database.
- neer.1304 April 07, 2019 in United States| Report Duplicate | Flag | PURGE
Uber SDE-3 System Design