## Analyst Interview Questions

- 0of 0 votes
Given a list of 'N' coins, their values being in an array A[], return the minimum number of coins required to sum to 'S' (you can use as many coins you want). If it's not possible to sum to 'S', return -1

Example:

Input #00:

Coin denominations: { 1,3,5 }

Required sum (S): 11

Output #00:

3

Explanation:

The minimum number of coins requires is: 3 - 5 + 5 + 1 = 11;

- 0of 0 votes
Basically I know that 378 small sheets were printed. These came from 21 full sized sheets of paper. The large sheets of paper were torn, leaving rough edges that can be put re-joined digitally. I have now recorded 60 different sheets, and have joined only five pairs. What I would like to know is what is the likely number of sheets that the five pairs came from of the 21 originally used.

- 0of 0 votes
This is a hardware design problem. I can not figure it out. Suppose we have 2 pipelined hardware multipliers(or something). One is working at 1GHz with 2 operations executed in parallel at the same time. The other one is at 500GHz with 4 operations. Suppose we have transistors of 3 types(low leaky(30%),middle leaky(50%) and high leaky(70%)) and here leaky means leakage power of the transistor. Which multiplier should we use considering the 3 types of transistors.

- 0of 0 votes
The strength of a pair integer sequences is defined by the number of integers that they have in common. You are required to find the strength of several pairs of integer sequences.

INPUT

The first line of input contains T, the number of test cases. T test cases follow. Each test case contains 3 lines. The first line contains two integers N and M, which are the lengths of the two sequences. The next two lines contain the sequences.

OUTPUT

This should contain T lines, each containing an integer representing the strength of the pair of sequences for the corresponding test case.

CONSTRAINTS

The length of each sequence will be between 1 and 20 inclusive

A sequence can contain an integer between 1 and 100 inclusive

Sequences will not contain duplicate integers

SAMPLE INPUT

3

4 4

1 2 3 4

3 4 5 6

4 5

1 2 3 4

1 2 3 5 6

3 4

1 2 3

5 6 7 4

SAMPLE OUTPUT

2

3

0

- 0of 0 votes
The binary weight of a positive integer is the number of 1's in its binary representation. For example, the decimal number 1 has a binary weight of 1, and the decimal number 7 (which is 111 in binary) has a binary weight of 3.

Given a positive integer N, find the smallest integer greater than N that has the same binary weight as N.

INPUT

The first line of input contains a number T the number of test cases. The next T lines contain a number N.

OUTPUT

For each test case output a line containing the smallest number greater than N which has the same binary weight as N.

CONSTRAINTS

1 <= N <= 10000

SAMPLE INPUT

2

3

7

SAMPLE OUTPUT

5

11

- 0of 0 votes
Given an integer N, find the smallest integer greater than N which is prime.

INPUT

The first line of input contains T, the number of test cases. T test cases follow. Each test case contains a single integer N.

OUTPUT

This should contain T lines, each containing the smallest prime integer greater than N.

CONSTRAINTS

1 <= T <= 5

1 <= N <= 100

SAMPLE INPUT

2

6

11

SAMPLE OUTPUT

7

13

- 0of 0 votes
Dart thrown land up uniformly and random at a distance from centre of a unit circle. Distance from center is in the range [0,1]. One who lands up farther from the center loses and the loser pays amount equal to distance from the centre. What is the expected pay?

- 0of 0 votes
Whats wrong in this code?

#include<stdio.h>

#include<stdlib.h>

void mystrcpy( char *string2 ,char *string1 )

{

string2 = malloc(20);

while( *string1 != '\0')

{

*string2++= *string1++;

}

}

int main()

{

printf("****************program starts*************************");

char *str1 ="hello world";

char *str2 =NULL;

mystrcpy( str2,str1);

printf("string1 = %s string2 =%s ",str1,str2) ;

getche();

return 0;

}

why str2 will print NULL here

- -2of 2 votes
There is a file of size 100 gb and you have given a memory of size 100GB. How you will sort the file on basis of ASCII. File is having line of text inside it. No line in the file is repeated.

- -4of 4 votes
How can a HashMap accepts caseSensitive value ?

- -2of 2 votes
Q? How to find the highest nus. and second highest nus from a file ?

- 0of 0 votes
Find the expectation value of number of times you need to pick numbers to find a number smaller than the number you pick from a hat containing 1 to n.

case 1: if you replace

case 2: if you don't replace

Expectation values! not probability

- 2of 2 votes
A lot of transistors contains 0.6 percent defectives. Each transistor is subjected to a test that correctly identifies a defective but also misidentifies as defective about two in every 100 good transistors. Given that a randomly chosen transistor is declared defective by the tester, compute the probability that it is actually defective.

