## Infosys Interview Questions

- 0of 0 votes
Consider an array which may contains the alphabets from A to Z.

suppose consider the below examples

A[9] = {A,C,D,G,D,E,A,C,A}; then the output should be in the format of A=3;C=2;D=2;E=1;G=1

A[9] = {A,B,D,C,D,B,A,B,A}; then the output should be in the format of A=3;B=3;C=1;D=2

write the logic in C. the values in array may vary. the output should count the alphabets in the array

- 0of 0 votes
Suppose an array contains below values

A = {A,B,C,B,A,C,A,B,C,A} then the output should display in the below format

A=4;B=3;C=3

Could you please send the logic for the above question in C ?

- 0of 0 votes
quicksort using divide and counquer . Need code please java

- -2of 2 votes
The bin packing problem is an example of a wide set of problems. The task is to find how many set sized bins are required to hold a number of differently sized boxes. How many bins (10 units high) are required to contain the following boxes (1,3,4 and 5 units high)?

- 0of 0 votes
Write a program to calculate the Loan Balance, where a person borrows an amount A and in return he/she agrees to make N payments per year, each of amount P. While the person is repaying the loan, interest will accumulate at an annual percentage rate of R, and this interest will be compounded N times a year (along with each payment). Therefore, the person must continue paying these installments of amount P until the original amount and any accumulated interest is repaid.

NOTE: The formula to calculate the amount that the person needs to repay after T years is -

Balance Amount after T years = A[(1+R/N)^NT]-P

- 0of 0 votes
Given a list L of integers, a1 , a2 , . . . , an , and an integer M , describe an algorithm that finds the largest

subset of L whose sum is at most M . Your algorithm should run in linear time

- 0of 0 votes
`int[] array = {3,-1,-2,2,2,3,2,-6,2,3,-8,0,2}; out put needed : {3,2,2,3,2,2,3,0,2,-1,-2,-6,-8} order is maintained and -ve numbers are sent to rightmost in order.`

Design a code with single iteration to do it.

- 0of 0 votes
How will you find out size of a variable without using sizeof ();

- 0of 0 votes
what does the yeild method do in case of a thread lifecycle ? Explain with a neat example demonstrating the use of yield method?

- 0of 0 votes
`c++`

- 0of 0 votes
find all the subset of an array having integers from 1 to 9 such that sum of each subset is 10.

- 0of 0 votes
You are given an array say

5,4,2,7,9,6

You need to convert it to a sorted array in minimum operation where only operation allowed is decrement.

For example above array becomes

2,2,2,6,6,6 (operations=9)

- 0of 0 votes
what is the maximum number of binary trees that can be formed using 3 unlabeled nodes ? explain..

- 0of 0 votes
Given two integers A & B. Determine how many bits required to convert A to B. Write a function

int BitSwapReqd(int A, int B);

- 0of 0 votes
write a program to check if the tree is BST

- 0of 0 votes
Write a program to generate a mirror (copy) of the binary tree without using recursion.

- 0of 0 votes
There are 3 societies a, b, and c. A lent tractors to B and C as many as they had. After some time B gave as many tractors to A and C as many as they have. After sometime c did the same thing. At the end of this transaction each one of them had 24.

Find the tractors each originally had.

- 0of 0 votes
Three friends divided some bullets equally. After all of them shot 4 bullets the total no. of remaining bullets is equal to that of one has after division. Find the original number divided.

- 0of 0 votes
Write an algo to exchange the elements of secondary digonal of a matrix.

- 0of 0 votes
How many ways can you paint a cube if you have three colors of paint?

- 0of 0 votes
What is the benefit of using StringBuffer?

- 0of 0 votes
What log file can you refer to for determining if a JUnit test failed?

- 0of 0 votes
How does Struts implement MVC?

- 0of 0 votes
In Java, if we insert a return statement inside the try block of a try-catch-finally, will the finally block still get executed?

- 0of 0 votes
Other questions as came up during the conversation ... total of 45 minutes on the phone. Informed me that HR will be in touch for a 2nd technical interview.

- 0of 0 votes
What other design patterns have you been exposed to?

- 0of 0 votes
What is the difference between SAX and DOM? Which API provides a faster implementation?

- 0of 0 votes
How would you shallow copy an object?

- 0of 0 votes
What is Singleton design pattern, and how would you implement it?

- 0of 0 votes
What's the difference between a process and a thread?