Yahoo Interview Report
- 0of 0 votes
AnswersOn a empty chessboard, a horse starts from a point( say location x,y) and it starts moving randomly,
- gullu September 12, 2010
but once it moves out of board, it cant come inside. So what is the total probability that it stays
within the board after N steps.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow many different binary trees and binary search trees can be made from three nodes that contain the
- gullu September 12, 2010
key values 1, 2 & 3?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerAn array of size k contains integers between 1 and n. You are given an additional scratch array of size n.
- gullu September 12, 2010
Compress the original array by removing duplicates in it. What if k << n?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerGiven two sequences of items, find the items whose absolute number increases or decreases
- gullu September 12, 2010
the most when comparing one sequence with the other by reading the sequence only once.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerThere is a linked list of numbers of length N. N is very large and you don’t know N. You have to write a
- gullu September 12, 2010
function that will return k random numbers from the list. Numbers should be completely random.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersCount the number of set bits in a number without using a loop.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
Answersdesign a datastructure to represent the movement of a knight on a chess board
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerWrite an algorithm to traverse a knight covering all the squares on a chessboard starting at a particular point.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow many matches will be played in a knockout tournament between 9 teams get the general formula for n teams?
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerThere are a set of 'n' integers. Describe an algorithm to find for each of all its subsets of n-1 integers
- gullu September 12, 2010
the product of its integers. For example, let consider (6, 3, 1, 2). We need to find these
products : 6 * 3 * 1 = 18 6 * 3 * 2 = 36 3 * 1 * 2 = 6 6 * 1 * 2 = 12| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersSuppose you are getting an infinite binary stream of characters then after any point of time you need to
- gullu September 12, 2010
print whether the no is divisible by 3 or not, how will you do that?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given with three sorted arrays ( in ascending order), you are required to find a triplet
- gullu September 12, 2010
( one element from each array) such that distance is minimum.
Distance is defined like this :
If a[i], b[j] and c[k] are three elements then
distance=max(abs(a[i]-b[j]),abs(a[i]-c[k]),abs(b[j]-c[k]))"
Please give a solution in O(n) time complexity| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersHow would you determine if someone has won a game of tic-tac-toe on a board of any size?
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a Data Structure having first n integers and next n chars. A = i1 i2 i3 ... iN c1 c2 c3 ... cN.
- gullu September 12, 2010
Write an in-place algorithm to rearrange the elements of the array ass A = i1 c1 i2 c2 ... in cn| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerDelete a node from a binary tree and balance it. Write code for the former and explain the latter.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere is a temple, whose premises have a garden and a pond. It has 4 idols, each of Ram, Shiv,
- gullu September 12, 2010
Vishnu and Durga. The priest plucks x flowers from the garden and places them in the pond. The number of flowers
doubles up, and he picks y flowers out of them and goes to offer it to Lord Ram. By the time he reaches
to the pond, he finds the remaining flowers also have doubled up in the meantime, so he again picks up y
from the pond and goes to Lord Shiv.This process is repeated till all the Gods have y flowers offered to them,
such that in the end no flower is left in the pond. Find x and y.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswerGiven ships travel between points A and B, one every hour leaving from
- gullu September 12, 2010
both ends (simultaneously), how many ships are required (minimum), if the
journey takes 1hr 40 mts. How many ships does each ship encounter in its
journey, and at what times?
Ans 4, 3 at 20 mts, 50 mts and 80 mts.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswerHow would you reverse the bits of a number with log N arithmetic operations, where N is
- gullu September 12, 2010
the number of bits in the integer (eg 32,64..)| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersAn array is of size N with integers between 0 and 1024(repetitions allowed). Another array of integers
- gullu September 12, 2010
is of size M with no constraints on the numbers. Find which elements of first array are present in the
second array. (If you are using extra memory, think of minimizing that still, using bitwise operators)| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 2of 2 votes
AnswersGiven An Array with N integer with values ranging from 1 to N. there is only one duplicate in the Array.
- Geek December 09, 2012 in United States
Find out Duplicate value.
i.e.
A = { 10,6,3,4,7,5,2,4,9,1}
values from 1 to 10.
in this example, Duplicate element is 4.
N could be quite large.| Report Duplicate | Flag | PURGE
Microsoft Software Engineer / Developer Algorithm