Yahoo India :: Placement Paper  I
Posted by Subash  10:18 PM
[2] Comments

links to this post
 Algorithm to partition set of numbers into two s.t. diff bw their
sum is min and they hav equal num of elements  Prog: given Numerator & Denominator.... print 0.3333333333 as .(3)
0.123123 as .(123)  There are $1070 dollars how to split them into bags such that asked
for any denomination from $1 to $1070 , u must b able to give without
opening bag...  Which is DS used for chess program...to predict move each and every
time..  Which is the DS used in dictionary mode in mobile (t9)
 Write 1,3,6,4 using +,,*,/ to get 24 (no repeat of numbers)
 In 1000 wine bottles stack 10 are poisoned given 10 rats what is
the minimum number of tries to find the poisoned one. Rat dies once it
licks the poisoned wine.  2n+1 numbers in a list except for 1 num all had duplicates, how to
find duplicate in O(n)  In a village in each family they give birth to children till they
get a boy. IF girl child they try again. What is the ratio of boys to
girls.
6:34 PM
Yahoo and adobe interview questions:
Adobe:
======
The test predominantly consists of algo questions and a lot of questions on trees.
The subjective paper can be very tiring esp when u are not habituated to write exams for 4 years straight.Also, there are many kinds of papers, everyone does not get the same paper.
Some questions are:
C test:
 linked list using recursion.
 Find if a number is divisible my 3, without using %,/ or *. You can use atoi.(sum of digits)
 2 ints A and B are given, find the no of bits that need to be flipped in A to get B. ( xor a and b and count the number of bits)
 Write a Rotate function for rotating elements in an array, using a reverse function.
 Given 2 sorted arrays A and B with duplicate elements, get C= A B and does not have duplicates(use a variation of merging 2 arrays and then remove the duplicates.)
 Some routines to swap int pointers.
 Subtraction of 2 base 13 numbers.
 Min and max nodes of a quad tree.
 Prove that in a tree no of internal nodes is one less than leaves.
 A couple of boolean logic proofs
 Code to see if a binary tree is a BST or not.
 Switch case program out put
Engieering test:
Most of it had algo’s( no code)
 Given an array with some repeating numbers. Like 12,6,5,12,6
output: 12,12,6,6,5
12 shud come before 6 since it is earlier in list. So cant use a dictionary. Implement a dict manually with a lil overhead.
 finding nth element from end in a list
 inserting an element into a sorted linked list.
These are the ques i remember. All the best for others.
Also, the quant and anal are quite easy.
In the anal part many questions were based on the rule that square root of 25 is +5/5. Not just 5. Similarly for 1.
Geometry the questions were a lil bit tricky, but they are few that u can ignore them.
Yahoo
=====
1) There is a nxn grid of 1's and 0's. Find the i , where i is the row
containing all 1's and all 0's(except the intersection point). Shud do
it in less than 25 comparisions
.
2) Use 2 stacks to implement a queue. Followed up with making the
access to the DS concurrent.
3) C++ question was good, implement a c++ class such that it allows us
to add data members at runtime.
4)Implement a transaction manager in a database server. The discussion
involved a lot of stuff about transaction logs.
5) How do you tune an application. Creating indexes.
6) Some SQL performance tuning questions on creating indexes.
7) can you write a.foo() in c? If so how can u do it?
8) vector imlementation questions.
9) Almost everyone asked about my language.(except ppl who attended my talk).
10:36 PM
Question 1:
The ratio will still be 1:1.
Expected size of the family,
E= 1*0.5 + 2*(0.5)^2 + 3*(0.5)^3......
Hence E = 2. Which means one girl and one boy is the expected family size.