Yahoo Interview Questions
- 0of 0 votes
AnswersWhat is the difference between functors, call back functions and function pointers?
- CK December 09, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C C++ - 1of 1 vote
AnswersWrite a function to add an array of numbers.
- June December 03, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Application / UI Design Arrays C C++ Coding - 0of 0 votes
AnswersWhat's the difference between assignment operator and copy constructor
- tweety November 20, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat's the difference between pointer and reference
- tweety November 20, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat are call back functions?
- tweety November 20, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C++ - 0of 0 votes
AnswersWhat is a functor?
- tweety November 20, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C++ - 0of 0 votes
AnswersWrite a unix program to count the number of lines in a text file
- Divya October 31, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Ideas - 0of 0 votes
AnswersWhat is pi?
- Divya October 31, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Ideas - 0of 0 votes
AnswerWhat is polymorphism
- Divya October 31, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer - 0of 0 votes
AnswersWhat is the importance of the keyword static in java
- Divya October 31, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersWrite a program to replace string 'us' with 'them' from the following String . Do not replace 'Us' as well as any string containing us
- Divya October 31, 2009
$_="Us? It usually rains when bus comes to us";| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersWhat is reflection
- Divya October 31, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Java - 0of 0 votes
AnswersGiven an integer, print the closest number to it that is a palindrome - eg, the number "1224" would return "1221".
- naive October 30, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Coding - 0of 0 votes
AnswersHow to develop a sorted lexicographic tree.
- RKB October 17, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Trees and Graphs - 0of 0 votes
AnswersHow to find distance between two lines in a 3D plane
- RKB October 17, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Math & Computation - 0of 0 votes
AnswersWhat data structure would you use to store distances between all the planets in a galaxy. (So there could be like a billion planets)
- ff October 02, 2009
Also steps in connecting a thin mobile client to connect to the server and get distances between one given planet and all the other planets in that galaxy.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer in Test Data Structures - 0of 0 votes
AnswersThere are given n men and n women.
- pirateMaster September 23, 2009
Each woman ranks all men in order of her preference
(her first choice, her second choice, and so on).
Similarly, each man sorts all women according to
his preference. The goal is to arrange n
marriages in such a way that if a man m
prefers some woman w more than his wife, and w prefers m more then her husband a new marriage occurs between w and m. If w prefers her husband more, then she stays married to him. This problem always has a solution and your task is to find one.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Brain Teasers - 0of 0 votes
AnswersJohnny was asked by his math teacher to compute nn (n to the power of n, where n is an integer), and has to read his answer out loud. This is a bit of a tiring task, since the result is probably an extremely large number, and would certainly keep Johnny occupied for a while if he were to do it honestly. But Johnny knows that the teacher will certainly get bored when listening to his answer, and will sleep through most of it! So, Johnny feels he will get away with reading only the first k digits of the result before the teacher falls asleep, and then the last k digits when the teacher wakes up.
- pirateMaster September 23, 2009
Write a program to help Johnny to compute the digits he will need to read out.| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Algorithm - 0of 0 votes
AnswersThe Chef has one long loaf of bread. Let us say, of length 1. He wants to cut it into as many little loaves as he can. But he wants to adhere to the following rule: At any moment, the length of the longest loaf which he possesses may not be larger than the length of shortest one, times some constant factor. Every time, he is only allowed to cut exactly one loaf into two shorter ones.
- pirateMaster September 23, 2009
Input
One floating-point number, 1 k 1.999, meaning the stated constant factor.
Output
First, you should output one number n, the maximal achievable number of loaves for the given value of the constant factor. Then, you should output any proof that this number of loaves is in fact achievable: n-1 descriptions of cutting, using the following notation. At each step, you print two numbers: first, the index of the loaf that you want to cut into two parts; second, the length of the newly created loaf (cut off from the original one). It is assumed that the starting loaf has index 0. Each newly created loaf will be given the lowest possible free integer index (so, at the ith step this will be i). Each time, the size of size of the original loaf will be decreased by the size of the newly created loaf.
Example
Input:
1.5
Output:
4
0 0.4
0 0.3
1 0.2| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
AnswersYour program will take as an input 'n' coordinates of type {(X1,Y1,Z1), (X2,Y2,Z2), (X3,Y3,Z3),...(Xn,Yn,Zn)} and from these 'n' coordinates print a list of 's' coordinates (where 's' is another input parameter less than 'n') which are closest to the origin (0,0,0) and a list of 't' coordinates (where 't' is another input parameter less than 'n') points closest to each other. Your solution should use an optimal strategy and minimal time / space complexity
- pirateMaster September 23, 2009| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Coding - 0of 0 votes
Answersint * p= NULL;
- Franko September 23, 2009
p = (int*) malloc(0);
what will be the value of p?| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer C - 0of 0 votes
Answersto print
*
*
**
**
***
***
****
****
*****
*****
- janardhan singamaneni April 20, 2009#include<stdio.h> void main() { int n,j,k,l,i; printf("enter the number"); scanf("%d",&n); for (i = 1; i <= n; i++) { for (j = 1; j <= 2; j++) { for (l = n; l > i; l--) { printf(" "); } for (k = 1; k <= i; k++) { printf("*"); } printf("\n"); } } getch(); }
| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer Coding - 0of 0 votes
AnswersGive an string, return the first non-repetitive character.
- Anonymous March 13, 2009| Report Duplicate | Flag | PURGE
Yahoo Testing / Quality Assurance Algorithm - 1of 1 vote
AnswersConsider an array of positive and negative integers. We want to
- george gates January 27, 2009
find a slice of this array (i.e. a sub‐array of consecutive elements) with at least two
elements, such that the sum of the elements in this slice is equal to 0. The size of the
slice can be anything (i.e. from 2 up to the length of the original array), and we don't
care about finding the first, last, shortest, or longest slice, we just want a slice.
Example: from [2,3,-1,2,-4] we would like to find the slice [3,-1,2,-4], where 3 + (-1) + 2 (‐
4) = 0| Report Duplicate | Flag | PURGE
Yahoo Microsoft - -1of 1 vote
AnswersFind all the prime factors of a number entered
- San September 30, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer - 5of 0 votes
AnswersFind the largest prime factor of a number
- Aryan September 30, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer / Developer - 0of 0 votes
AnswersYou have a scooter which needs two tires. You are given three tires. Each tire has a max life of one year. What is the max time you can run your scooter?
- ujjwal akash September 19, 2008| Report Duplicate | Flag | PURGE
Yahoo Software Engineer in Test Math & Computation