Welcome Guest

Questions for Amazon


Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/gpl4you/public_html/_config-rating.php on line 26
Rate the Questions

Rating: 2.0/5

Q. No. : 1
Question :Given an array of integers.....
Imagine it as a pyramid as below:

a[]={1,2,3,4,5,6,7,8,9,10}
1
2 3
4 5 6
7 8 9 10
find a path from level 1 to last level such that the sum is maximum.... The path is such that its children should be reachable.
Ex:
1,2,5,9 is a path
1,2,6,10 is not a path since 6 is not reachable from 2.
The array is not sorted and numbers are random.
Solution Discuss
Q. No. : 2
Question :A n-tree where each node contains any no of nodes. Print the nodes in level order and each level must contain a line with a gap
Solution Discuss
Q. No. : 3
Question :Write a program to arrange numbers from 1 to 16 such that the sum of two consecutive numbers is a perfect square
Solution Discuss
Q. No. : 4
Question :If you have a N steps staircase and you are standing at 1 step now you have options to step up to 2step or you can skip one step and go to 3rd step... so at ith step you have a option to go to i+1 step or i+2 step. So how many ways you can climb the stairs?
Solution Discuss
Q. No. : 5
Question :In a sequence of integers, find the max length increasing order subsequence.
Solution Discuss
Q. No. : 6
Question :Given a binary tree, find a path (from root to a leaf) which gives maximum value by adding values of nodes.
Solution Discuss
Q. No. : 7
Question :How will you find the page with most incoming links from billions of web-pages
Solution Discuss
Q. No. : 8
Question :You have millions of documents numbered 1,2,3,4,5 ......
You also have a mapping from a word to the list of documents that contains it

Find all the 'pair of words' that occur together in one and only document
Solution Discuss
Q. No. : 9
Question :Given n number of points in space and a point P, find 3 nearest point to p.
Solution Discuss
Q. No. : 10
Question :Write C code to find maximum and second maximum in an array
Solution Discuss
Q. No. : 11
Question :

For a given matrix NxN having 0 or 1’s only. You have to find the count of rows and columns where atleast one 1 occurs.

e,g

0 0 0 0

1 0 0 1

1 0 0 1

1 1 0 1

Row count having 1 atleast once: 3

Col count having 1 atleast once: 3
Solution Discuss
Q. No. : 12
Question :You are provided with a max heap of 'n' elements with a number 'x' and 'k'...You have to find whether 'k' elements in heap are greater than 'x' or not??
Time Complexity should be O(k)
Solution Discuss
Q. No. : 13
Question :

int main()
{
fork();
fork();
fork();
printf("BOOM \n");
return 0;
}

How many BOOMs will be printed ?
Solution Discuss
Q. No. : 14
Question :Three 1x1 squares are taken on a 8x8 chess board.

1. What is the probablity, that all three squares are diagonal to each other ?

2.What is the probability, that all three squares are diagonal to each other and lie adjacent.
Solution Discuss
Q. No. : 15
Question :

Given a binary tree and a node, print all the ancestors of that node.

1
/ \
4 5
/ \ / \
2 3 7 8

print all the ancestors of 7 ans:1 5 7
Solution Discuss
Q. No. : 16
Question :What is the difference between mutex and binary semaphore?
Solution Discuss
Q. No. : 17
Question :ind the two nodes in Binary Tree which have longest distance between them.

Should return I & C for following tree

A
/ \
B C
/ \
D E
/ \
F G
/
I
Solution Discuss
Q. No. : 18
Question :Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers
Solution Discuss
Q. No. : 19
Question :Given a set of 1 Trillion integers on hard disk, find the smallest 1 million of them. You can fit at most 1 million integers in memory at a time. State the fastest solution you can think of
Solution Discuss
Q. No. : 20
Question :Given a graph's shortest path algorithm, how can you make use of it to find the second shortest path?
Solution Discuss