## Recent Interview Questions

- 0of 0 votes

AnswersProgram to find the rank student

- Rising star November 05, 2018 in United States| Report Duplicate | Flag | PURGE

unknown freshers Algorithm - 0of 0 votes

Answers1. Input string s. Check if string s is a valid string with valid brackets

- donkeysnore November 05, 2018 in United States

For example:

(({{}})) is a valid s

{[]} is a valid s

[{[}]] is not valid

2. What kind of tests would you conduct to your program to minimize bugs in your program.

3. On the previous example there is only "()", "{}", and "[]" combination of brackets. If other developers want to add a new kind of brackets such as "<>". What kind of changes would change in your previous program.| Report Duplicate | Flag | PURGE

Bloomberg LP Intern Algorithm - 3of 3 votes

AnswersYou have N toffee packets, each containing different number of toffees. The number of toffees contained in the ith packet is denoted by ci. You need to put these toffee packets in 5 boxes such that each box contains at least one toffee packet, and the maximum number of toffees in a box is minimum.

- parni November 01, 2018 in United States

You can only choose consecutive toffee packets to put in a box.| Report Duplicate | Flag | PURGE

Google - 0of 0 votes

AnswersThe difference between move and forward in C++

- parni November 01, 2018 in United States| Report Duplicate | Flag | PURGE

Google C++ - 0of 0 votes

AnswersWe need to declare variable types in C++.

- parni November 01, 2018 in United States

How does this type declaration change the structure of the code comparing to other languages without type declaration like Python?| Report Duplicate | Flag | PURGE

JP Morgan - 0of 0 votes

AnswersGiven a matrix of 0's and 1's find the smallest number of groups made of 1's, where one group can cover up to two 1's at the same time vertically or horizontally.

- matk100.100 October 31, 2018

01111

11011

00100

The matrix above has 5 of such groups. I've seen similar questions but there the question was about groups of adjacent 1's. Here the groups are limited.

Another question how it would change, if the group wasn't limited to two but to given k - number of 1's vertically or horizontally. The time complexity should be the most efficient.

My idea here i to iterate through rows and when we find a 1, check it's bottom and right neighbour. If it has a right but no bottom, a group is made and we skip the right neighbour as it is already in a group. When the checked 1 has a bottom but no right, we make a group of them and we can skip checking the right as well i think.| Report Duplicate | Flag | PURGE

Algorithm - 0of 0 votes

AnswersPuzzle:

- valipevsr October 30, 2018 in United States

There are 4 similar bottles ,all bottles are filled with milk. In one of the bottle is poisoned. There are 4 rats with you .how many rats are required to find out poisoned bottle?| Report Duplicate | Flag | PURGE

- 0of 0 votes

AnswersThere are 4 similar bottles ,all bottles are filled with milk. In one of the bottle is poisoned. There are 4 rats with you .how many rats are required to find out poisoned bottle?

- valipevsr October 30, 2018 in United States| Report Duplicate | Flag | PURGE

- 0of 0 votes

Answerhow can i apend two array in C# like this

- lalityad2012 October 30, 2018 in India

a1 = [1, 2, 3, 4];

a2 = ["a", "b", "c"];

result a3 = [a1, b2, c3, d4];| Report Duplicate | Flag | PURGE

Jr. Software Engineer .Net/C# - 0of 0 votes

AnswersYou have two files in hdfs one having date range with two columns start date and end date and another having two column with date and visitors field. You have to write a spark code which gives date range having maximum no. of visitors using that two files.

- tokritijain October 30, 2018 in India| Report Duplicate | Flag | PURGE

Amazon Data Engineer - 0of 0 votes

AnswersYou are given an array A of size N and Q queries. For each query, you are given two indices of the array L and R. The subarray generated from L to R is reversed. Your task is to determine the maximum sum of the subarrays.

- Sameer October 29, 2018 in United States

Note: After each query is solved, the array comes to its initial states.

Input format

First line: Two space-separated integers N and Q

Next line: N space-separated integers denoting the array elements.

Next

Q lines: Two space-separated integers in every line denoting the values of Li and Ri

Output format

For each query, print the required answer in a new line.

5 2

3 -1 4 2 -1

