Yahoo Interview Questions
- 0of 0 votes
AnswersImplement a phone directory
- Hi5 October 18, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerImplement Twitter's trending topic.
- Hi5 October 18, 2010
The input is a text file. Implement it in C.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a stack S, write a C program to sort the stack (in ascending order).
- gullu September 12, 2010
You are not allowed to make any assumptions about how the stack is implemented; the only
functions allowed to be used are: Push, Pop, Top, IsEmpty, IsFull.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 1of 1 vote
AnswersThere is a sequence of increasing numbers that have the same number of
- gullu September 12, 2010
binary 1s in them. Given n, the number of 1 bits set in each number, write an algorithm
or C program to find the n’th number in the series| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given have a datatype, say X in C. Determine the size of the datatype,
- gullu September 12, 2010
without declaring a variable or a pointer variable of that type, and, of course without using
the sizeof operator!| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswersWrite a C Program to reverse a stack in place using recursion. You can only
- gullu September 12, 2010
use the following ADT functions on stack: IsEmpty, IsFull, Push, Pop, Top
you can not use extra stack or any other data structure| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWrite a program to find and print the 1500’th ugly number.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven two sets, Write a function to provide the union of them.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given a list of Ball objects. Each Ball is either Red or Blue. Write a function that partitions these balls so that all of the balls of each color are contiguous. Return
- gullu September 12, 2010
the index of the first ball of the second color (your result can be Red balls, then Blue balls, or the other way around). In haskell, you’ll probably want to return a ([Ball],Int).| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven an array of integers. The sum of the elements of the array is known to be less than the max integer. Compute the sum.
- gullu September 12, 2010
What if we know that integers are in 2's complement form?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven a linked list, split it into two lists - one for the front half and, one for the last half. If odd number of elements are
- gullu September 12, 2010
present the extra node should go to the front list| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersRemove duplicates from a linked list
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer - 0of 0 votes
AnswersSortedIntersect: Given two sorted linked lists, create and return a new linked list that represents the intersection of the two
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - -2of 2 votes
AnswersGiven a linked list with the following property node2 is left child of node1, if node2 < node1 else, it is the right child.
- gullu September 12, 2010
O P | | O A | | O B | | O C How do you convert the above linked list to the form without disturbing the property. Write C
code for that. O P | | O B / \ / \ / \ O ? O ? determine where do A and C go| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given: 3 types of vehicles: Motorbike, Car, and a special type of car for the handicapped.
- gullu September 12, 2010
3 types of parking: Motorbike parking, Car parking, handicapped car parking.
Motorbikes and cars can only park in their designated parkings, while the handicapped cars can park either in their own parking or the
regular car parking.
How would you model this as classes? Explain your methods.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFind the missing element in a sorted array in most optimum running time (O(log n))
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswerGiven a balanced BST tree, write a function to replace the root with a node that belongs to the original tree.
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersGiven n non overlapping intervals and an element. Write a program to find the interval into which this
- gullu September 12, 2010
element falls.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersDesign a stack which supports push, pop, min and max operations in O(1).
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere is a blank disc. You are given two colors of paint (black and white) . A sensor can recognize the color
- gullu September 12, 2010
painted on the disc and produce an output. Paint the disc in a way such that you can find the direction of
rotation by looking at the output (BWBWBWBW... etc). Find the minimum number of sectors you will need to paint| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswersWrite a function to find intersection of two arrays?
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersAn array of size n, has n/2 unique elements and n/2 occurences of an element. Find the
- gullu September 12, 2010
non-unique element in linear time?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersWrite a function which takes as parameters one regular expression (only ? and * are the special characters)
- gullu September 12, 2010
and a string and returns whether the string matched the regular expression.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersYou are given some denominations of coins in an array (int denom[])and infinite
- gullu September 12, 2010
supply of all of them. Given an amount (int amount), find the minimum number of coins required to get
the exact amount. What is the method called?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThere are four dogs, each at the counter of a large square. Each of the dogs begins chasing the dog
- gullu September 12, 2010
clockwise from it. All of the dogs run at the same speed. All continously adjust their direction so that
they are always heading straight towards their clockwise neighbor. How long does it take for the dogs to
catch each other? Where does this happen? (Hint: Dog’s are moving in a symmetrical fashion, not along the
edges of the square).| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswerGiven two lists write a function which returns a list which is the intersection of the two lists
- gullu September 12, 2010| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm