Topic — Add New » Posts Last Poster Freshness
Google Interview Question for Software Engineer/Developer (Fresher) about Algorithms 4 ila 1 week

There are 210 Invoices and 1700 bills – these bills add up to these invoices

The association between bills and invoices is lost . The only way to match them is by adding them up to correct amounts that are equal to the invoices.

For Example : there were 2 invoices for 80, 210 and you have bills for these 50, 10 ,10, 30 , 20, 70, 100 values

One of the possible solution is :

80=50 + 30
210= 10 + 10 +20 + 70 + 100

Other possible solution is

80=...

Google
Build a Graph in C++ 3 scott 2 weeks

Determine if any given graph has a cycle or not and to list the vertices that constitute this cycle. Assume a graph of 6-7 vertices. You will need to allow the user to design the graph as he wants in other words ,the user will be able to decide if any given vertices will have an edge or not. Your program will then read the input graph traverse it and determine if it has a cycle or not and then if it has cycle it lists its vertices. A cycle is when you can start from one vertex and visit othe...

Microsoft Interview Question for Software Engineer/Developer (Fresher) about Algorithms, Arrays 5 Aashish Barnwal 2 weeks

given a m*n matrix, find the subset rectangle with max sum (any other rectangle taken would have lesser sum)
Best Regards

Microsoft
Given 1 million files of various sizes, how to find duplicated files? 5 kdtreeed 2 weeks

Given 1 million files of various sizes, how to find duplicated files? What's the best solution?

Directi Interview Question 2 rukawa 2 weeks

You are given a string of ‘n’ characters where n is even. The string only consist of 6 type of characters: (){}[]. The task is to form a well formed expression. A well formed expression consist of proper nesting of braces and their is no priority between the braces like [ > } > ). You can edit any bracket and change it to remaining types for accomplishing the task.
Example
A. "(){}" is valid
B. "({[]})” is valid
C. “((})” is invalid

Facebook Interview Question for Software Engineer/Developer (0 - 2 Years) about Algorithms 3 Guddu Sharma 2 weeks

We have been given a deck of cards and each combination has a rating eg 3 As is higher than 2 As 1K etc.
Write an algorithm such that the probability of picking 3 or 5 or 7 cards from the deck results in high rating

Facebook
Nearest palindrome for a number 14 Guddu Sharma 2 weeks

Given a number u need to find a closest palindrome of a number..
Example..
For 7957, the nearest palindrome is 7997

Next higher palindrome 6 Guddu Sharma 2 weeks

Given a positive number what is the best algorithm to find the smallest number greater than the given number which is a palindrome.
For example it will be 11 for 10
2222 for 2133
101 for 100

Write a program to compute the Denis Series. 1 berobero 2 weeks

http://cl.ly/2r3y24080H1W0X0t2V1p

Facebook Interview Question for Software Engineer/Developer about Algorithms 11 Guddu Sharma 2 weeks

Really like the linear solution of this problem. You have an array of 0s and 1s and you want to output all the intervals (i, j) where the number of 0s and numbers of 1s are equal.

Example

pos = 0 1 2 3 4 5 6 7 8
0 1 0 0 1 1 1 1 0

One interval is (0, 1) because there the number of 0 and 1 are equal. There are many other intervals, find all of them in linear time.

Facebook
Microsoft Interview Question for Software Engineer/Developer (Fresher) about Algorithms 5 Guddu Sharma 2 weeks

Time complexity of a function f(m) is O(m). If the array[i...n] contains either 1 or 0 in each of it's locations, determine the worst case time complexity of the following piece of code written in C-like language.

counter=0;
for(i=0; i=n; i++){
  if(a[i]==1)
    counter++;
  else{
    f(counter);
    counter=0;
  }
}

* i=n was given in the condition of for loop

a) O(n^2)
b) O(n^2 logn)
c) O(nlogn)
d) O(n)

Microsoft
Amazon Interview Question for Software Engineer/Developer (Fresher) 4 tuhinjubcse 2 weeks

if given a 15 digit number whats the best way to find the next palindrome?

Amazon
Find triplets zero sum 3 Venki 2 weeks

given an array of +ve and -ve numbers, find all triplets in array with sum 0.

Consider {-1 0 1 2 -1 -4},
Triplets are
(-1, 0, 1)
(-1, 2, -1)

Facebook Interview Question for Software Engineer/Developer (Fresher) about Algorithms 12 gbhati 3 weeks

given an array & target value. Find a,b,c such that a+b+c=target focus time & space

Facebook
Facebook Interview Question for Software Engineer/Developer (Fresher) about Algorithms 4 gbhati 3 weeks

Find the min and max in an array. Now do it in less than 2n comparisons. (they were looking for the solution that finds both max and min in about 3/2 n comparisons).

Facebook
Amazon Interview Question for Software Engineer/Developer (0 - 2 Years) about Algorithms 15 sandeepKNJ 3 weeks

write an algorithm finding the no.of one bits from 1 to n,for given any n value.
complexity should be good
example:
1=1
2=10
3=11
4=100
5=101
6=110
.
.
if n=3 then ur answer is 4
if n=6 then ur answer is 9

Interviewer is looking for an algo in O(log n)time complexity

Amazon
Algorithms and Time Complexity 4 devsathish 3 weeks

If you have an array of n elements, how would you devise an O(n lg n) time algorithm for outputting a list of those elements that appear more than once in the original array.