Recent Interview Questions
- 0of 0 votes
AnswersSteps to get out of complete binary tree
- bibhuprasadpala107 July 02, 2019 in India
You are given two integers A and B. A describes the number of nodes in complete binary tree.
You are B steps away from your destination in the worst case.
Initially, you can be at:
The root node of the tree and can only move bottom of the tree.
Any leaf node of the tree and can only move up the tree.
Find and return an array of integers C of size 2
where
C[0]: The number of nodes which are at B steps from the root, i.e. the number of nodes such that,
starting at that root, you have to take
B steps downwards to reach the node.
C[1]: The number of nodes such that the maximum distance from the node to any leaf in the subtree of the node is B.| Report Duplicate | Flag | PURGE
xyz SDE1 - 0of 0 votes
AnswersGeneral issues related to AOL email
- dpkshrma24612 July 02, 2019 in United States
AOL email customers report these issues to the particular assistance gathering to fix it.
Dismissal username and mystery state.
Bungle to send or get messages.
Email server down.
Particular goof to import email contacts.
Particular insufficiency to synchronize various messages.
Foundation issue with AOL email application.
Bungle in the midst of web setting.
Unfit to clear history or treats of messages.
These all issues can be lit up by its specific assistance bunch by methods for dial AOL Tech Support Number +1-844-446-0270. The organization of customer support is always reachable for all customers, thusly, customers can get in touch with them at whatever point they anticipated that help should separate their worry.| Report Duplicate | Flag | PURGE
A9 Analyst - 0of 0 votes
AnswersGiven two numbers m and n. Find all numbers between these two numbers such that difference between adjacent digit is 1
- neer.1304 July 01, 2019 in United States
For ex m =0 n =22
O/p - 0,1,2,3,4,5,6,7,8,9,10,12,21| Report Duplicate | Flag | PURGE
Amazon SDE-2 Algorithm - 0of 0 votes
AnswersFind 'k' largest element in stream of integers.
- neer.1304 July 01, 2019 in United States
Constraints -
1) k can vary for every query
2) Stream can not be stored| Report Duplicate | Flag | PURGE
Visa Staff Engineer design - 1of 1 vote
AnswersGet the sum of all prime numbers up to N. primeSum(N).
- acoding167 July 01, 2019 in United States
Follow-up: If primeSum(N) is frequently called, how to optimize it.| Report Duplicate | Flag | PURGE
Amazon - 0of 0 votes
AnswersN number of balloons are kept at different heights. You are asked to find out number of arrows to burst them. When an arrow hits the balloon it goes one level down.
- Raj June 27, 2019 in United States
Assume that the balloons are having same size.
for example given the balloons heights as array(Array will be given in decreasing order of size) :
5 4 3 3 2 2 1 1 1
minimum number of arrows to shoot them is: 3
explanation:
using first arrow shoot: 5 4 3 2 1
using second arrow shoot: 3 2 1
using third arrow shoot: 1
Example 2:
5 4 2 1
minimum number of arrows to shoot them is: 2
using first arrow shoot: 5 4
using second arrow shoot: 2 1
Expecting the solution to be in O(1) space complexity.| Report Duplicate | Flag | PURGE
Walmart Labs Java Developer Algorithm - 0of 0 votes
AnswersIn a garden, there are several apples trees planted in a grid format. Each point (i,j) in the grid has |i| + |j| apples.
Allie can buy a square plot centred at (0,0). Find the minimum perimeter of the plot (1 unit having length = 1) such that she can collect at
least X apples. All plants on the perimeter of the plot are also included.
Sample:
- bertram_gilfoyle June 27, 2019 in IndiaInput = 1 Output = 8 input = 11 Output = 8 Input = 13 Output = 16
| Report Duplicate | Flag | PURGE
Amazon SDE1 Algorithm - 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 - 0of 0 votes
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++ - 0of 0 votes
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 - 0of 0 votes
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
Open Chat in New Window