I thought it would be fun to post your favorite short trick questions where the anser seems like one thing if you read it fast, but it really is another.
Here is one that I like:
There are five apples and you take three. How may apples do you have left?
Eric [ October 22, 2008: Message edited by: Eric Pascarello ]
Paul Yule
Ranch Hand
Joined: May 12, 2008
Posts: 229
posted
0
If the vice president dies who will be the president?
Jhon Clay
Greenhorn
Joined: Jul 16, 2007
Posts: 16
posted
0
The President himself will continue until and unless the president has killed the vice president and is in court and has been ordered a life sentence or a death sentence
John Stone
Ranch Hand
Joined: May 04, 2007
Posts: 332
posted
0
Is the following sentence true or false? "This sentence is not true."
pete stein
Bartender
Joined: Feb 23, 2007
Posts: 1561
posted
0
Originally posted by John Stone: Is the following sentence true or false? "This sentence is not true."
It is neither. It's "mu". [ November 13, 2008: Message edited by: pete stein ]
Maja Gralewska
Ranch Hand
Joined: Sep 26, 2008
Posts: 92
posted
0
There are five apples and you take three. How may apples do you have left?
3 apples?
Potrzeba jest matka wynalazków
Patel Chintan
Ranch Hand
Joined: Mar 01, 2007
Posts: 79
posted
0
Suppose there is a town with just one male barber; and that every man in the town keeps himself clean-shaven: some by shaving themselves, some by attending the barber. shaves only those men who do not shave themselves.
I remember this one from school, it actually left me very confused at the time:
The Puzzle: Three friends share a hotel room together, and the bill is $25. The three friends pay $10 each, which the bell boy takes to the hotel manager.
The manager keeps $25, and hands back $5 to the bell boy to return as change.
But the bell boy can't split $5 three ways, so he gives the friends $1 each and keeps $2 as a tip.
Each friend paid $10 and got $1 back. $10-$1 = $9
There were three of them 3 X $9 = $27
They paid a total of $27 for the room, and the bell-boy kept $2, so that adds up to $29.
Where did the other dollar go?
Maja Gralewska
Ranch Hand
Joined: Sep 26, 2008
Posts: 92
posted
0
If each of them only paid $9 each then they paid the manager $27 in total, therefor $27 - $25 = $2 change which the bell bot takes as a tip.
right??
Pranay Narotam
Greenhorn
Joined: Oct 08, 2008
Posts: 23
posted
0
that other dollar is divided between the 3 friends..
I AM A HUMAN BEING
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2127
posted
0
Um, no - Maja had it. There is no reason at all to add the bellboy's $2 to the $27 paid by the three friends. But if you subtract it, everything makes perfect sense.
arulk pillai
Author
Ranch Hand
Joined: May 31, 2007
Posts: 2885
posted
0
Q. When designing your new code, what level of importance would you give to the following attributes?
-- Performance
-- Maintainability
-- Extendability
-- Ease of use
-- Scalability
Following sentence is true!
Above sentence is false!
:?
Millions saw the apple fall, but Newton asked why.
If you understand, say "understand". If you don't understand, say "don't understand". But if you understand and say "don't understand". How do I understand that you understand? Understand!
Here's a C programming tricky question that I like:
What's the result of compiling and running the above code ?
Ryan McGuire
Ranch Hand
Joined: Feb 18, 2005
Posts: 890
posted
0
Costi Ciudatu wrote:Here's a C programming tricky question that I like:
What's the result of compiling and running the above code ?
Unless there's some syntax gotcha I'm missing...
i divided by *p is: 1
I hope I don't seem too cocky when I classify that as "elementary" and not very "tricky" at all.
Costi Ciudatu
Ranch Hand
Joined: Oct 24, 2006
Posts: 74
posted
0
There is a syntax gotcha you're missing (actually, everyone that I know has missed it, including myself; that's why I find it "tricky"):
in i/*p there's no space between / and *, therefore that's the beginning of a block comment that's never ended, so the compiler will complain.
Other than this, you're not "cocky" at all, the problem is indeed at most "elementary".
Ryan McGuire
Ranch Hand
Joined: Feb 18, 2005
Posts: 890
posted
0
Costi Ciudatu wrote:There is a syntax gotcha you're missing (actually, everyone that I know has missed it, including myself; that's why I find it "tricky"):
in i/*p there's no space between / and *, therefore that's the beginning of a block comment that's never ended, so the compiler will complain.
Other than this, you're not "cocky" at all, the problem is indeed at most "elementary".
D'oh! Not very tricky but i got it wrong anyhow. I looked right at the i/*p and wondered how it would parse those operators but completely missed that it was a comment delimiter.
Such a question have been asked from me during my high school year:
If you come across with a new car that very very cheaper, so what you will think about it?
Ryan McGuire
Ranch Hand
Joined: Feb 18, 2005
Posts: 890
posted
0
What does this print?
Disclaimer: I don't have a C compiler with me, so I might have a syntax error.
Vlado Zajac
Ranch Hand
Joined: Aug 03, 2004
Posts: 243
posted
0
The 2nd #include should probably be #define.
Ryan McGuire
Ranch Hand
Joined: Feb 18, 2005
Posts: 890
posted
0
Right, a #define. What does this code print? If someone has a C compiler and can compile and run this, please post the output here. Why did it print what it did?
salvin francis wrote:write a c program to print hello world on screen,
your program should not contain ";"
I dont think this can be done in java though.
Almost, Salvin, but your example does not compile! Add { } after the if-statement and you're done. And indeed, this trick can't be translated to Java, because the expression inside the if-statement in Java is required to evaluate to a boolean, which is not so in C.
Jigar Naik wrote:(Titar is a name of bird in india)
Titar's front side 2 more titar.
Titar's back side 2 more titar.
Titar's upside 2 more titar.
Titar's downside 2 more titar.
Then tell me smarty, total no of titars ???
There might be a language issue here, but I think the number you're looking for is 2 + 2 + 2 + 2 + 1 = 9. That assumes one single titar is the subject of all four sentences.
Mazer Lao Tzu
Ranch Hand
Joined: Jan 20, 2010
Posts: 35
posted
0
Patel Chintan wrote:Suppose there is a town with just one male barber; and that every man in the town keeps himself clean-shaven: some by shaving themselves, some by attending the barber. shaves only those men who do not shave themselves.
question: Does the barber shave himself?
No, he does not shave himself. He gets his wife to shave for him. Some go to barber and some shaving themselves does not mean that all men do one of those two options (After that, it is simple deduction to determine that he has a wife and makes her do it).
-- Mazer
Jigar Naik
Ranch Hand
Joined: Dec 12, 2006
Posts: 729
posted
0
Suppose there is a town with just one male barber; and that every man in the town keeps himself clean-shaven: some by shaving themselves, some by attending the barber. shaves only those men who do not shave themselves.
question: Does the barber shave himself?
This sentence is unsatisfiable (a contradiction) because of the universal quantifier. The universal quantifier y will include every single element in the domain, including our infamous barber x. So when the value x is assigned to y, the sentence can be rewritten to , which simplifies to , a contradiction.
Jigar Naik wrote:(Titar is a name of bird in india)
Titar's front side 2 more titar.
Titar's back side 2 more titar.
Titar's upside 2 more titar.
Titar's downside 2 more titar.
Then tell me smarty, total no of titars ???
abbe question poonchna seekh.
its
Titar ke ek aage Titar
Titar ke ek peeche Titar
aage Titar,
peeche Titar,
bolo kitney Titar?
English Translation:
There is a Titar in front of a Titar
There is a Titar behind a Titar
Titar in front,
Titar behind,
How many Titar in all ?
Ryan McGuire
Ranch Hand
Joined: Feb 18, 2005
Posts: 890
posted
0
salvin francis wrote:
There is a Titar in front of a Titar
There is a Titar behind a Titar
Titar in front,
Titar behind,
How many Titar in all ?
Let's see... I drew a diagram of the scenario described. I have a row of 15 titars side-by-side. In front of the fifth one is one more titar, so...
16. Final answer.
Let's take that concept a little farther...
At a small family gathering...
someone was there with their mother.
someone was there with their father.
someone was there with their sister.
someone was there with their brother.
someone was there with their son.
someone was there with their daughter.
someone was there with their aunt.
someone was there with their uncle.
someone was there with their neice.
someone was there with their nephew.
someone was there with their cousin.
salvin francis wrote:
There is a Titar in front of a Titar
There is a Titar behind a Titar
Titar in front,
Titar behind,
How many Titar in all ?
Let's see... I drew a diagram of the scenario described. I have a row of 15 titars side-by-side. In front of the fifth one is one more titar, so...
16. Final answer.
Ryan McGuire wrote:
At a small family gathering...
someone was there with their mother.
someone was there with their father.
someone was there with their sister.
someone was there with their brother.
someone was there with their son.
someone was there with their daughter.
someone was there with their aunt.
someone was there with their uncle.
someone was there with their neice.
someone was there with their nephew.
someone was there with their cousin.
How many people were there?
lets see,
If i am a guy - A
and i came with my sis - B
and my mom - C
and my Dad - D
and my Mon/Dad's Brother - E
and his wife - F
and his son/daughter - G.
1. someone was there with their mother. A to C
2. someone was there with their father. A to D
3. someone was there with their sister. A to B
4. someone was there with their brother. B to A
5. someone was there with their son. C or D to A
6. someone was there with their daughter. C or D to B
7. someone was there with their aunt. A or B to F
8. someone was there with their uncle. A or B to E
9. someone was there with their neice. E or F to B
10. someone was there with their nephew. E or F to A
11. someone was there with their cousin. A or B to G
Total = 7
not so sure
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2127
posted
0
I think six is the minimum number of people involved. (Well, for, how shall I put it... traditional family trees. ) One solution is to take Salvin's answer and send E or F home. We need one or the other, but we don't need both. Or we can send them both home, if we can augment G with another cousin of opposite gender.
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2127
posted
0
salvin francis wrote:
Ryan McGuire wrote:
salvin francis wrote:
There is a Titar in front of a Titar
There is a Titar behind a Titar
Titar in front,
Titar behind,
How many Titar in all ?
Let's see... I drew a diagram of the scenario described. I have a row of 15 titars side-by-side. In front of the fifth one is one more titar, so...
16. Final answer.