Topic — Add New » Posts Last Poster Freshness
Amazon Interview Question for Software Engineer/Developer (More than 5 Years) about Linked Lists 13 kirthu 6 days
struct node
{
    int data;
    struct node *next;
    struct node *next_larger;
}

initially next_larger of every node is point to NULL.
now write a c code which set all node's next_larger pointer.
where next_largest point to the next larger then its own value and largest value node's next_larger pointer points to NULL

i.e.
if LL is 3->1->5->6->4
then 3's next_larger points to 4
and 1's next_larger points to 3
and 5's next_lar...

Amazon
Maximum Sum Increasing Subsequence Problem 6 geeksforgeeks 1 week

How to know that the problem can be solved by greedy method or Dynamic method ???

For this problem how will we decide which of the above algorithm to use :-

[b]We are given a sequence of n positive numbers a1, . . . , an. Give an algorithm which finds the increasing subsequence of a1, . . . , an with the maximal sum. (For example on input 1, 101, 2, 3, 100, 4, 5 your algorithm should output 1, 2, 3, 100.)[/b]

FB interview question 4 akshayjohri 1 week

Given a function bool Zoo(int x) and its called for y times , how you will generate the true with probability x/y times .
lest say if x = 65 & y=100, how will you generate true with probability 65/100. You can represent true by 1 and false by 0.
Can sb please, help me in approaching this problem.

Testing of factorial of a number 3 akshayjohri 1 week

Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible

MS interview question 2 geek4u 1 week

Given a list of words and a dictionary with many words. The dictionary may or may not include the the given list of words. From the given list of words,you need to print only those words which are present in dictionary.
Mention time complexity.

MS interview question 1 freakCoder 1 week

Given a set of numbers from 1 to n^2, generate subsets consisting of n numbers such that each subset has one and only one matching number from any other subset

The max number of sub-sets is n squared + n

An example is as follows:
n = 3
n squared set = 1, 2, 3, 4, 5, 6, 7, 8, 9

sub-set 1 = 1, 2, 3
sub-set 2 = 1, 4, 7
sub-set 3 = 1, 5, 9
sub-set 4 = 1, 6, 8
sub-set 5 = 2, 5, 8
sub-set 6 = 2, 4, 9
sub-set 7 = 2, 6, 7
sub...

[closed] Google Interview Question 3 geeksforgeeks 1 week

Given an array having positive integers, find a continous subarray which adds to a given number.

LIS in nlogn time 2 kartik 1 week

How to solve the longest increasing subsequence problem in nlogn time?

tree to file 1 Dheeraj 1 week

function to write a tree to file and another function to read tree from file.

Count internal nodes in a binary tree 2 kartik 1 week

how to count internal nodes in a binary tree?

combine elements of an array, so as to minimize weights. 6 rohanag 1 week

This was a question asked in interview street at a code sprint.

Jonny'y father has purchased him a new toy. The beauty of the toy is that it comes in N components and Jonny can join them in ways he like to make powerful superheroes.

Joining two toy components require certain effort which equal the sum of the weights of the two components. Little jonny desperate to make his new superhero as fast as possible.

Given the initial weights of the toy components help Jonny build ...

First repeating element in array 9 gogtesuyash 1 week

Find the first repeating element in an array of size n in O(n).
Elements are in range.
e.g 3,2,1,2,2,3
The first repeating element is 3.

Microsoft Interview Question about Algorithms 14 Venki 1 week

n numbers (both +ve and -ve) are arranged in a circle. find the maximum sum of consecutive nos. Do this in O(n) time

E.g.: {8,-8,9,-9,10,-11,12}
max = 22 (12 + 8 - 8 + 9 - 9 + 10)

Microsoft
Determine whether the given string is of form pZq 2 spandan 1 week

determine whether the given string is of form pZq where q is reverse of q.
p and q can contain only X and Y.
like if p=XXYX then z will be XYXX
for ex XXYXXXYXX is valid

the limitation is that "you can read only the next character at each point" .

Write a code that will check whether the memory allotted to the program at the i 4 Venki 1 week

Write a code that will check whether the memory allotted to the program at the initial and the memory returned to the system is same or not.

Google Interview Question 6 Venki 1 week

Write a program to show Fibonacci representation of a given number.

Ex- 15 can be represented as 100010 (1*13+0*8+0*5+0*3+1*2+0*1)

Google interview question 4 rukawa 1 week

Find Kth smallest element from a given 2D Matrix of size N*N

The complexity should be better than O(N^2)