## Recent Interview Questions

- 1of 1 vote

AnswersGiven a list of player names and their scores – {Carl, 70; Alex, 55; Isla, 40}, design a data structure that can support following modules in optimal time-

- neer.1304 July 03, 2019 in United States

i) updateEntry(string name)

ii) getEntryFromRank(int rank)| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswersGiven an input stream of boolean values, design a data structure that can support following modules in optimal time-

- neer.1304 July 03, 2019 in United States

i) setTrue(index)

ii) setFalse(index)

iii) setAllTrue()

iv) setAllFalse()

v) getIndex(index)| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 1of 1 vote

AnswersGiven two strings, A and B, of equal length, find whether it is possible to cut both strings at a common point such that the first part of A and the second part of B form a palindrome.

- neer.1304 July 03, 2019 in United States

Extension1. How would you change your solution if the strings could be cut at any point (not just a common point)?

Extension2. Multiple cuts in the strings (substrings to form a palindrome)? Form a palindrome using a substring from both strings. What is its time complexity?| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswersGiven a stream of integers, a value k and a value w, consider the integers in the window w and chop off greater k and smaller k elements from the window w. From the remaining elements, compute the average.

- neer.1304 July 03, 2019 in United States| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswersImplement the version control map system which takes the snapshot of the versions of data. Implement the following functions:

- neer.1304 July 03, 2019 in United States

put(key, value) -> puts the value again the key in the latest version of the map

get(key) -> get the value of the key for the latest version of the data

snapshot() -> take a snapshot and increment the version

getValVersion(version id, key) -> return value of the key of the particular version| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswerGiven various subsequences of an array, print the overall array:

- neer.1304 July 03, 2019 in United States

Example: [1, 3, 5], [1, 3, 9], [9, 5]

Array : [1, 3, 9, 5]| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswerA graph has N vertices numbered from 1 to N. We have two lists. One list M consisted of edges between vertices. The other list K consists of restricted paths. We have to add edges one by one from M and check whether the addition of the particular edge leads to a path between the restricted edges given in K. If it creates a path, we have to discard the edge.

- neer.1304 July 03, 2019 in United States

Example: N = 4; K = {(1, 4)}; M = {(1, 2), (2, 3), (3, 4)}. Here, addition of edge (3, 4) will create a path between 1 and 4. Hence we discard edge (3, 4)| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswersYou are given 2 strings which are exactly same but 1 string has an extra character. Find that character.

- neer.1304 July 03, 2019 in United States| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswerYou are given an array of million numbers and provided a range of index (say left, right). For multiple queries, each with input left and right indexes, output the maximum in that range.

- neer.1304 July 03, 2019 in United States| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 0of 0 votes

AnswersGiven (x, y) coordinates, create a function such that each coordinate is uniquely mapped to an integer. Also make sure that given an integer, you should be able to find (x, y) coordinates. So F(x, y) = z and also that inverse F(z) = (x, y).

- neer.1304 July 03, 2019 in United States| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 1of 1 vote

AnswerWe have to paint n boards of length {A1, A2…An}. There are k painters available and each takes 1 unit time to paint 1 unit of board. The problem is to find the minimum time to get

- neer.1304 July 03, 2019 in United States

this job done under the constraints that any painter will only paint continuous sections of boards, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}.

Input : k = 2, A = {10, 10, 10, 10}

Output : 20.

Here we can divide the boards into 2

equal sized partitions, so each painter

gets 20 units of board and the total

time taken is 20.

Input : k = 2, A = {10, 20, 30, 40}

Output : 60.

Here we can divide first 3 boards for

one painter and the last board for

second painter.| Report Duplicate | Flag | PURGE

Google Software Engineer Algorithm - 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 India`Input = 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

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window