.Net/C Interview Questions
- 0of 0 votes
AnswersYou are required to collect N numbers from a bag. Initially, the bag is empty. Whenever you put a number X in the bag, then the owner of the bag asks the question.
- Sameer June 21, 2019 in United States
The questions are as follows:
. What is the greatest integer that is smaller than X and present inside the bag?
. What is the smallest number that is greater than X and present inside the bag?
If you answer both the questions correctly, then you can put X inside the bag. Your task is to answers the questions that are asked by the owner of the bag. If no such numbers exist in the bag print -1.
Example:
5 (Number of elements in the bag)
1
4
2
3
7
output:
-1 -1
1 -1
1 4
2 4
4 -1| Report Duplicate | Flag | PURGE
Amazon Java Developer Data Structures - 1of 1 vote
AnswersGuide me on off-page SEO activities and Google updates and algorithms. Some off page SEO activities such as directories, social bookmarking is not beneficial for website. I cannot understand which off page activities perform for website ranking, therefore if you’ve any new technique of off page. Please suggest me any reliable SEO company. Please suggest me new factors in SEO off page.
- aliza decruz June 21, 2019 in United States| Report Duplicate | Flag | PURGE
What’re new factors in SEO Off page? - 0of 0 votes
AnswersAre you facing problems in dealing with your Apple products? Take it easy. We are available to resolve all your problems. Get help by Apple Support to solve all your technical issues related to your Apple products. Apple has more than 1.4 billion active users which has trust on its product. Sometimes, some faults may occur in it because of its continuous use. Some of these faults include MacBook keyboard stops working, Overheating of MacBook Pro, Delayed products, throttling phones and dubious replacement batteries; there are a lot of cases of Apple watch explosion, gaseous ipads and iPhones. To fix these issues, you have to dial our Toll Free Number and get connected with our experts. For further information, visit our web portal.
- martinluthar June 21, 2019 in United States| Report Duplicate | Flag | PURGE
Apple Phone Number available 24/7 for our Customers Apple support - 0of 2 votes
AnswersGiven an array of integers A. calculate the sum of A[i] %A[j] for all possible i,j pair. return sum%(10^9+7) as an output solve this problem on o(n).
- Dhioyt June 19, 2019 in India
input :-
A=[1,2,3]
Output:-
5
Explanation:-
(1%1)+(1%2)+(1%3)+(2%1)+(2%2)+(2%3)+(3%1)+(3%2)+(3%3)| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 2of 2 votes
AnswerSelect a random point uniformly within a rectangle, (The side of rectangle is parallel to the x/ y grid).
- acoding167 June 19, 2019 in United States
Follow-up: Given multiple non-overlapped rectangles on the 2D grid, uniformly select a random point from the rectangles.| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersCode an algorithm for a game consisting of two players. The input is a positive integer x. Each round, a player deducts a perfect square from the number. The player can choose any perfect square as long as it is less than or equal to the current number and greater than 0. The current player wins if the number becomes 0 after his deduction.
- Thomas June 19, 2019 in United States| Report Duplicate | Flag | PURGE
Salesforce SDE-2 Dynamic Programming - 1of 1 vote
AnswerPrint an unbalanced binary tree in level order with new lines after each level.
- CoderDude7 June 17, 2019 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Python Developer Algorithm - 0of 0 votes
AnswersSay you have two large files (100 TB each) and only 1 MB of RAM. What's an efficient algorithm that will print the missing lines (diff)? The files don't necessarily contain duplicates.
- CoderDude7 June 17, 2019 in United States
The two files are not sorted and could have different ordering in both files.
e.g.:
File1 File2
A B
B A
C C
D E
F D
F
Output:
File 2: E
The input are two large files (containing strings).
The output is a list of strings telling you the presence of a line in File X and not in File Y.| Report Duplicate | Flag | PURGE
Bloomberg LP Python Developer Algorithm - 0of 0 votes
AnswerQuestion 2: Optimize the problem for total project cost and total project days to minimal.
- ratneshtr09 June 15, 2019 in United States
Given the cost/hour of each worker:
[ 30, 25, 40 ]| Report Duplicate | Flag | PURGE
Intel SDE1 - 0of 0 votes
AnswersQuestion 1:
- ratneshtr09 June 15, 2019 in United States
There is a bunch of tasks, each task has a code with different time to complete and task dependencies. There are few workers, how to allocate the task to these workers to minimize the total time taken to complete the task.
Example:
No of worker: 3
Task id, Task Time, Task dependency:
1, 2, 0
2, 4, 1
3, 7, 0
4, 12, 1
Question 2: Optimize the problem for total project cost and total project days to minimal.
Given the cost/hour of each worker:
[ 30, 25, 40 ]| Report Duplicate | Flag | PURGE
Intel SDE1 C++ - 1of 1 vote
AnswersYou have three Arrays.
- monowar1993 June 14, 2019 in Netherlands for Android
A = {2, 5, 3, 2, 8,1}
B = {7, 9, 5, 2, 4, 10, 10}
C = {6, 7, 5, 5, 3, 7}
make an array from this three arrays which elements is present in at least two array.
This question was followed by instead of three arrays. If you have a list of array then what will be the solution? Also what will be the time complexity?| Report Duplicate | Flag | PURGE
Booking.com Android Engineer Java - 0of 0 votes
AnswersSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.
- ubuntu June 12, 2019 in United States
(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).
You are given a target value to search. If found in the array return its index, otherwise return -1.
You may assume no duplicate exists in the array.
Your algorithm's runtime complexity must be in the order of O(log n).| Report Duplicate | Flag | PURGE
- 0of 0 votes
Answeryou are provided a binary array, and a integer k, choose any k bits of array at a time and flip all the bits, maximize the number of '1's in array.
- aaa June 11, 2019 in United States| Report Duplicate | Flag | PURGE
unknown Student - 0of 0 votes
AnswersP0, P1, ...., Pn players in tournament. In first level, P0 plays with P1, P2 plays with P3 and so on. In level 2, Winner of P0,P1 plays with winner of P2,P3. For i,j output level in which they will face each other assuming they win all games.
- neer.1304 June 11, 2019 in United States| Report Duplicate | Flag | PURGE
Curefit SDE-2 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 a nested list of integers, return the sum of all integers in the list weighted by their depth.
- koustav.adorable June 09, 2019 in United States
Each element is either an integer, or a list -- whose elements may also be integers or other lists.
Different from the question where weight is increasing from root to leaf, now the weight is defined from bottom up. i.e., the leaf level integers have weight 1, and the root level integers have the largest weight.
Example 1:
Input: [[1,1],2,[1,1]]
Output: 8
Explanation: Four 1's at depth 1, one 2 at depth 2.
Example 2:
Input: [1,[4,[6]]]
Output: 17
Explanation: One 1 at depth 3, one 4 at depth 2, and one 6 at depth 1; 13 + 42 + 6*1 = 17.| Report Duplicate | Flag | PURGE
SDE-2 Algorithm - 0of 0 votes
AnswerThere are two thread, Batting thread, and Bowling thread. Batting thread print 1 to 100. Once completed notify to Bowling thread that 'Batting completed.' Java interview questions. If you know please provide complete code.
- routranjanmanas June 08, 2019 in India for 10| Report Duplicate | Flag | PURGE
abc - 0of 0 votes
AnswersGiven range of routing numbers, determine which bank it belongs to.
- neer.1304 June 08, 2019 in United States
Ex-
I/p -(123400,123500, BOA), (12538, 12548, GCU)…
For 123450 - Output BOA
12540 - Output GCU| Report Duplicate | Flag | PURGE
Google Software Engineer Algorithm - -1of 1 vote
AnswersHi there,
- xyz June 08, 2019 in United States
I'm using a Debian 8 system running Strongswan 5.2 to connect to Cloud VPN, but I'm seeing a large amount of packets being dropped. I'm not sure if the problem is on my side, so I need help debugging from the Google side.
11:44:15.127845 IP (tos 0x8, ttl 64, id 0, offset 0, flags [DF], proto ESP (50), length 1500)
204.154.94.43 > 104.198.99.16: ESP(spi=0x926a1ba9,seq=0x5fc78e8), length 1480
11:44:15.127846 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto ESP (50), length 1500)
204.154.94.43 > 104.199.117.182: ESP(spi=0x2afc306c,seq=0x9753df), length 1480
11:44:15.127848 IP (tos 0x8, ttl 64, id 0, offset 0, flags [DF], proto ESP (50), length 1500)
204.154.94.43 > 104.199.124.50: ESP(spi=0x442d978a,seq=0xaae89d4), length 1480
Any ideas?
n3)Please explain briefly how you identified the correct solution, and if there were any other possibilities that you considered?| Report Duplicate | Flag | PURGE
Google Technical Support Engineer - 0of 0 votes
AnswersHi,
- xyz June 08, 2019 in United States
My virtual machine is talking to our on-premise Hadoop cluster and we have observed connections dropped by the VM after approximately 15 minutes after being established. We have tried tweaking our cluster and the VPN, but it did not work. We have also disabled any firewall or NAT: our cluster is connected directly to the Internet. We ran a TCP packet capture on one of our routers and we do see the following:
408 7.963058 178.124.133.65 172.16.72.34 TCP 66 http > 42867 [FIN, ACK] Seq=312 Ack=11 Win=14592 Len=0 TSval=3673141343 TSecr=234006479
409 7.963204 172.16.72.34 178.124.133.65 TCP 66 42867 > http [FIN, ACK] Seq=11 Ack=313 Win=15744 Len=0 TSval=234006482 TSecr=3673141343
410 7.995556 178.124.133.65 172.16.72.34 TCP 66 http > 42867 [ACK] Seq=313 Ack=12 Win=14592 Len=0 TSval=3673141351 TSecr=234006482
Please help, this is a fault in your network, I need a solution ASAP!
n1) If you were to troubleshoot / debug this issue, what areas would you look into to resolve the issue?
n2) Please explain briefly how you identified the correct solution, and if there were any other possibilities that you considered?| Report Duplicate | Flag | PURGE
Google Technical Support Engineer - 2of 2 votes
AnswersFind whether string S is periodic.
- acoding167 June 07, 2019 in United States
Periodic indicates S = nP.
e.g.
S = "ababab", then n = 3, and P = "ab"
S = "xxxxxx", then n = 1, and P = "x"
S = "aabbaaabba", then n = 2, and P = "aabba"
follow up:
Given string S, find out the P (repetitive pattern) of S.| Report Duplicate | Flag | PURGE
Facebook Software Engineer - 0of 0 votes
Answerswrite a JSON validator
- boony June 04, 2019 in United States| Report Duplicate | Flag | PURGE
Facebook Software Engineer Algorithm - 3of 3 votes
AnswersGiven two two integer arrays. Find the longest common subsequence.
- acoding167 June 02, 2019 in United States
eg: a =[1 5 2 6 3 7], b = [5 6 7 1 2 3]. return [1 2 3] or [5 6 7]| Report Duplicate | Flag | PURGE
Google Software Engineer - 0of 0 votes
AnswersFind the location of BCD in String S.
- bottleneck56 June 01, 2019 in United States
Given for example S = BCXXBXXCXDXBCD, then the result should be [[4,7,9],[11,12,13]
find BCBC in String S = BCXXBXCXBCBC
the result should be [[0,1,4,6],[8,9,10,11]]| Report Duplicate | Flag | PURGE
Google - 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 - 0of 0 votes
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
Open Chat in New Window