A poor miller living with his daughter comes onto hard times and is not able to pay his rent. His evil landlord threatens to evict them unless the daughter marries him.
The daughter, not wanting to marry the landlord but fearing that her father won't be able to take being evicted, suggests the following proposition to the landlord. He will put two stones, one white and one black, into a bag in front of the rest of the townspeople. She will pick one stone out of the bag. If she picks the white stone, the landlord will forgive their debt and let them stay, but if she picks the black stone, she will marry the landlord, and her father will be evicted anyway.
The landlord agrees to the proposal. Everybody meets in the center of the town. The landlord picks up two stones to put in the bag, but the daughter notices that he secretly picked two black stones.
She is about to reveal his deception but realizes that this would embarrass him in front of the townspeople, and he would evict them. She quickly comes up with another plan. What can she do that will allow the landlord save face, while also ensuring that she and her father can stay and that she won't have to marry the landlord?
The daughter picks a stone out, keeps it in her closed hand, and proclaims "this is my stone." She then throws it to the ground, and says "look at the other stone in the bag, and if it's black, that means I picked the white stone." The landlord will reveal the other stone, which is obviously black, and the daughter will have succeeded. The landlord was never revealed as a cheater and thus was able to save face.
See also best riddles or new riddles.cleanlogicshort
The thunder comes before the lightning; the lightning comes before the clouds. The rain dries everything it touches.
What number should appear next in this sequence?
1 5 12 34 92 252 ?
688. Add the two previous numbers and multiply by 2.cleanlogicshortwhat am I
I'm a fruit. If you take away my first letter, I'm a crime. If you take away my first two letters, I'm an animal. If you take away my first and last letters, I'm a form of music. What I am I?
There are n coins in a line. (Assume n is even). Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins.
Would you rather go first or second? Does it matter?
Assume that you go first, describe an algorithm to compute the maximum amount of money you can win.
Note that the strategy to pick maximum of two corners may not work. In the following example, first player looses the game when he/she uses strategy to pick maximum of two corners.
Example 18 20 15 30 10 14
First Player picks 18, now row of coins is
20 15 30 10 14
Second player picks 20, now row of coins is
15 30 10 14
First Player picks 15, now row of coins is
30 10 14
Second player picks 30, now row of coins is
First Player picks 14, now row of coins is
Second player picks 10, game over.
The total value collected by second player is more (20 + 30 + 10) compared to first player (18 + 15 + 14). So the second player wins.
Going first will guarantee that you will not lose. By following the strategy below, you will always win the game (or get a possible tie).
(1) Count the sum of all coins that are odd-numbered. (Call this X)
(2) Count the sum of all coins that are even-numbered. (Call this Y)
(3) If X > Y, take the left-most coin first. Choose all odd-numbered coins in subsequent moves.
(4) If X < Y, take the right-most coin first. Choose all even-numbered coins in subsequent moves.
(5) If X == Y, you will guarantee to get a tie if you stick with taking only even-numbered/odd-numbered coins.
You might be wondering how you can always choose odd-numbered/even-numbered coins. Let me illustrate this using an example where you have 6 coins:
18 20 15 30 10 14
Sum of odd coins = 18 + 15 + 10 = 43
Sum of even coins = 20 + 30 + 14 = 64.
Since the sum of even coins is more, the first player decides to collect all even coins. He first picks 14, now the other player can only pick a coin (10 or 18). Whichever is picked the other player, the first player again gets an opportunity to pick an even coin and block all even coins.cleanlogicshort
What 8 letter word can have a letter taken away and it still makes a word. Take another letter away and it still makes a word. Keep on doing that until you have one letter left. What is the word?
The word is starting! starting, staring, string, sting, sing, sin, in, i. funnylogic
A murdered is condemned to death. He has to choose between three rooms. The first is full of raging fires, the second is full of assassins with loaded guns, and the third is full of lions that haven't eaten in 3 years. Which room is safest for him?
The third room. Lions that haven't eaten in three years are dead.funnylogicwhat am I
What am I?
A bird, squirrel, and a monkey are running to the top of a coconut tree to get a banana - who will be the first to get to the banana?
None – you cannot get a banana from a coconut tree.interviewlogic
A group of campers have been on vacation so long, that they've forgotten the day of the week. The following conversation ensues.
Darryl: "What's the day? I dont think it is Thursday, Friday or Saturday."
Tracy: "Well that doesn't narrow it down much. Yesterday was Sunday."
Melissa: "Yesterday wasn't Sunday, tomorrow is Sunday."
Ben: "The day after tomorrow is Saturday."
Adrienne: "The day before yesterday was Thursday."
Susie: "Tomorrow is Saturday."
David: "I know that the day after tomorrow is not Friday."
If only one person's statement is true, what day of the week is it?
There are 3 switches outside of a room, all in the 'off' setting. One of them controls a lightbulb inside the room, the other two do nothing.
You cannot see into the room, and once you open the door to the room, you cannot flip any of the switches any more.
Before going into the room, how would you flip the switches in order to be able to tell which switch controls the light bulb?
Flip the first switch and keep it flipped for five minutes. Then unflip it, and flip the second switch. Go into the room. If the lightbulb is off but warm, the first switch controls it. If the light is on, the second switch controls it. If the light is off and cool, the third switch controls it.