Capgemini interview questions

Answer by Akshat Sinha:

In my  Capgemini interview, These are the questions which are asked within 1.25 hour:-

“CLick here to see questions:- Capgemini Interview Questions “

Solution of Q7( Puzzle)

INTERVIEWER Q7 Puzzle:- I have 100 marbles of 10gm each and one marble of 1Kg.
There is a defect in weight of one marble out of the respected 100
marbles. So how I identify that defected marble.
My Answer:-

After thinking, I gave answer that
I compare like this, let black one is defected then

Now,
to detect any error in weight, i put 100 of them in left and 1 1000gm on right, I found error as left one go up.

Left one is found defected,

and so on and at last
there is one marble was in left side, one on right side whomsoever come up was termed as defected one(If you do not get me then just wait, you get it very shortly)so overall this is called a Binary search algorithm and we solve them in  steps where m= no of marbles. So to find 100 marbles and as we required appx 8 steps.

NOW THE TWIST COME, INTERVIEWER TELL ME THAT HE SELECT ME IFF I GAVE RIGHT ANSWER OF THE NEXT QUESTION

 

INTERVIEWER:- If there is 8 marbles, how do you solve this in 2 steps???
Me:- Puzzled..!!! (Thinking:- If I do the same process then I consume them in 3 steps as . After taking some time I answered as I compared 6 of them as below, if I found there is no error in any of them then I perform test in rest of 2:-

1.) If there is equilibrium i.e. none of the side come up then the marble which was left was defected(read step2) otherwise
If left one come up or right one come up, then I compare 3 of them as

Now if left one come up then it was defected, if right one come up then right one was defected, if none of them come up then the marble which is left was defected.

2)If there is equilibrium i.e. none of the side come up then the marble which was left was defected.
I compare them rest of 2 marble as

So if left come up then left one was defected, if right come up then right one was defected.

So was I solved it in 2 steps.

RESULT:- After 1 hour struggle, at last I was selected in Capgemini  too.

You may find the rest question asked on that interview in following link:-Capgemini Interview Questions
For more Campus related questions visit here
Gate and Campus Questions and Practice Papers

 

EDIT:- 1
Maybe doubt may come in mind that how process go after 25-25 in question 1 as we are not able to divide marbles in 12.5-12.5
Actually after 25, process go like this
12 on left, 12 on right item left=1
If left go up then there is fault in left side and we apply test in it
If right go up then there is fault in right one and we apply test in it
If none of them go up then there is the fault in item which is left…

and so onward….

Leave a comment