.Net/C Interview Questions
- 0of 0 votes
AnswersYou have an integer array. Starting from arr[startIndex], follow each element to the index it points to. You continue to do this until you find a cycle. Return the length of the cycle. If no cycle is found return -1
- rock January 26, 2021 in United States
forexample {1, 0}, 0) => 2
{1, 2, 0}, 0) => 3| Report Duplicate | Flag | PURGE
Goldman Sachs Senior Software Development Engineer Java - 1of 1 vote
AnswersGiven a queue of songs(array of size `n`). A random value `k` is passed which can be less than or equal to `n`. You need to play(print) song at `kth` position, remove it and add it at the end of the queue.
- AllIsWell January 21, 2021 in United States
**Example**:
Song Queue(Array): `[A, B, C, D, E, F, G, H, I, J]`
**1**. k = 3
Song at 3rd position, `C` played(Print) then added at the end of the Queue. Queue becomes
`[A, B, D, E, F, G, H, I, J, C]`
**2**. k = 5
`F` played. Queue becomes
`[A, B, D, E, G, H, I, J, C, F]`
**3**. k = 2
`B` played. Queue becomes
`[A, D, E, G, H, I, J, C, F, B]`
**4**. k = 8
`C` played. Queue becomes
`[A, D, E, G, H, I, J, F, B, C]`
**5**. k = 10
`C` played. Queue becomes
`[A, D, E, G, H, I, J, F, B, C]`
**Time Expectations**:
O(1) when selecting a song
O(1) when removing a song from the queue.
O(1) when adding a song back to end of the queue.| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer Algorithm - 0of 0 votes
AnswerTop Facebook System Design Interview Questions
- theinterviewsage January 04, 2021 in United States
1. Design Facebook News Feed
2. Design Facebook Status Search
3. Design Live Commenting
4. Design Facebook Messenger or WhatsApp
5. Design Instagram| Report Duplicate | Flag | PURGE
Facebook Software Engineer / Developer System 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
AnswersFind the first non-repeated character in a string of characters. For example, 'c' for "abcbae".
- fz November 26, 2020 in United States| Report Duplicate | Flag | PURGE
- 0of 0 votes
AnswersYour input is a double array, and you can use *, +, -, and () parenthesis anywhere to create and output the maximum possible value.
- _M_ November 26, 2020 in India
Ex:
input is {3,4,5,1} --> output: 72
input is {1,1,1,5} --> output: 15
Follow up, if there are numbers <0
Already posted question ( 3yrs back)
my doubt is can we solve this using multiplication only ( special case 0 and 1 we need to use addition for these alone
ie. if ar[i]==1
max(result*ar[i-1]+1,result*ar[i+1]+1)
)| Report Duplicate | Flag | PURGE
Google Senior Software Development Engineer - 0of 0 votes
AnswersAdding an integer to a container or removing an integer from it. Providing an algorithm/method to find the largest integer in the container. (thinking of a larger set of data) (I believe that this question misses a conduction to have a reasonable solution)
- fz November 25, 2020 in United States| Report Duplicate | Flag | PURGE
Senior Software Development Engineer - 0of 0 votes
AnswersNow given any number of balls, you have to tell how many times you have to weigh at minimum to find which ball is the heavier one?
- rehmanmaliik455 November 20, 2020 in United States| Report Duplicate | Flag | PURGE
- 0of 0 votes
AnswersWhat are the steps of the algorithm with order O(m log (mn)) for finding k-th smallest element (or median) of 2D array [1..M] [1..N] where each row of this matrix is sorted and independent from all other rows (ascending order, distinct elements)?
- Google Q November 20, 2020 in United States| Report Duplicate | Flag | PURGE
N/A IIT Exam Algorithm - 0of 0 votes
Answersthere are 3 tables :
- 11gupt November 11, 2020 in United States
Movie = {movie_id, .....}
Actor = {actor_id, gender, .....}
Movie_Actor = {movie_id, actor_id,....}
Find the pair of movie actor ( male) and actress ( female) who appeared in most movies together.| Report Duplicate | Flag | PURGE
SQL - 0of 0 votes
AnswersTablea Order = {order_id, order_timestamp, total_sale_amount, ....}
- 11gupt November 11, 2020 in United States
Note => Trimmed Mean = remove top and bottom 5 percentile data to remove outliers. Take the average of middle 90% of the data.
you can use function percentile(Col_name, 0.95)
output should look like => {Date, raw_average, trimmed_average}| Report Duplicate | Flag | PURGE
SQL - 0of 0 votes
AnswersPhone number for Malwarebytes premium support
- davidbeckam7675 October 20, 2020 in United States| Report Duplicate | Flag | PURGE
assistanceforall Malwarebytes customer service - 0of 0 votes
AnswerPower list has the following conditions
- coder October 16, 2020 in India
first element should b1
Next L2 element should be 2
Next L3 element should be 3
Next L4 element should be 4
Next L5 element should be 5
Next L6 element should be 6
Next L7 element should be 7
Next L6 element should be 6
...
Next L1 should be 1
e.g.,
1 2 3 4 5 6 6 7 6 5 4 3 2 1 -- power list
1 2 3 4 5 6 7 6 5 4 3 2 11 - not a power list since last two elements are 1 .
Wrte a code to find out whether arr [] represents a power list or not.| Report Duplicate | Flag | PURGE
Algorithm - 0of 0 votes
Answersin Cracking the coding interview book 6th edition page 42 says that O(5 * 2^n + 1000 * N^100) = O(2^n)... I tried a sample code and got n^100 is greater than 2^n...
- Surender.sharma08 October 12, 2020 in United States| Report Duplicate | Flag | PURGE
Alcatel Lucent Applications Developer Coding - 0of 0 votes
AnswersCan we write a Fixed LOD inside a Fixed LOD.
- 11gupt October 10, 2020 in United States| Report Duplicate | Flag | PURGE
Tableau None Data analysis - 0of 0 votes
AnswersThere is Tableu dashboard on Production server and you dont have access to it. You have this dashboard with staging data(not production data). This dashboard has performance issue. How will you fix this problem.
- 11gupt October 10, 2020 in United States| Report Duplicate | Flag | PURGE
Tableau None Data analysis - 0of 0 votes
AnswersEmployee Salary Department
- 11gupt October 10, 2020 in United States
A 1000 IT
B 2000 IT
C 3000 IT
D 4000 HR
E 2000 HR
F 1500 IT
G 7000 HR
Write a query to get results like below -
Employee Salary Next highest salary(in same department) Department
A 1000 2000 IT
B 2000 3000 IT
.
.
E 2000 4000 HR| Report Duplicate | Flag | PURGE
Data Engineer - 0of 0 votes
AnswersHouse No Members
- 11gupt October 10, 2020 in United States
1100 John, mary, kim, ash
1101 Dan, Roger, kee
Write a query to get in below format-
House No Person
1100 john
1100 mary
1100 kim
1100 ash
1101 Dan
1101 roger
1101 kee| Report Duplicate | Flag | PURGE
Data Engineer SQL - 0of 0 votes
AnswersIf ( a = True){
- 11gupt October 10, 2020 in United States
If (b = True){
Approve credit card;
}
Else {
Disapprove credit card;
}
}
Else {
If(C=False){
IF(D=True){
Approve Credit card;
}
else {
Diapprove credit card;
}
}
}
Simplify above written code.| Report Duplicate | Flag | PURGE
Data Engineer Java - 0of 0 votes
AnswersWhile designing a Table in database, how will you determine its performance?
- 11gupt October 10, 2020 in United States| Report Duplicate | Flag | PURGE
Data Engineer SQL - 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
AnswerGiven a binary tree, find the maximum product path.
- cricketRipunjoy October 09, 2020 in India
In other words, find the path inside the binary tree which has maximum product.| Report Duplicate | Flag | PURGE
Wells Fargo Analyst Algorithm - 0of 0 votes
AnswersSum of series (n/1) + (n/2) + (n/3) + (n/4) +…….+ (n/n). 1 <= n <= 10^12
- kritirohilla567 September 25, 2020 in India| Report Duplicate | Flag | PURGE
Student SDE1 - 0of 0 votes
AnswersYou are driving a bus along a highway, full of rowdy, hyper, thirsty students and a soda fountain machine. Each minute that a student is on your bus, that student drinks one ounce of soda. Your goal is to drop the students off quickly, so that the total amount of soda consumed by all students is as small as possible.You know how many students will get off of the bus at each exit. Your bus begins somewhere along the highway (probably not at either end) and moves at a constant speed of 37.4 miles per hour. You must drive the bus along the highway; however, you may drive forward to one exit then backward to an exit in the opposite direction, switching as often as you like. (You can stop the bus, drop off students, and turn around instantaneously.)Describe an efficient algorithm to drop the students off so that they drink as little soda as possible. Your input consists of the bus route (a list of the exits, together with the travel time between successive exits), the number of students you will drop off at each exit, and the current location of your bus (which you may assume is an exit). How would you approach this problem
- DaveCS September 25, 2020 in United States| Report Duplicate | Flag | PURGE
Computer Scientist - 0of 0 votes
AnswersWrite 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
AnswerWrite 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
AnswersA Fibonacci sequence is defined recursively by:
- manojgct84 September 17, 2020 in India for Senior Software Engineer
F0 = 0
F1 = 1
Fn = Fn − 1 + Fn − 2, for integer n > 1.
One way of generalizing the Fibonacci sequence is by starting with any pair of numbers and extending to negative values of n.
Given two terms of a generalized Fibonacci sequence Fp and Fq, their positions p and q respectively and a position r, find Fr.
Input Format
The first line of the input contains an integer t denoting the number of test cases.
Each test case contains three lines.
First line of each test case contains two space separated integers p and Fp
Second line contains two space separated integers q and Fq
Third line contains an integer r
Output Format
For each test case, print Fr which is the term of the sequence at position r.
If Fr is not an integer, represent it as an irreducible fraction in the form a/b where b > 0.
Sample Input
0 1
6 13
10
3 65
6 315
-10
0 11
1 -6
2
9 36
15 646
-5
11 72
20 5473
6
Sample Output
89
4620
5
-1/4
13/2| Report Duplicate | Flag | PURGE
Sap Labs Senior Software Development Engineer Java
Open Chat in New Window