.Net/C Interview Questions
- 0of 0 votes
AnswerGiven two points on a directed acyclic graph determine their least common ancestor, give it's time complexity, and describe any improvements you could make (if possible).
- neer.1304 August 15, 2019 in United States| Report Duplicate | Flag | PURGE
Indeed SDE-2 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 - 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 - 0of 0 votes
Answersgiven 3 tables:
- crackerfive August 08, 2019 in United States
table_1 has factory, material, date, quantity fields indicating what factory to can produce deliver which material by the specific date.
table_2 has company, material, date, quantity fields indicating what company wants to have some amount of material by the specific date.
table_3 has company, factory, material fields indicating what material a company can buy from which factory.
Write a sql to output a table with company, factory, material, quantity, date fields, for each row, it is the real amount that a factory can deliver to a company
on that date, the quantity might be zero.
If there are more demand than production, a factory takes earlier order or the biggest amount order if both orders have the same demanding date.
sample input
table_1
factory material quantity date
f1 a 100 2010-10-10
f1 b 200 2010-10-10
f1 a 500 2011-11-11
f2 a 300 2010-10-10
table_2
company material quantity date
c1 a 100 2010-10-12
c2 b 200 2010-10-10
c1 a 500 2011-11-11
c3 a 300 2010-10-10
table 3
company factory material
c1 f1 a
c1 f2 a
c2 f1 b
c3 f2 a| Report Duplicate | Flag | PURGE
Apple SQL - 0of 0 votes
AnswersGiven a list of sentences and a list of phrases. The task is to find which sentence(s) contain all the words in a phrase and for every phrase print the sentences number that contains the given phrase.
- Rising star August 07, 2019 in India
Constraint: A word cannot be a part of more than 10 sentences.
Examples:
Input:
Sentences:
1. Strings are an array of characters.
2. Sentences are an array of words.
Phrases:
1. an array of
2. sentences are strings
Output:
Phrase1 is present in sentences: 1,2
Phrase2 is present in sentences: None
Since each word in phrase 1 exists in both the sentences,
but all the words in second phrase do not exist in either.| Report Duplicate | Flag | PURGE
Flipkart SDE1 Algorithm - 0of 0 votes
AnswersYou are given a list of edges in a graph and for each pair of vertices that are connected by an edge, there are two edges between them, one curved edge and one straight edge i.e. the tuple (x, y, w1, w2) means that between vertices x and y, there is a straight edge with weight w1 and a curved edge with weight w2. You are given two vertices a and b and you have to go from a to b through a series of edges such that in the entire path you can use at most 1 curved edge. Your task is to find the shortest path from a to b satisfying the above condition.
- Rising star August 07, 2019 in India| Report Duplicate | Flag | PURGE
Uber Software Engineer / Developer Algorithm - 0of 0 votes
AnswerYou are given a n x m grid consisting of values 0 and 1. A value of 1 means that you can enter that cell and 0 implies that entry to that cell is not allowed. You start at the upper-left corner of the grid (1, 1) and you have to reach the bottom-right corner (n, m) such that you can only move in the right or down direction from every cell. Your task is to calculate the total number of ways of reaching the target.
- Rising star August 07, 2019 in India
Constraints :-
1<=n, m<=10, 000| Report Duplicate | Flag | PURGE
Uber Software Engineer / Developer Algorithm - 0of 0 votes
AnswerThere is a meeting scheduled in an office that lasts for time t and starts at time 0. In between the meeting there are n presentations whose start and end times are given i.e. the ith presentation starts at s[i] and ends at e[i]-1. The presentations do not overlap with each other. You are given k, the maximum number of presentations that you can reschedule keeping the original order intact. Note that the duration of the presentation can't be changed. You can only change the start and end time. Your task is to maximize the longest time period in which there is no presentation scheduled during the meeting.
- Rising star August 07, 2019 in India
Constraints :-
1<=t<=1, 000, 000, 000
0<=k<=n
1<=n<=100, 000
e[i]<=s[i+1], 0<=i <n-1
s[i] < e[i] for 0<=i<=n-1| Report Duplicate | Flag | PURGE
Uber Software Engineer / Developer Algorithm - 0of 0 votes
Answerswhich is the best solution for data flow AWS Glue and Redshift DWH or SSIS and Redshift DWH, and why
- Gayatri August 06, 2019 in United States| Report Duplicate | Flag | PURGE
Data analysis - 0of 0 votes
Answerswhat kind of source, etl tool and reporting tool will you choose while designing a data flow ETL and Reporting solution using both AWS and Microsoft technolgies.
- Gayatri August 06, 2019 in United States| Report Duplicate | Flag | PURGE
Data analysis - 0of 0 votes
AnswersData sets: Bank_Branch(Branch_id, branch_nm), Customer_Branch(cust_id,branch), Deposit_Branch (cust_id,branch_nm,deposit_am)
- HR August 03, 2019 in United States
Question: Find customers who made deposits in all the branches in a given city.| Report Duplicate | Flag | PURGE
None SQL - 0of 0 votes
AnswersGiven user login information - name, event(login/out), event_time. Find hours spend per user. If a hourly rate is given, find the charges per user for given time.
- HR August 03, 2019 in United States| Report Duplicate | Flag | PURGE
None SQL - 0of 0 votes
AnswerPrint numbers that matches with the index in given non-duplicate unordered array.
- HR August 03, 2019 in United States| Report Duplicate | Flag | PURGE
None Algorithm - 0of 0 votes
AnswersWrite a program to encode a string from --> ABABXBYZXXX --> X4B3A2Y1Z1 (what should be the storage requirements for optimal conversion of 10TB file)
- HR August 03, 2019 in United States| Report Duplicate | Flag | PURGE
None 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 - 0of 0 votes
AnswersHow to do deal with cheap flight Norwegian Air and get any information through their customer service toll-free number?
- emmawattson057 August 02, 2019 in United States for New York| Report Duplicate | Flag | PURGE
https://www.reservationsdeal.com/blog/korean-air-change-flight Korean Air Change Flight Korean Air Change Flight - 0of 0 votes
AnswersGiven an array of integers find the maximum value of a[i] - a[j] + a[k]
- ASimpleCoder August 01, 2019 in India
with constraints i < j < k and a[i] < a[j] < a[k]| Report Duplicate | Flag | PURGE
Uber Software Developer Algorithm - 0of 0 votes
AnswersImplement a comparator class that is capable of sorting by multiple key/order pairs, each pair being a tiebreaker for the previous.
- neer.1304 July 28, 2019 in United States| Report Duplicate | Flag | PURGE
Stripe Software Engineer Object Oriented Design - 0of 0 votes
AnswersYou're running a pool of servers where the servers are
- neer.1304 July 28, 2019 in United States
numbered sequentially starting from 1. Over time, any
given server might explode, in which case its server
number is made available for reuse. When a new
server is launched, it should be given the lowest available number.
Write a function which, given the list of currently
allocated server numbers, returns the number of the next server to allocate.
For example, your function should behave something like the following:
>> next_server_number([5, 3, 1])
2
>> next_server_number([5, 4, 1, 2])
3
>> next_server_number([3, 2, 1])
4
>> next_server_number([2, 3])
1
>> next_server_number([])
1
Server names consist of an alphabetic host type (e.g. "apibox") concatenated with the server number,
with server numbers allocated as before (so "apibox1",
"apibox2", etc. are valid hostnames).
Write a name tracking class with two operations,
allocate(host_type) and deallocate(hostname).
The former should reserve and return the next
available hostname, while the latter should release
that hostname back into the pool.
# For example:
#
# >> tracker = Tracker.new()
# >> tracker.allocate("apibox")
# "apibox1"
# >> tracker.allocate("apibox")
# "apibox2"
# >> tracker.deallocate("apibox1")
# nil
# >> tracker.allocate("apibox")
# "apibox1"
# >> tracker.allocate("sitebox")
# "sitebox1"| Report Duplicate | Flag | PURGE
Stripe Software Engineer Algorithm - 0of 0 votes
AnswersWrite a map implementation with a get function that lets you retrieve the value of a key at a particular time.
- neer.1304 July 28, 2019 in United States
t:0 A =1
t:2 A = 2
get(A, t:1) -> 1
get(A, t:3) -> 2| Report Duplicate | Flag | PURGE
Stripe Software Engineer Algorithm - 1of 1 vote
AnswersUse synchronized, wait() and notify() to write a program such that below mentioned conditions are fulfilled while reading and writing data to a shared resource.
- neer.1304 July 26, 2019 in United States
When a write is happening, no read or other write should be allowed(read and write threads should wait)
When a read is happening, no write should be allowed (write threads should wait) but. other read threads should be able to read.
Donot use any API classes e.g. ReadWriteLock, AtomicInteger etc..| Report Duplicate | Flag | PURGE
Microsoft SDE-2 Java - 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 - -1of 1 vote
Answers
- shitanshu.tripathi1 July 25, 2019 in IndiaGiven three integers x,y and z you need to find the sum of all the numbers formed by having 4 atmost x times , having 5 atmost y times and having 6 atmost z times as a digit. input x=1,y=1,z=1 output 4+5+6+45+54+56+65+46+64+456+465+546+564+645+654=3675
| Report Duplicate | Flag | PURGE
Student - 0of 0 votes
Answers
- shitanshu.tripathi1 July 25, 2019 in United StatesGiven three integers x,y and z you need to find the all the possible combination of numbers having 4 at most x times, having 5 at most y times and having 6 at most z times as a digit. input x=1,y=1,z=1 output 4 5 6 45 54 56 65 46 64 456 465 546 564 645 654
| Report Duplicate | Flag | PURGE
Student - 0of 0 votes
AnswersA Doctor travels from a division to other division where divisions are connected like a graph(directed graph) and the edge weights are the probabilities of the doctor going from that division to other connected division but the doctor stays 10mins at each division now there will be given time and had to find the division in which he will be staying by that time and is determined by finding division which has high probability. Input is number of test cases followed by the number of nodes, edges, time after which we need to find the division in which he will be there, the edges starting point, end point, probability. Note: If he reaches a point where there are no further nodes then he leaves the lab after 10 mins and the traveling time is not considered and during that 10min at 10th min he will be in next division, so be careful
- alphalabs1.1 July 23, 2019 in India
find the division with highest probability that doctor is in it after 10 min is div 3 and probability is 0.7.
After 9 minutes dr has yet to move to another division he is in div 1 and probability is 1.0. Forty minutes later the division with highest probabilty is 6 and probabilty is 0.77400
input 1 6 10 40 1 2 0.3 1 3 0.7 3 3 0.2 3 4 0.8 2 4 1 4 5 0.9 4 4 0.1 5 6 1.0 6 3 0.5 6 6 0.5
output 1 6 0.774000
input 2 6 10 10 1 2 0.3 1 3 0.7 3 3 0.2 3 4 0.8 2 4 1 4 5 0.9 4 4 0.1 5 6 1.0 6 3 0.5 6 6 0.5
output 2 3 0.700000| Report Duplicate | Flag | PURGE
Samsung Backend Developer - 0of 0 votes
AnswersImplement following method of ScheduledExecutorService interface in Java
- neer.1304 July 23, 2019 in United States
schedule(Runnable command, long delay, TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given period; that is executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on.
scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the given delay between the termination of one execution and the commencement of the next.| Report Duplicate | Flag | PURGE
Uber SDE-2 Algorithm
Open Chat in New Window