3 4

1 2

//output

8

9| Report Duplicate | Flag | PURGE

Facebook Software Developer - 0of 0 votes

AnswersConvert infix to postfix and evaluate postfix expression.

- user October 28, 2018 in United States

For example: 4 // number of variables

g = 2

p = 3

t = 1

w = 2

3 // number of equations

g + p x t - w x p

t - g + t - w

e + t x t - m

Output: -1 //for first equation

-2 //for second equation

Compilation Error // for third equation| Report Duplicate | Flag | PURGE

Facebook Testing / Quality Assurance - 0of 0 votes

AnswersConvert infix to postfix and evaluate postfix expression.

- user October 28, 2018 in United States

For example: Input:

3 // number of variables

a = 1

b = 2

c = 2

2 // number of equations

a x b + a x c + b x c

a x c - b / c + c x c

Output: 8 //for first equation

5 // for second equation| Report Duplicate | Flag | PURGE

Facebook Testing / Quality Assurance - 0of 0 votes

AnswersGiven n boxes of different weights and m machines of different weight carrying capacity. Find the minimum time required to move all boxes.

- vivekagal1998 October 28, 2018 in India

Machines Capacities : C[0] , C[1] , C[2],........C[m-1].

Box Weights : W[0] , W[1] , W[2] .... W[n].

Each machine takes 1 minute to carry one time. What can be the optimal approach recursive approach will be to try assigning current box to given machine and not assign and recur for rest of thee boxes.

Note: A single machine can carry boxes multiple times , Each round trip takes exactly 1 unit time.| Report Duplicate | Flag | PURGE

Directi Software Engineer - 1of 1 vote

AnswersHow to evaluate a mathematical expression by compiler design. The program will ask the user to input a value (say n). Then user will input n lines of input each of which contains an identifier and its corresponding value. Then program will ask the user again to input a value (say m). Then user will input m lines of expressions. Calculate the final value for each of the given expression using first n lines of input. If you can't evaluate any expression from given numbers of identifiers then output 'Compilation Error'. Allowed mathematical operators are +(add), -(subtract), x(multiply), /(divide).

- user October 27, 2018 in United States

Example: a = 1

b = 2

c = 2

a x b + a x c + b x c output 8

a x c - b / c + c x c out put 5

g = 2

p = 3

t = 1

w = 2

g + p x t - w x p output -1

t - g + t - w output -2

e + t x t - m output compilation error| Report Duplicate | Flag | PURGE

Facebook Software Engineer - 0of 0 votes

AnswersConsultant

- quickbooktech321 October 27, 2018 in United States for 5000 Employees

QuickBooks specialists are available at QuickBooks Technical Support to determine your issues. QuickBooks client benefit number has expectation is to settle your issues instantly. You can connect with us our QuickBooks Support Number 1-844-444-4174 which is accessible at your administration constantly. For any questions please associating on our QuickBooks Help Number will enable you to investigate and settle the issue instantly.| Report Duplicate | Flag | PURGE

techsupport Financial Application Engineer - 2of 2 votes

AnswersGiven the root of a binary tree, print the nodes column wise and row wise.

`..............6 ............/....\ ...........9......4 ........../..\......\ .........5....1.....3 ..........\........./ ...........0.......7`

The answer would be 5 9 0 6 1 4 7 3.

- Champaklal October 26, 2018 in United States| Report Duplicate | Flag | PURGE

Facebook Software Developer Algorithm - -3of 3 votes

Answerbinary search

- James666 October 22, 2018 in United States| Report Duplicate | Flag | PURGE

Google Software Engineer - 0of 0 votes

AnswersExplain the difference between ORM and JDBC.

- mmoshikoo October 20, 2018 in United States

Provide some examples and when to use one over the other.| Report Duplicate | Flag | PURGE

Microsoft Software Developer General Questions and Comments - 0of 0 votes

Answersgiven two strings s1 and s2 we have to convert s1 into palindrome such that s1 contain s2 as a substring. in a minimum number of operation. wherein a single operation we can replace any word of s1 with any character.

- GB11 October 17, 2018 in India

constraint : |s1| <= 1000

|s2| <= |s1|

ex: s1 = "abaa" , s2 = "bb"

