SAP Lab Interview Puzzles

The following SAP AG Interview Puzzles will help you brush up your skills and will make you more confident while giving the interview.

1. SAP AG Interview Puzzle - Logical Maths Gold Bar Brain Teaser

A worker is to perform work for you for seven straight days. In return for his work, you will pay him 1/7th of a bar of gold per day. The worker requires a daily payment of 1/7th of the bar of gold. What and where are the fewest number of cuts to the bar of gold that will allow you to pay him 1/7th each day?
Solution:
Just 2

Day One: You make your first cut at the 1/7th mark and give that to the worker.
Day Two: You cut 2/7ths and pay that to the worker and receive the original 1/7th in change.
Day three: You give the worker the 1/7th you received as change on the previous day.
Day four: You give the worker 4/7ths and he returns his 1/7th cut and his 2/7th cut as change.
Day Five: You give the worker back the 1/7th cut of gold.
Day Six: You give the worker the 2/7th cut and receive the 1/7th cut back in change.
Day Seven: You pay the worker his final 1/7th.

2. SAP AG Interview Puzzle  - Interview Marble Logic Puzzle

You are given a set of scales and 12 marbles. The scales are of the old balance variety. That is, a small dish hangs from each end of a rod that is balanced in the middle. The device enables you to conclude either that the contents of the dishes weigh the same or that the dish that falls lower has heavier contents than the other.
The 12 marbles appear to be identical. In fact, 11 of them are identical, and one is of a different weight. Your task is to identify the unusual marble and discard it. You are allowed to use the scales three times if you wish, but no more.

Note that the unusual marble may be heavier or lighter than the others. You are asked to both identify it and determine whether it is heavy or light.

Solution:
So that the following plan can be followed, let us number the coins from 1 to 12. For the first weighing let us put on the left pan coins 1,2,3,4 and on the right pan coins 5,6,7,8.

There are two possibilities. Either they balance, or they don't. If they balance, then the different coin is in the group 9,10,11,12. So for our second one possibility is to weigh 9,10,11 against 1,2,3

(1) They balance, in which case you know 12 is the different coin, and you just weigh it against any other to determine whether it is heavy or light.
(2) 9,10,11 is heavy. In this case, you know that the different coin is 9, 10, or 11, and that that coin is heavy. Simply weigh 9 against 10; if they balance, 11 is the heavy coin. If not, the heavier one is the heavy coin.
(3) 9,10,11 is light. Proceed as in the step above, but the coin you're looking for is the light one.

That was the easy part.

What if the first weighing 1,2,3,4 vs 5,6,7,8 does not balance? Then any one of these coins could be the different coin. Now, in order to proceed, we must keep track of which side is heavy for each of the following weighings.

Suppose that 5,6,7,8 is the heavy side. We now weigh 1,5,6 against 2,7,8. If they balance, then the different coin is either 3 or 4. Weigh 4 against 9, a known good coin. If they balance then the different coin is 3, otherwise it is 4. The direction of the tilts can tell us whwther the offending coin is heavier or lighter.

Now, if 1,5,6 vs 2,7,8 does not balance, and 2,7,8 is the heavy side, then either 7 or 8 is a different, heavy coin, or 1 is a different, light coin.

For the third weighing, weigh 7 against 8. Whichever side is heavy is the different coin. If they balance, then 1 is the different coin. Should the weighing of 1,5, 6 vs 2,7,8 show 1,5,6 to be the heavy side, then either 5 or 6 is a different heavy coin or 2 is a light different coin. Weigh 5 against 6. The heavier one is the different coin. If they balance, then 2 is a different light coin.

3. SAP AG Interview Puzzle - Math IQ Question

Adam is one of the finalist in an IQ championship. As the final test, he is provided with two hourglass. One of them can measure eleven minutes while the other one can measure thirteen minutes. 
He is asked to measure exactly fifteen minutes using those two hourglasses. How will he do it ?

Solution:
Fifteen minutes can easily be measure using these two hour glasses.

Step 1: He will start both the hourglass.

Step 2: The moment the eleven minute hourglass is empty, he will invert it. 

Step 3: When the thirteen minutes hourglass is empty, he will invert the eleven minute hourglass. 
In step 3, we will have counted thirteen minutes. Since we inverted the eleven minute hourglass in step 2, it started from fresh and was inverted just for two minutes (13-11=2). In this manner when it is reversed when the thirteen minute hourglass is finished, it will have two minutes of sand left. This time when the sand finishes, he will have measured fifteen minutes. (13+2=15)

4. SAP AG Interview Puzzle - Logic Problem Brain Teaser

The world is facing a serious viral infection. The government of various countries have issued every citizen two bottles. You as well have been given the same. Now one pill from each bottle is to be taken every day for a month to become immune to the virus. The problem is that if you take just one, or if you take two from the same bottle, you will die a painful death.

While using it, you hurriedly open the bottles and pour the tablets in your hand. Three tablets come down in your hand and you realize they look exactly the same and have same characteristics. You can’t throw away the pill as they are limited and you can’t put them back or you may put it wrong and may die someday.

How will you ensure that you are taking the right pill?

Solution:
You must put labels on the tablets as A and B before using. In that case, if you pour tablets together, you will get 3A, 2A 1B, 1A 2B or 3B. If they are from the same bottles you can take one from another bottle and save the remaining two for another day. If you get two from same and one from other, you can draw one from another bottle and you will have two pairs of which you can eat one and save the other.

5. SAP AG Interview Puzzle  - Chances of Having Same Birthday Problem

How many people must be gathered together in a room, before you can be certain that there is a greater than 50/50 chance that at least two of them have the same birthday?
Solution:
Only twenty-three people need be in the room, a surprisingly small number. The probability that there will not be two matching birthdays is then, ignoring leap years, 365x364x363x...x343/365 over 23 which is approximately 0.493. this is less than half, and therefore the probability that a pair occurs is greater than 50-50. With as few as fourteen people in the room the chances are better than 50-50 that a pair will have birthdays on the same day or on consecutive days.

Comments