unspoken reflections of my heart
Posts tagged puzzles
interview questions – part 2
Nov 1st
Both the problems here are based on prisoners and hats….
Question 1:
There are n prisoners in a prison. The prison warden gives them an offer:
Activity:
He will be asking the prisoners to stand in a queue, ordered based on their heights, tallest in the front of the queue and the shortest at the end such that every prisoner can see the heads of all prisoners in front of him. Now everyone will be blindfolded and a black or a white hat will be placed on every head. Distribution will be random. The warden would then remove the blindfolds and would start asking every prisoner the colour of their hat, in order, starting from the shortest. The prisoner can answer either “black” or “white”. If a prisoner tells the answer correctly, he will be freed, otherwise killed instantly.
The warden gives twenty minutes for the prisoners to discuss the algorithm among themselves. Then the above activity starts.
Out of n prisoners, how many can be saved for sure ? What is the method ?
Question 2:
Here there are only three prisoners. The warden has three white and two black hats, and the prisoners know this fact. The warden announces that he would be placing one cap on each of their heads after blindfolding them. After removing the blindfold, every prisoner will be able to see both the other prisoners.
The warden blindfolds them and places the three white hats on their heads.
Everyone thinks for some time, after which one prisoner answers “white”.
How did the prisoner come to the conclusion that his head had a white hat ?
interview questions – part 1
Oct 26th
I come across loads of interesting questions which have been asked in interviews. Just thought of posting them here in my blog…
Question 1:
There is a long table with 100 cups arranged in a line. The cups are numbered from one to hundred. Initially all cups are closed with lids.
This is what you do:
First, you open all cups that are multiples of 1. ( Obviously all hundred cups )
Next, you invert all the cups that are multiples of 2. Inverting a cup refers to opening a cup if it is closed, or, closing a cup if it is open.
Next, you invert all cups that are multiples of 3.
This process is continued for 4, 5. 6, …. 100.
After this is done, how many cups will be open, and what are their numbers ??
Question 2:
There is a standard chess board. ( 8 x 8 ). A horse is placed on a corner square, say, black
The task that is being done is the obvious, move to all squares in the chess board, without landing on a square more than once.
The question is different:
Is it possible to reach the corner that is diagonally opposite to the starting square after moving to all other squares ? If yes, how ? If no, why ?
brain teasers
Sep 26th
Recently, I received a mail. There were some interesting questions in it. I was not able to answer most. Thought I would post them here…
***** 1 *****
There is one word in the English language that is always pronounced incorrectly. What is it ?
***** 2 *****
A man gave one son 10 cents and another son was given 15 cents. What time is it ?
***** 3 *****
A boat has a ladder that has six rungs, each rung is one foot apart. The bottom runf is one foot from the water. The tide rises by 12 inches every 15 minutes. High tide peaks in one hour. When the tide is at its highest, how many rungs are under water ?
***** 4 *****
There is a house with four walls. Each wall faces south. There is a window in each wall. A bear walks by one of the windows. What colour is the bear?
***** 5 *****
Is half of two plus two equal to two or three ?
***** 6 *****
There is a room. The shutters are blowing in. There is broken glass on the floor. There is water on the floor. You find Sloppy dead on the floor. Who is Sloppy ? How did he die ?
***** 7 *****
How much dirt would be in a hole which is 6 feet wide and 6 feet deep that has been dug with a square edged shovel ?
***** 8 *****
If a farmer has 5 haystacks in one field and four haystacks in another field, how many haystacks would he have if he combined them all in the center field ?
***** 9 *****
What is it that goes up and goes down, but does not move ?
Answers :
1.
The word “incorrectly”
2.
1:45. The man gave a total of 25 cents. He divided it among two people. Therefore, he gave a quarter to two.
3.
None, the boat rises with the tide
4.
White. If all walls face south, then the house is in the North Pole. The bear must be a polar bear. So, the colour is white.
5.
Three. Division is performed before addition according to mathematical operations.
6.
Sloppy is a fish. The wind blew the shutters in, which knocked his fish-bowl off the table, and it broke, killing him.
7.
None. No matter how big a hole is, it is still a hole, the absence of dirt.
8.
One. If he combines all of his haystack, it becomes one big stack
9.
The temperature