output : 1| Report Duplicate | Flag | PURGE

Walmart Labs Software Developer - 1of 1 vote

AnswersSuppose we want to build a scheduling app. We have the times people are currently busy, e.g.

- jasd October 17, 2018 in United States

{

Alice: [(13.5, 14), (15.75, 17)],

Bob: [(9, 12), (13, 14), (14, 16)],

Eve: [(9, 11), (12.5, 13.5), (14, 15), (16, 18)]

Mallory: [(0, 9), (12, 24)]

}

For simplicity, lets represent times as numbers between 0 and 24 and the times people are busy as (start_time, end_time) pairs. For example, (13.5, 14) means that Alice is busy from 1:30PM-2PM.

Given a list of people's schedules, write a function to return a list of the time intervals all the people in the list are free to meet.

For the example above, here's some sample output:

Alice, Bob => [(0, 9), (12, 13.5), (17, 24)]

Bob, Mallory => []

Alice, Bob, Eve => [(0, 9), (12, 12.5), (18, 24)]| Report Duplicate | Flag | PURGE

- 0of 0 votes

AnswersGiven an array which represents columns, find the position of two columns which when removed will trap the maximum amount of water. This is related to trapping raining water problem.

- Ashish October 17, 2018 in India| Report Duplicate | Flag | PURGE

Amazon Software Developer - 0of 0 votes

AnswersGiven an unsorted array find the maximum distance between two elements satisfying the condition A[i] < A[j] where i < j. There will always be a solution.

- Ashish October 17, 2018 in India

For eg. 6, 9, 3, 2, 10, 2, 3| Report Duplicate | Flag | PURGE

Amazon Software Developer - -2of 4 votes

AnswersHow should I prepare for the interview with Alexa team at Amazon?

- ihsihs005 October 17, 2018 in United States for Alexa| Report Duplicate | Flag | PURGE

Amazon SDE1 Data Structures - 1of 1 vote

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:

- Ankita October 14, 2018 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

Starup SDE-2 Algorithm Problem Solving - 0of 0 votes

AnswersSuppose If you are hacker, you have to push data to server and find how much data server can accept using minimal number of times. We don't the size of how much server will accept.

- narsimharao.mothkuri October 14, 2018 in India| Report Duplicate | Flag | PURGE

Accolite software Applications Developer Algorithm - 0of 0 votes

AnswersHow would you tell whether a graph has a node with n degree??

- shivamdurani220 October 11, 2018 in United States

tell your approach| Report Duplicate | Flag | PURGE

Google SDE-2 - 0of 0 votes

AnswersIf you had n racers and m checkpoints, how would you list out the racers in the order in which they are in the race given that each checkpoint gets a notification when a specific racer crosses it?

- AnonyMous October 11, 2018 in United States

Your code should run in O(1).

Note: Players cannot cheat, i.e. they cannot miss a checkpoint

Example:

Assume 5 checkpoints(C1, C2, C3, C4, C5) and 10 racers(P1, P2,...P10).

Now once the race begins, lets say P2 first crosses C1. So the current race order is P2.

Now P1, P3, P4 cross C1; so the race order is P2, P1, P3, P4.

Now P1, crosses C2; so the race order becomes P1, P2, P3, P4

Now P3, crosses C2; so the race order becomes P1, P3, P2, P4

Now P5, crosses C1; so the race order becomes P1, P3, P2, P4, P5

Now P1 crosses C3; so the race order remains P1, P3, P2, P4, P5

and so on.

Assume that you get notified of players crossing a checkpoint by a function update(player name, checkpoint). Your task is to show the players in order in O(1) i.e return a vector of players in-order in O(1)| Report Duplicate | Flag | PURGE

Bloomberg LP SDE1 Data Structures - 0of 0 votes

AnswersDatabase query response times have increased. An API which is dependent on this database will see - *

- __Joker October 10, 2018 in India

This is a multi-select answer.

Increase in the latencies.

Increase in RAM utilisation on the API servers

Increase in CPU utilisation on the API servers

Increase in 200 response codes

Increase in 5xx responses| Report Duplicate | Flag | PURGE

unknown Software Developer Software Design

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

Open Chat in New Window