- 0of 0 votes
Given an unsorted array (of unknown length .. can be infinite even ).. at any point of time , how to find a number which is repeated for maximum times , followed questions is how to find a number which is repeated for n times.

Answer I proposed is using combination of binary st as ell as heap.

ex: this binary search tree will have structure which even has pointer to its correponding healelement's pointer.

while inserting an element into tree , will check whether it is repeated , if yes , will increase the priority of this element , and adjust heap accordingly.

Please comment on this solution

- -2of 4 votes
need to implement a weather report functionality. user will provide the city name , need to return the weather report.

if weather station exists n functioning properly , will return the weather report of that station .

else ,

will return the nearest available weather station report.

interviewer looking for optimized manner.

looking for datastructures to stores the cities n algo to return the report.

- 0of 0 votes
what is the difference?

void test(vector<int> vec)

{

//ptint the vec;

}

void test(const vector<int> &vec)

{

//print the vec;

}

- 1of 1 vote
what is the probability of 5 people with different ages sitting in ascending or descending order at a round table.

- 3of 3 votes
Given list of pounds, the pounds that can be measured using a balance should be displayed.

For Ex: 100,250

The output will be 100,250,150

The number of pounds which will be given in input might vary. Can someone please help with an algorithm for this?

- 0of 0 votes
We have array that contain integer number, I would like to find the numbers that repeated k time in this array. The array is not sorted, and the numbers are not bounded.

Example,

A(20, 6, 99, 3, 6, 2, 1,11,41, 31, 99, 6, 7, 8, 99, 10, 99, ,6)

Find the numbers repeated more than 3 times.

Answer: 6,99

possible answer using bit wise operations (xor) or combination? Efficiency in running time Big(o) is required as well as the space capacity.

- 0of 0 votes
Given that a disk page can hold at most 1K bytes, a search key uses 4 bytes, and a pointer uses 4 bytes.

Can we analyze the size of an expendable hashing index to index a table column which is defined using unique constraint. What would be the minimum and maximum size of the expendable hasting index if the bucket address table is fully extended?

- 0of 0 votes
The company is currently traded at EV/EBIDA = 5.0x, EBITDA = $120 mln. The company is planing SPO of $120 mln, where $80 mln - secondary shares (current shareholder X sales his stake - 20% of equity capital prior to the SPO) and $50 mln - primary shares (new shares issue).

Please calculate: EV an equity value prior and after SPO

- 0of 0 votes
Given a dataset with three columns: one column shows the account number from which an amount of money is wired, one column shows the account number to which the amount of money is wired, and three shows the amount of the transfer. Design an algorithm to make a new dataset with three columns such that the first column is the account number, the second column is the TOTAL amount of money transfered to the account, and the third column is the TOTAL amount of money transferred from the account.

- 0of 0 votes
What is the difference between template class and class template ???

- 0of 0 votes
There is given a string array and strings having names

for eg . careercup , career , dewdeals , onlineshopping

You have to create a program that finds the largest string in given string array

- 0of 0 votes
find the number of occurrence of given sum in array

EX: input : 10 5 3 2 sum=15

output: 2

it means 15=10+5

15=10+3+2

- 0of 0 votes
Describe an algorithm to solve the following problem. Given an undirected graph G =

(V, E) and a vertex v, compute for each vertex w in the graph G the number of shortest

paths from v to w. Can we do it in O(|V| + |E|) ?

- 0of 0 votes
An cellphone company provides service on 7 different frequencies. They have fixed the locations of 100 towers for their new service. The company has to ensure that two towers broadcasting on the same frequency are at least 100 km apart, so that there is no interference of signals. Describe an algorithm which will answer “feasible” if it is feasible, otherwise output the minimum

number of frequencies needed to utilise all 100 towers.

- 0of 0 votes
Given an undirected graph. Each vertex has degree at most 5. Give an algorithm to find the largest clique in G. What will be the complexity ?

Only designing idea will be sufficient.

- 0of 0 votes
You play a dice rolling game, you have two choices:

1. Roll the dice once and get rewarded the amount of $ equal to the outcome number (e.g, $3 for number "3") and stop the game;

2. You can reject the first reward according to its outcome and roll the dice the second time and get rewarded in the same way and stop the game.

Which strategy should you choose to maximize your reward? (that is what outcomes of the first roll should make you play the second game?)

What is the statistical expectation of reward if you choose that strategy?

- 0of 0 votes
Queue. Implement a queue