Tech-Interview Riddles
An anonymous submitter writes "A computer engineering student at UC Berkeley has made a comprehensive archive of riddles from technical interviews. Very challenging and loads of fun. Also useful for interview preparation."
What is the riddle that no one has solved?
I believe Microsoft was responsible for popularizing the usage of riddles in interviews
Yes, but they still have not been able to find anyone who can solve the "why does windows crash" riddle!!
for more tech interview questions and answers try http://www.techinterview.org/
What's up with using this type of question for interviews, anyway? Sure, they can be fun, but they're perfectly useless as far as telling whether someone can actually write solid code. 9 times out of 10, all they tell you is whether the interviewee has heard that one before.
To interviewers: Do you really think that the answers to these questions don't spread through the entire department within 15 minutes after your first interview? I realize that "knowing the answer" makes you feel smarter than the prospective employee in some sense, but how about actually doing your job for a change?
I sampled a few of the "relatively hard" puzzles... They're interesting, but they only take a minute to figure out. Am I correct in thinking that these are relatively easy, or am I being an ass and flaunting my ability to solve little puzzles?
(In case of the latter, do you want to hire me? I live in Cleveland and go to Cornell University...)
Their software is also quite riddled... with bugs, anyway.
How much wood could a woodchuck chuck if a woodchuck could chuck wood?
...All I can say is that my life is pretty strange...
that even he can't lift it? Oh wait, that was for my interview for entry into the Comparative Religion department, not Computer Science.
cheap labor conservatives - they want to keep you hungry enough to be thankful for minimum wage.
How could they have put all the comments on the page if it says;
Page last modified January 1, 1970 GMT
You were likely running Mozilla or some other GPL bullshit like Audacity. Or maybe you can't keep your registry or swapfile from being corrupted. Go suck Linus Torvalds dick while Steve Jobs ass pounds you.
I used to put this one on my programming tests. It's actually shocking how many people get it wrong...
You are writing a parser that reads a C program and translates all the variable names into new names of the form "VAR######", where ###### is an integer incremented for each unique variable name. Discuss what is needed for the case where the C program already contains a variable of the form "VAR######".
Sometimes it's best to just let stupid people be stupid.
Sadly the site doesn't include the answers to the riddles... Kinda pointless, like sex without an orgasm. It's not rewarding to challenge myself if I have no way to determine whether or not I was correct.
Unfortunately, the site's been /.ed already. Even worse, there's no Googlecache. Oh well.
We're Doomed
It's Turing complete. It weeps, it bites, it smiles and it loves. It can be made, it can be had, it can be taken. It was one, it was two then it became sixty two. It needs time, it need paitence it needs to be pruned. When time comes it needs a fourier series to make it look good. What is it?
asking an interviewee to create a programming problem for others to solve is sometimes a good way to check if they truly understand a subject.
I believe you are the guy on goatse.cx.
"Write a program that will display a "spiral" of NxN numbers, using constant space (no arrays allowed). For example, here's what the spiral looks like for N=10:"
... nice ...
And then he displays a spiral that's 11x10
We do not live in the 21st century. We live in the 20 second century.
A man would like to have safe sex with three women, any of whom may be carrying an STD. Given two condoms, how can he do so, while ensuring that no STD is passed from one woman (or possibly himself) to another (or to himself)?
This is a common situation on the job. Who says riddles aren't relevant in interviews?
ARRRRRGGGHH!!! He didn't post the answers anywhere!!! I'M LOSING MY MIND WITH FRUSTRATION!!! Did anyone get the one about foot size and spelling bees??? My curiosity is eating me alive...
I like to ask candidates what "antsy" means. They always get that one wrong.
Also, I like to ask them to name two adjectives that best describe me.
-TAG
Bob and Joe are standing on a street corner. God loves each an equal amount L. .9c. In Joe's rest frame, how much does God now love Bob?
Bob then accelerates to
-- Anonymous Coward because I already moderated this thread. Boo Hoo.
I'm frustrated by the lack of concrete answers. That's probably the point, mind you -- give some insight on your working behind whatever answer you give.
It seems for most of them, the best answer would be as many sensible answers as you can think of, without seeming like a complete goober -- you can be the whizziest math whiz in the world, but that's probably not worth jack at any job worth its salt if you're most backward social 'tard who doesn't know when to stop.
Thank Jebus I have a nice job.
What's the most important piece of paper to get from the client?
The MS category has some real toughies, like:
"y do u think u r smart"
"y do u wanna work at Microsoft?"
and a great catalyst for catastrophe...
"If you could remove any of the 50 states, which state would it be and why?"
These toughies are gonna keep me up all night!
Comment removed based on user account deletion
Google Cahce is Ace
well guess I'm failing my next tech interview... either that or it's way to fricken late. I couldn't answer 1 of those dumb things...
when they ban enctryption only criminals wi$21*J *#JF$%!@#$':
No wonder I had so much trouble accessing my own site. hey guys, think of the mudhoney fans (http://www.ocf.berkeley.edu/~ptn/mudhoney/) and leave the server alone.
Okay, after puzzling over it for some time I think I have it. Guy puts both condoms on and has sex with woman 1. He the takes the outside condom off and has sex with woman 2. The he flips the condom he'd taken off inside out, and puts it back on and has sex with woman 3.
*sigh*
If my next employment interview includes the question "Please come up with a mathematical formula to convert the ASCII value of your full name to 666", I'll QUIT before they hire me.
---
Siggy, siggy, siggy, can't you see? Sometimes your puns just irritate me.
A stick of incense takes exactly one hour to burn out. Given nothing but a lighter and three sticks of incense, how can you accurately measure 1 hour and 45 minutes of time?
I still remember the OCF at Berkeley back in 1995. All they had were basically a half dozen donated Apollo Unix computers. And the access terminal were basically VT100 green screens.
The interview question I remember most from a particular software company in the Seattle/Redmond area. "Name three functions in C STDIO that take three parameters"
I'm just curious... what are "sales engineering positions"?
What is:
Greater than god
More evil than the devil
Poor people have it
Rich people want it
If you eat it, you'll die?
If all you have is a hammer, everything looks like a nail.
Karnaugh Maps (brought to you by CSE 120 at ASU):
Your problem:
!B!C !BC BC B!C
A-----------------
0 | 0 0 1 0
1 | 0 1 1 1
Answer: BC | AB | AC
Ta da!
This is a great site for more information on interviewing at Microsoft. It has some sample questions, study materials and testimonials etc.
I.O.U One Sig.
I thought for days about this riddle, but it is impossible! I give up! Nothing could be the answer to that!
(and I'm a hiring manager)
I rarely find that people fall down on the job because they lack intelligence, especially the kind it takes to solve these riddles. Many people don't use the intelligence they have because of laziness, bad habits, or can't communicate what they know. Most people are smart enough to hide this in interviews, too.
The reason people can't do their jobs, 99% of the time, is they don't play well with others and/or have poor communication skills.
Give me an above average, hard working, honest, good communicator over that prima donna MIT grad anyday. Don't get hung up on the MIT example, it could easily be Stanford, UC Berkeley, or whatever. The point is that institutions like these select for intelligence, and let's face it high intellegence and good communications skills rarely go hand in hand. It's a beautiful thing, though, when they do. (Lucky bastards!)
Microsoft Interview Questions
Answers here (post more):
Q: Coin in bottle
A: Simply push the cork into the bottle and shake the coin out.
http://www.codewolf.com - Just good stuff to waste time
The answer, at least for those who believe in a god and those who believe that rich people aren't greedy for more, is "nothing."
Isn't mudhoney a seattle band?
Go bitch about Windows bugs to Bugzilla. Oh, wait Mozilla IS A GIANT FUCKING BUG LIKE LINUX.
Come on, I've never heard that one but the answer's got to be "nothing".
I don't know what that says about the riddle, me or people who spend days thinking of the right answer but it's hardly a tough one is it?
(My apologies if this comes across as smug and arrogant, it's not meant to be. At the very least this post provides those that weren't as instantly inspired as myself with the correct answer.)
"Accept that some days you are the pigeon, and some days you are the statue." - David Brent, Wernham Hogg
This troll is so right.
And don't use Mozilla no matter what version number. It causes users to lose the ability to spell
And don't run linux no matter what distribution. It leads users into thinking they are superior.
And Mac OS X is not UNIX you fuck monkeys
Try out some real hard math problems here.
Did they steal this from the Dr. Who "Pyramids of Mars" episode, or was it the other way 'round? Anyone know?
Also, pretty sure I figured this one out, but have no college math, & would appreciate a more technical answer.
So, if you flip the first 20 coins, and partition between 20 and 21, you have the best chance for success, right? Doesn't that mean that there is a 20/inf. and therefore a 1/inf chance that one of the tails coins is in the first 20?
std::disclaimer<std::legalese> sig=new std::disclaimer; sig->dump(); delete sig;
When I saw this post, I was all excited. I thought I was going to see a bunch of questions like the ones I got at my microsoft interviews.
.. "Oh Goodie!". But I guess these are the questions that the non-programmers get. =/
... down to using a single bit for each element. Now use half that memory. Now a quarter. Yeah, it was great fun. I really enjoyed their interviews. Didn't take the job tho... turned those suckers down =P
.. but just telling you that makes it much easier.
First, I was a little surprised when they wern't all cs riddles. I guess I'd been a little hasty, slashdot isn't a programming site. I saw the link marked Microsoft,
So I headed over to the CS riddles. Started reading over them.. "Too easy"... "Done"... "yeah, yeah, easy".. Except for a couple that he doesn't have the solution to, so who knows if they are really possible.
So I think about trying to post the riddles I got here. But really most of them are interactive, and you can't really put them up all at once without giving it away. Things like, given this kind of data, sort it. Now optimize the space needed.
One for the road:
You have a list of numbers. You have to find the largest sum of a continious subset of those numbers.
Example:
1 -3 1 4 -2 4 -6
answer would be 7
in O(n) time, constant space.
"What will it say in the newspaper about you when you die? In effect, write your own obituary:"
All-time best answer:
"Gunman shoots nine, then self."
My friens Marc *swears* he said this in an interview.
Cheers,
Jim in Tokyo
-- My Weblog.
I'd mark up someone who suggested using a standard routine to do a task rather than some home grown version. In fact our C++ test includes some of the usual stupid new/delete/off by one type memory stuff. I award full marks for suggesting the whole lot is replaced with a string even if they don't pick up on the individual mistakes. My favourite question: What makes good software. Best answer: Software that does what the customer wants. Anything else is a bonus.
older than this riddle
Similar to an IQ test.
--
Evan
"$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
You have a monopoly in a given market. A company creates a groundbreaking product and establishes a new, completely different market. Assuming you cannot buy the company, how do you smash it and extend your monopoly in the old market to the new one?
How would you go about designing an email client that executes any code that is sent to it?
If you could remove any of the fifty states (thus rendering federal antitrust statutes inapplicable to corporations in that state) which state would you remove and why?
How would you go about designing an operating system for people who hate computers and who just want to use their machines for pay-per-view entertainment?
An End User License Agreement (EULA) appears in a window with "I Agree" and "I Disagree" buttons. The text area in which the EULA appears is eighty columns wide. How many lines of text can be included in the EULA before a computer that just meets your system requirements is unable to load it into memory?
At a fork in the road between two cities, you see 2 people. One always tells the truth, and comes from the city of safety. The other person always lies and comes from the city of cannibals, where they will eat you. Which one do you hire to write up licensing agreements for your legal department?
An Arab sheikh is old and must will his fortune to one of his two sons. He makes a proposition. His two sons will use their computers, and whichever computer gets a blue screen of death first will win the fortune for its owner. During the race, the two brothers do nothing on their computers, neither willing to risk a blue screen of death. In desperation, they ask a wise man for advice. He tells them something; then the brothers immediately jump onto the computers and start installing new hardware, sharing files, and downloading hastily written security updates. What did the wise man say?
This was a nifty riddle, I never saw it before, and I do think it's appropriate for the programming mind set.
... you do nothing! You turn around and walk out! Look at it this way. All you joes are never going to turn the lamp off. Ever. That's Number's job. And each of you joes are going to turn on a dark lamp and make it bright exactly ONCE in your life. Just ONCE. No more, no less. If you can count up to 1, you can do this. Numbers has to count to 100, and I know he can handle that. And we'll all be out of here eventually."
Essentially the prisoners have to come up with some programs for themselves. They become little finite state machines with an unlimited number of internal states, one input bit, and one output bit. Then the jailer picks one prisoner at a time, randomly, and lets the prisoner run his state machine.
First I noticed that there aren't enough different truth tables for 100 prisoners, which led me to think about the state machines.
Then I looked around for some kind of protocol where prisoner #1 could signal that he had rendez-voused with the lightbulb, and then hand off a notional "token" to prisoner #2, and so on for 100 prisoners, eventually to make a token ring. That wasn't working out very well. I got up to 4 prisoners that way, and I wasn't coming up with a general mechanism.
Then I thought: okay, try client-server, make one prisoner the "boss" with one program, and 99 other prisoners are "drones" with a second program.
That worked out pretty well!
The next problem is communicating the strategy to the prisoners:
"Okay, all you mugs, listen to me, because I was a smart guy on the outside!"
"You, KILLER, you are the BOSS. It's your job to keep the count. Whenever you go in that room -- if the lamp is on, you turn it off, and you make another tally mark on your roster. If the lamp is off, you leave it off. When you get to 99 tally marks, you tell the warden that everyone's been in there, and we can all go".
"All the rest of you joes, listen up. If you go in the room, and the lamp is off, you turn it on -- but ONLY ONCE. JUST ONCE. After you do that, you never touch the lamp again. Ever. I don't care how many times you go in the room."
"All you joes -- if the lamp is already on, don't touch it. Leave it on. That just means that someone else turned it on and Killer here hasn't seen it yet. If the lamp is off, and you touched it before, leave it the hell off! Cause if you turn it on again, Killer's count is gonna get messed up, and we're all going to die."
"Killer, you got pencil and paper? Good. Maybe you want to tell Numbers here to do the counting instead? It doesn't matter who does it, as long as we all agree RIGHT NOW who's going to keep the count. Because if you blow the count -- either we are going to be waiting here forever, or you are going to pipe to the warden too soon and we'll all fry."
"Any questions?"
(One of my buddies has to be pre-arranged to ask this): "Yeah! What if I go in the room and the light's already on? What do I do?"
"Answer: you do nothing! You turn around and walk out! If you haven't turned on the light for yourself yet -- this doesn't count."
Q: What if I turned on the light and the jailer calls me back and it's still on?
A: "Same as above
Then we train the guys using a couple of decks of playing cards, and a lamp, so they can see how it works.
"So there's a programmer writing some code, in C. That programmer needs to use a buffer to store some data. How does the programmer write the code such that an unexpectedly large amount of data doesn't overwrite the stack and result in a remote root exploit?"
Because the holes are round.
I mean, really, any other shape wouldn't fit...
*ducking*
My video compression blog
.
* SPOILER *
.
* SPOILER *
.
* SPOILER *
The rule is: Turn on the light if it's off, unless you've already done this once, in which case, do nothing.
The day all 100 of you meet, designate one person to turn off the light. Have them count each light they turn off. When they reach 100, they will know everyone else has been out already, and can safely demand their freedom.
(Of course, assuming the warden really does pick someone at random, he could pick the same person every day, forever. Or not pick one person, every day, forever. Either way, there's no guarantee you're ever getting out.)
He who refuses to do arithmetic is doomed to talk nonsense.
You're a racecar driver on a one mile track. You drive one lap, averaging 30 mph. How fast do you have to average on the second lap to get a total average speed of 60 mph over the two combined laps?
Some answers from the hard section:
.2 with an average payoff of $5. That means that the probability of getting a face card is .8 with a payoff of 11.5. Using more precise figures, i.e. not .2 and .8, the average payoff is about 10.0857 (706/70)
Criminal cupbearers:
Let's assume we only have 10 prisoners and that they each drink from up to 512 bottles. Number the bottles from 0 to 999. Prisoner 9 samples 0 to 511. Prisoner 8 samples 0 to 255 and 512 to 999. Prisoner 7 samples 0 to 127, 256 to 383, 512 to 639, etc. (prisoners alternating between sampling and not sampling blocks of wine in decreasing powers of 2 -- prisoner 0 drinks from every other bottle) Now line up the prisoners after onen month and treat corpses as ones and living prisoners as zeros and you have your answer in binary.
Mysterious Triangle area
Well, to make a long story short, they're not triangles.
100 Prisoners and a Lightbulb
Well if we assume they can all see the bulb every day, they can just toggle the bulb iff this is the first time they've been selected. If the last prisoner has counted the number of times the bulb has been toggled, he can assert that he is the last one to be selected.
Square Formation
Move the "notched" piece to teh righth of the current larger square and put the small square piece in the notch. put the larger of the triangular pieces at the top, horizontal edge of the new formation.
Calendar Cubes
I like this one. You need all the numbers from 0 through 9 plus 0 through 3. That's 14 faces. You will never need 00 though, so you can remove one of the 0s. Also, you will only ever need the 3 with 0 or 1, so you can remove it from one of the blocks. The solution: the numbers 1-6 on one block, and 7-9 and 0-2 on the other. Yeah it works.
Mystery Matrix
4. Entry from row plus Entry from row 2 plus 1 mod 10.
Fork in the road I
"is that the city you come from?" If the response is yes, go there, otherwise turn away.
Fork in the road II
Assume each person is standing on his respective road. "Is one of you a liar?" Yes means he's a truth teller, no means he's a liar.
Egg Dropping
18. Drop from the 10th, 20th, 30th, etc. After it breaks, go back 9 floors and start dropping every floor. You use 18 drops if it can drop from the 98th or 99th floors.
Greedy Pirates
It's not apparent to me that this is the intended answer, but "Throw pirates 3 and 4 overboard and divide up the rest between 1,2, and 5. Pirates 1 and 2 will agree to the largest share, and pirate 5 always has a say after that, since 3 and 4 can't agree to anything, so he's needed for the majority.
Hmm, well it's getting late so I'll just do one more:
Card Game
Bob takes any card over 9. The probability that none will show up is roughly
Am I the only one who thinks this interviewing technique is retarded?
Because Microsoft does something most definitely isn't a reason to emulate it. Microsoft isn't exactly known for producing well designed software, nor software that reuses proven patterns or algorithms that solved known problems 20 years ago. Better to hire a bunch of 21 year old college grads who can solve word problems from 8th grade algebra, and pretend that Microsoft invented computers! Whee.
When I hire developers I want them to be good developers, not promising young interns. My interview questions typically involve technology questions, process questions, some theoretical PROGRAMMING questions, and some social / communication questions. I'm not saying that hiring smart people is a bad idea, but ignoring skills and only looking at generic problem solving ability is a recipe for unbelievably bad code. It's like hiring musicians based on measured hearing sensitivity and reflexes. OK, maybe that matters if you want to figure out which 5 year old is going to be a prodigy, but hand them an instrument and the noise that comes out is going to sound like ASS.
Examples of things that "smart" developers I've worked with before have totally missed:
- the existence of more efficient data structures than arrays
- generalizing code into reusable chunks (functions, objects, whatever)
- regular expressions
- the difference between "client" and "server"
- the reason for using descriptive variable names
- collection libraries with built in sorting ("whatcha workin' on?" / "coding up a quicksort algorithm" / "in a J2EE app!?!?")
You can't just get this from reading a book, either, although that definitely helps. You have to have some degree of EXPERIENCE too: at least a few projects, and some awareness of things like performance tuning, security, coding for maintainability, etc.
I would use these "tech interview questions" only for hiring interns or recent college grads where the expectation is zero experience, zero clue, zero skill, and a correspondingly low salary. After all you're investing in someone. But for someone that commands a market rate developer salary in the high five figures, screw the brain teasers - just spend a couple of hours grilling them on skills, experience, discipline, etc. They will respect you big time in return because they know when you extend an offer that they won't be working with a bunch of dumb-asses who can get the explorers across the river without being eaten by the headhunters but who can't code their way out of a soggy paper bag.
This book by Adam Barr (available online here) talks about the Microsoft interview process and how the dynamic evolved, including some discussion on trick questions.
--------
Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...
Another good resource: the Princeton Mathclub
my other sig is a 500 page novel
As stated, Mastermind II is not possible.
Let's step through this logically. I will call the rows as numbered as in the puzzle and the positions as numbered left to right, leftmost being position #1. Thus, the ball at row 1, position 3 is the red one.
Comparing lines 1 and 2, we see three of the colors from one have been copied in two. Since there are two "pegs" (not counting black/white color yet) in 2, and one in 1, the new ball (yellow) must be triggering one of the pegs. Therefore, one ball in the solution is yellow. Also, therefore one of the three "copied" balls is triggering a peg, therefore the non-copied ball (red) is not in the solution.
Going on to three, line three states two of the balls are in the correct position. Since we know yellow is one of our balls, we now know the position of yellow in the solution (position 3).
Going back to line two, we now know the yellow ball is the one triggering the white peg (right color, wrong position). Therefore one of the other three balls is triggering the black peg (right color, right position). We have three choices: lt blue, dk blue, and green. It can't be dk blue because we know there's a green or a lt blue ball in the right position in line three...but it can't be green or lt blue because there's no shared positions between those two lines! Thereore, as stated, there is no solution to this puzzle.
Contests to this logic are welcomed.
--- "...And everybody died!!! Except for me, of course...you know why? Because I had my tray table up...and my seat ba
There's many possible answers, so how do I know if I've got the answer they want? He's in a heavily forested area, so grabbing a log and paddling out around the fire shouldn't be hard. Or he could dig a little moat, though that might not be too effective. So, is there some other, clever answer, I should look for, or am I done? Grrrrrrrrr!
"I am a cipher, a cipher, wrapped in an enigma, smothered in secret sauce" -Jimmy James
Asking questions like this during an interview makes a mockery of the interview process, patronizes the candidate and is usually suggested by a career middle-manager seeking to assert their importance at the expense of the dignity of the candidate.
People's careers should not depend on the last five pages of a 99 cent brain teaser book.
The answer to all of them (in an interview) is "thanks for the coffee."
I read a whole (very dull) book of Mastermind puzzles once.
I agree with your logic up to the point where yellow must be in position 3. Then you say: "we now know the yellow ball is the one triggering the white peg (right color, wrong position)". That is faulty mastermind logic. The solution could be "xxx YELLOW YELLOW xxx", which gives YELLOW a black peg for position 3, and no white pegs for YELLOW!
Continuing down this path, I solve it as: YELLOW YELLOW YELLOW LIGHTBLUE.
If you want some REAL hard math problems you can try here.
I stand corrected. Thank you.
--- "...And everybody died!!! Except for me, of course...you know why? Because I had my tray table up...and my seat ba
Why are manholes round? Note: This is a famous Microsoft question. Yet amusingly, the Microsoft campus uses square manholes.
I would guess that the expected answer is that the circle is the only shape that won't fall through a hole the same shape but slightly smaller.
However, that's not the case. There are an infinite number of non-circular shapes with the same property. Anyone else know what they are?
Hmmmm ...
I printed it out and cut them up. It's late, but I'm just not getting it. Any hints?
It's under the hard difficulty.
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
Wasn't sure if this was on the site (I didn't see it), but I really like it... You are in a room w/ 3 on/off switches. There are three lightbulbs in another room. How do you tell which switch goes to which, entering the other room only once? (w/o looking at the wiring)
Really, this is on the website, under the "Micro$oft" section:
"y do u wanna work at Microsoft?"
Now there's a good riddle...
If an NT server crashes, but no-one is there to see the blue screen, then has it really crashed?
So if ^ is XOR, what is AND?
Yes, these questions look exactly what Microsoft optimizes for: employees who are really "smart" in a Mensa-sort-of-way. Too bad that programming isn't about being "smart", it's about craftsmanship, taste, engineering tradeoffs, tradition, experience, and long-term dedication. And, not surprisingly, those are areas where Microsoft is sadly lacking.
I was once asked in an interview the following question in order to assert my UNIX administration capabilities:
"Name a sendmail exploit, past or present and quote a line from '2001'."
Since with two condoms on the likelihood of both breaking is pretty high.
At least, the version I first read about 25 years ago was written with 1 battlefield surgeon, 3 patients, and 2 sets of gloves.
The surgeon version has the advantage that "don't do patient #3" is not an acceptable option.
Just have a co-ed circle jerk.
If it takes two men three and a half hours to build a brick wall, how long does it take twenty thousand men?
This site contains answers to many of the microsoft questions.
i ?a ction=topics&number=3
http://www.acetheinterview.com/cgi-bin/qanda.cg
i suppose the answer to many riddles is, look it up on google?
I had this one once:
A man walks one mile south, one mile east, one mile north, ends up at the same place he started. He shoots a bear at that place. What colour was the bear?
I don't. Is the interview over now? How did I get here? Did u kidnap me?
For more of this kind of thing, I recomend a book called The Chicken from Minsk. It has some pretty tough questions, and they are posed in such a way that they often make you giggle.
"The new wave is not value-added; it's garbage-subtracted" - Esther Dyson, Dec 1994
Love that quote.
Split one condom down the middle and cut into two pieces. Use them as dental dams to have oral sex with two women while wearing the other condom and banging the third.
Unless verifiably correct answers are included, these types of questions are useless to use in interviews.
- the solution to this post is left as an exercise for the reader.
here
IMHO no one of the two figures is a triangle...! Am I wrong? Or the test statement is tricky?
Cheers
667 The Neighbour of the Beast
Read this one, it was shown in the Mail on Sunday Newspaper in the UK and the mail incorrectly said you should switch and your chances would be better if you switched. Teachers, clear thinkers etc wrote to them but they stood by their position that you should switch and your chances would be better if you switched.
"You are a contestant on Monty Hall's game show. You are presented with three doors: 1, 2, and 3. One of the doors has a million dollars behind it. The other two have goats behind them. You do not know ahead of time what is behind any of the doors. Monty asks you to choose a door. You pick one of the doors and announce it. Monty then counters by showing you one of the doors with a goat behind it and asks you if you would like to keep the door you chose, or switch to the other unknown door. Should you switch? Explain why. What is the probability if you don't switch? What is the probability if you do? "
The Mail said 'yes you always switch', because you had a 33% chance of being right and 66% chance of it being behind the other 2 doors. After they reveal one of the other 2 doors, the other door has a 66% chance of being the money. Your door only has a 33% chance hence you should switch.
Of course thats nonsense, when he revealed the door he changed the probabilities by reducing the number of options. So of course they are not 66%/33%, they are now 50-50. So there is no advantage to changing.
So here's the dilema:
If you went for an interview with the Mail on Sunday and gave the correct answer you will not get the job, if you give the incorrect answer you will get the job.
Do you give the correct answer or not?
Isn't interviews about toadying up to the interviewer behind the desk regardless of their mental abilities?
For instance: Brown Eyes and Red Eyes. I have this sense that upon being told by the outsider 'at least one of you has red eyes' (no top limit to the number), ALL the monks go commit suicide at midnight. I can see they still can't communicate, and can't prove they're not among the not-red-eyed, but there are links in the logical chain missing here- yet it points to that result somehow, due to their non-self-awareness and the confirmation that there are red-eyes present.
By the same token- The mother is 21 years older than the child. In 6 years from now, the mother will be 5 times as old as the child. Question: Where's the father? I have to say: on top of the mother, conceiving the child- but I can't get the numbers to add up to anything sensible, it's just the only intersection that would give you the location of the father! *rrrrr*
And finally, 0.999999... is not 1.0000000.... really it's not, though in practice, well...
I don't think so.
These type of "brain teasers" were just as common in 1985 during the interviews for internships at XEROX PARC when I was at MIT as a 6.1/6.3 Junior. IBMs interviewers also asked a brain teaser but HP did not, if I remember correctly.
Any other prior art that others can remember from the ancient days???
--- why has Karma become Qualitative instead of Quantitative?
I did a lot of interviews at MS when I was there, and I quickly learned not to ask riddles. First off, it makes people who don't get them uncomfortable and angry. Second, it doesn't actually show that the person can write software.
I used a much simpler approach, so simple most people think its silly. But thats the point; nobody leaves the interview thinking they were tricked or duped. I always started with implementation of strcpy(). Half of the candidates failed right there! They took most of the hour to get it right (or not), but were able to see point-blank that they were not ready for the job.
Next, I would ask about crashing cases, and if they figured out overlapping memory locations, have them write a 'fixed' version. This weeded out another big chunk. After that, I went into some color counting algorithms.
I stayed well withing the field of what the candidate would expect, and did not try to trick him or make him nervous with off the wall riddles.
This approach worked great, and didn't leave anyone feeling robbed and abused. The ability to solve riddles *is* an indicator of how smart the person is, but it is *not* an indicator of how good a programmer they will be.
If I have a donkey in one hand, and another donkey in the other hand, and a donkey on each shoulder and a donkey in my trousers pocket and a donkey in my car, what do I have?
status is failure. status is failure
Write a subroutine
quite an interesting language you chose to write it in.
The point is: reading the question correct is half the answer. You got only 50% correct.!
+ 1 funny. +1 AC
I'm quite sure it is a guy, a lady would not have to post as "anonymous coward".
-- ac --> Male
There is link to a web site in the hard problems rockdead that is really funny. At the bottom I chose death (Sorry, but I really like the Allman Brothers) and then I chose to reject Jesus (but I did like Jesus Christ Superstar), then I ened up at one of hell's best web pages. They even have recordings from hell! It is somewhere under Finland.
I think I'll go listen to the live version of Wip'en Post.
HPC for Primates. Read Cluster Monkey
'The thing that drives me nuts is not having the "right" answer to check my answers against.'
The point is there is no *single* right answer, sometimes there multiple good answers, sometimes there are none. The point of the question is to examine the candidates problem solving ability, the ability to think under pressure and produce new answers and sometime the ability to be honest and say I don't know the correct answer. Sometimes the test is will you challenge somebody in obvious authority if they are talking b*ll*cks and can you do it diplomatically. Indeed you answer to this problem indicates [to me] you tend to apply cargo cult type solutions. You want to parachute in the correct answer without understanding why it is the 'correct' answer.
Site appears to be down or /.'ed. Here's the google cache URL:
: www.ocf.berkeley.edu/~wwu/riddles/riddles.html+wwu +riddles+site:ocf.berkeley.edu&hl=en&ie=UT F-8
http://216.239.51.100/search?q=cache:Zk-oetcDxk0C
I don't think that is a solution. If you create a back fire you will have to pass the line of fire you just created. If you can do that you can just move to point B when it stopped burning. Creating an extra fire is just trouble.
Same point as first poster. You create some extra variable "you can pass the fire.". if you don't tell this to the person that ask the question he can say "oke" or not oke. It will not tell anything about you.
I never had to answer this kind of questions on a interview. A strong cv did do the most work. If you ask THEM question thya can not ask you questions
Ah, I tackled this differently.
./er is going to have a ruler with them...) Break one of the halves in half, so you have a quarter stick.
:)
Break one stick in half. (It won't be perfectly accurate but you can make a pretty good measurement using your bare hands. Besides, any self-respecting
Using that quarter stick as a measurement, break 1/4 off one of the other sticks.
Bin the half stick and the three 1/4 sticks, or smoke them, or whatever.
Light the full stick. It will burn for one hour. As it goes out, light the remaining 3/4 stick. When it goes out, 1:45 has elapsed since you lit the first one.
Sure, it takes a while to prepare, but it's probably within the margin of error - and besides, the question didn't say I had to measure 1:45 from now, did it?
ANSWER: DON't HAVE SEX WITH THE LAST WOMAN. Just because the question states that he "would like to" doesn't mean he MUST.
>Any other prior art that others can remember from the ancient days???
The Sphinx.
'nuff said.
Nouvelles de jeux et technologies en français. TC
The correct answer is that manhole cover are round so they don't fall in.
This crap about the shape of a wankel rotary engine is just that, crap. Of course you could make it in the shape of a star, rotoary engine, cartman (he's pretty round), whatever. There are other shapes that would fall though, but that doesn't mean that the way it is right now doesn't work.
As for all those square manhole covers, they are either hinged or very rare, and irrelevant to the question (Assuming the question is: Why are manhole covers round?).
The can be additional reasons/benfits, like the fact that most pipes are round, and being easy to roll, but not falling in seems like the best answer to me.
To say that there is not reason is silly. At some point someone man a decision to produce round manholes and cover for them. People actively choose to contiune to produce them. They could choose to make them a different shape if they wanted to.
Also, using fixed size buffers for user input is okay, and should be done. You just have to check that the buffer doesn't overflow. If your program will just keep acccepting more and more data a user could consume all your RAM as a DNS attack. This is commonly checked for on web forms, otherwise someone could submit 1,000 web forms with a few megs of data each, and bring down a server. I'm not a CS major, but AFAIK it is almost always a good thing this to set a limit on the size of user input. Just make sure it's reasonable and it doesn't barf when someone tries to go above that limit.
Life is too short to proofread.
I got the job but only because a friend (this guy's peer) wanted to hire me. And, last time I checked, the guy who asked the question was still looking for work.
One of my favorites to ask people is questions about languages they don't know. Stresses the concepts over the syntax. For instance, "You know OO programming, right? ok, Smalltalk is an OO language. Tell me a little bit about what it probably has." My favorite answer was from the college kid who had written Prolog on his resume because one of his courses did a week on it. I asked him to describe the language, and he couldn't, so I described it for him. Then I asked him to think about what uses the language might have, what applications it would be good for. He said, "none, I guess."
www.HearMySoulSpeak.com
This whole debate seems to assume that microsoft is hiring based on performance on these riddles. It's crazy to believe that they would hire someone who could tell you why a manhole cover was round if they couldn't write decent code. Microsoft position is that code isn't the hard part. They're much more interested in creative problem solving. Admittedly, the more websites there are like this (http://acetheinterview.com is the one my friends and i used to prep for m$ interviews) the opinion i've read that all these things are testing now is memorization. but by the time you do the day interview at microsoft, you're pretty much writing code and answering design questions all day long. the riddles are for screening.
What do you do when all three numbers are zero?
Of course, the real way to do this is to build the triple redundancy into your memory unit, hardwire the logic (probably using one triple-input nand gate and three two-input nand gates for each bit) and not have the cpu deal with this at all.
turn switch 1 on for 5 mins...turn it off...turn switch 2 on...go into the room...the lighbulb that is on is switch 2, the lightbulb that is off & warm is switch 1...the lightbulb that is off & not warm is switch 3...
"Facts are meaningless. You could use facts to prove anything that's even remotely true." - Homer Simpson
The guy freaked. He started complaining that it was unfair and things like that. The funny part was I wasn't judging based on what answer he gave, but how he answered the question. He could have done well, by just rambling about the tradeoffs between different answers. Hell, he could have picked any answer and still got the job, but to lose it over a single question. That was unacceptable.
Where I work, things are often unfair. You can't freak out about it, or you're lost. He was the only person we interviewed for the job. We didn't hire anyone.
'SBEMAIL!' is better than a goat!!
I think the problem here, though, is that state changes will occur that not everyone sees, so their count will be off, and you run the risk of never getting out.
Imagine you're picked for the first time on the 51st day. The light is off. How many people have been picked before you? You have no idea.
(Well, you know at least two people have been picked, but perhaps the warden's been alternating between those two for the past 50 days. But on the other hand, 50 people could have been out. If so, and you started your state-change count at two now, you'd never reach 100.)
Without some accurate way of counting, no one can be sure they've seen all the state changes, and so no one can say with positivity that all 100 people have been out. You end up with a prison full of people with inaccurate counts waiting to reach a number that never comes. Right?
He who refuses to do arithmetic is doomed to talk nonsense.
Favorite technical interview question I've ever heard:
So you're working on a program using the foobarlib library and calling its function baz(), which according to the documentation returns an integer from 1 to 10 that means something or other. Suddenly, you discover that your program is blowing up because baz() is apparently returning -17. What do you do?
The ultimate correct answer that this person was looking for is that you ask your colleagues for help. These days, of course, you also get credit for first searching the web and newsgroups relevant to the package. Surprisingly, many people give up after suggesting things ("Well, first I have my debugger trace everything very carefully to make sure that baz is really doing this, then I re-read the foobarlib documentation") and being told "Ok, you try that, and it doesn't work."
Some people have actually told the interviewer flat-out that "that would never happen; it's impossible". However, those people have usually already demonstrated their unsuitability in other ways.
I interviewed people for a DTP post that required people with knowledge of Quark Xpress and proofreading ability.
About 70% of the applicants got the name of the package wrong on their CV ('express').
A pizza of radius z and thickness a has a volume of pi z z a
There are three vending machines. One dispenses only Cokes, one dispenses only Pepsis, and one dispenses either Cokes or Pepsis at random. Someone rearranges the labels on the machines so that none of the machines are labeled correctly. Given that you have no prior knowledge of which machine is which and no way to open the machines, how many drinks will you have to buy to determine which machine is which?
To many, total abstinence is easier than perfect moderation. -- St. Augustine
Here's a link to a bunch of mirrors
Anyway, during my Microsoft interview when I was an undergrad, they asked me the following question, which I got "wrong"
You have a 7kg bar of gold (assumed rectangular). Your employee gets paid 1kg of gold a day for seven days (because apparently Microsoft people don't get the weekend off). What is the minimal number of cuts to make such that you can pay him 1kg every day?
I came up with some creative solutions, such as:
- Cutting in 3/4 section, stacking the sections, and recutting, so one cut breaks two pieces.
- Cutting a cosine wave into the bar which just brushed the edges with period 7.
- A whole bunch of other ideas, all of which were "wrong".
Anyway, after much back and forth, he basically hinted away that the answer he wanted was to cut the bar into sections of 1kg, 2kg, and 4kg. Then you give him 1kg the first day, then on the second day, give him the 2kg and ask for the 1kg back, etc etc. (ie binary arithmetic basically)Personally, this seemed like the stupidest answer ever to me, in that you were making the assumption that your employee would a) not spend any of the gold you gave him and b) bring it back to work with him the next day.
Long story short, I didn't get the job, but I think that it shows that people are too fixated on what they think is the "right" answer to something like this, when in reality, there are other solutions.
I could also add some good natured Microsoft bashing about how they make stupid assumption like this in code, but then you wouldn't have anything to reply with
But seriously, I have no problem with these riddles in interviews, as long as they're used properly. The point of asking the question should not be to get a "correct" answer. It should be to see how people react under pressure, how creative and resourceful they are, and how flexible they can be in the presence of (possibly) incomplete information.
Even someone who gets one of these answers "wrong" (perhaps because they overlooked some obscure point) would score points in my book if they could explain somewhat sound reasoning behind it and not get flustered while doing it.
The best interviews I've had were right out of college, when the interviewer asked me about one of my grad school projects, then told me to explain it on a whiteboard, on the spot. Those were also the places I thought I'd most like to work at!
They probably stole it from the movie Labrynth, whole probably stole it from someone else. IIRC, it was originally part of a small book of logical puzzles about an island containing "Knights and Knaves," which I think was the name of the book.
Here's a mirror of the riddles: http://wwwcsif.cs.ucdavis.edu/~huangy/riddles/intr o.shtml
In my interview they ask me this:
1) Tell me about yourself.
2) Do you have any question that you want to ask us?
All these riddles are useless for my interview. I'll be impressed at anyone who can give a good answer to 1) and 2).
from the site...
How many prisoners found their doors open after 100 rounds? The answer of course, is none - after the first drunken round, the prisoners have awoken, left their cells, and are busy drinking at the nearest strip club.
I really hate signatures, but go to my website.
I've never answered a riddle question correctly in an interview. I just act like such a blatant smart ass that the interviewer gets frustrated and or impressed with my attention to detail. In this way I have probably lost job opportunities, but you know what, I don't give a fuck. I didn't go to college and major in engineering, a major lacking any female contact, so that I could graduate and be asked to solve riddles. If an interviewer is going to waste my time by asking me stupid questions rather than asking about past real problems I've had to solve, projects, and accomplishments at other jobs, then they'd better be prepared for a barrage of equally stupid questions/remarks.
~ now you know
- MARBLE JARS: Distribute them eveny between the 2 jars, assuming the guy will give you a jar at random or the worst of the two jars.
- ARAB SHEIKH CAMELS: he told them to switch camels
- 3 HATS: Guy A sees at least one black hat. Guy B see a white hat on C. If Guy B saw a white hat on C he knows his can't be white or else A would know that his hat is black. Thus Guy C knows that his hat is black.
- HUMMINGBIRD: ( 5000 / (20 + 15) ) 25
- FOOT SIZE IMPLIES SPELLING ABILITY: Foot size correlates with age which is correlated with spelling ability.
- NONHOMOGENOUS ROPE BURNING: Light one rope at both ends. When this entire rope has burnt, 30 min have passed. Then, light the other rope at both ends and at the middle. When, this entire roep has burnt, 15 min have passed. 30 + 15 = 45
- WILLYWUTANG AND
THE BURNING ISLAND OF DOOM: I think there is a mistake in this problem. The wind should be going from B toward A. Th correct answer is to start another fire in between himself and the fire which the wind will them carry away from him and towards the other fire.
- TWO COIN FLIPS: 50%
- COIN MACHINE WEIGHING: Put one coin from machine 1, two from macine 2, etc. Take the difference from the expected weight and divide it by 1 oz to get the # of the broken machine.
- HOURGLASSES: Run the 7 & 11 simultaneously. When the 7 is done start timing. When the 11 is done you've been timing 4 minutes. Flip it over and when it's empty you'll have 15.
- LOGICAL SIGNS I: Open the silver chest.
- LOGICAL SIGNS II: Open the bronze chest.
- I don't feel like doin ASCII art for the chess problems.
- CORK, BOTTLE, COIN: Push the cork into the bottle, then get the coin out.
- FAMILY RELATIONS: His son
- ANALOG CLOCK I: 0 deg or rad
- ANALOG CLOCK II: 24 times/day, add n times 1:05 where n is an integer APPLES AND ORANGES: Look in the cate marked apples. It has to be either O or A&O. If it's O then the A&O crate is A and the O crate is A&O. If it's A&O then the O crate is A and the A&O crate is O.
Maybe more may come later.Anybody have more/disagree?
Life is too short to proofread.
Alive without breath,
As cold as death;
Never thirsty, ever drinking,
All in mail never clinking.
--
"Outlook not so good." That magic 8-ball knows everything! I'll ask about Exchange Server next.
Manhole covers are round because manholes are round. Manholes are round because the tube shape naturally resists the crushing pressure of the ground surrounding it.
It is for this reason that very old water wells (like in Africa and southern Asia) are round. The rocks you form the walls with resist compression quite well (pun unintended), and you get a sturdy, low-maintenance water source.
Most of the old wells I've seen have rectangular covers, but the ones that people walk over have round covers so that the edge sits flush with the surrounding ground. Most of the flush-mounted ones are in built-up cities (like old London), and I imagine that the local barrel maker manufactured those as well. The edge of these is a row of stone/cobble that's set deeper into the ground than the surrounding cobblestone street.
I think the modern answer (of geometry and axes) is quite boring, and ignores history and tradition too much.
------ Exercise Instructions
Dear Candidate,
This exercise is intended to break the monotony of the standard interview questions like "Tell me about your strengths and weaknesses." Please read this document thoroughly before you start!
Your instructions are simple: Build something using the Lego Mindstorms Robotics Invention System and then tell us about your experience!
There are no constraints on the simplicity or complexity of your project though you are expected to do programming as well as mechanical assembly. You are free to use the examples in the kit or the provided documentation (O'Reilly Mindstorms book) as a starting point.
System Setup
The computer has the Lego Mindstorms software loaded and tested.
The firmware has been loaded into the RCX module and tested. COMM 1 is working for the IR Module connection. Batteries should be good (let us know if you have system problems - they are not part of the exercise!).
In addition, on the computer is an additional programming system called RCX Command Center (Version 3.1) that uses NQC (Not Quite C) and a graphical interface for programming. This has also been tested and documentation is provided. You are free to use either the Lego software or RCX Command Center for programming your robot. The CD-Rom case has instructions on how to bypass the Lego Tutorial.
Presentation
At the end of the exercise you will give a presentation and demonstration (5 -10 minutes) of your project. Feel free to use the whiteboard and/or flipcharts for your presentation if needed. Please address the following topics in your presentation:
How did you set about the exercise in terms of planning, architecture, and construction?
What did you intend your robot to do and what does it really do? Why?
What obstacles did you encounter during construction? How did you overcome or bypass them?
What would you do different if you were given another session?
There is no "right answer" to this exercise and there are no hidden tricks or traps. The intent is to give you an opportunity to show your creativity, learning skills, problem solving, time management, and explanation skills in a different way.
Please have FUN!
"I say we take off, nuke the site from orbit. It's the only way to be sure."
Marble Jars:
.5*50%=.25 .5*50%=.25
.5*100%=.5 .5*49/99=.2474
Distributing the marbles evenly between the jars, you get:
Jar 1:
Jar 2:
Sum(chance of survival)=.5
If jar is selected from randomly and uneven distribution allowed, I'd leave one white marble (i.e. you get to live) in one jar, and the remainder of the marbles in the other jar.
Jar 1:
Jar 2:
Sum(chance of survival)=.7474
> The behavior of strcpy is undefined if the source and destination strings overlap.
:-p
Hence canonical
while (*p++ = *q++);
will do
Guess I won't be interviewing candidates at Microsoft!
I interviewed people for a DTP post that required people with knowledge of Quark Xpress and proofreading ability.
About 70% of the applicants got the name of the package wrong on their CV ('express').
Err, the package is called QuarkXPress, not Quark Xpress, QuarkXpress or any other derivative. One word, only one 'e' and with the 'q', 'x' and 'p' capitalised.
By the way, do you know how to spell irony? I bet you do...
"Accept that some days you are the pigeon, and some days you are the statue." - David Brent, Wernham Hogg
1/2 Open Door = 1/2 Closed Door
Right?
Now cancel the 1/2 on each side to get:
Open Door = Closed Door
Where is my logic flawed?
One of interview methods that makes the most sense to me is described in the The Guerrilla Guide to Interviewing.
Interviews should determine two things: whether a person can do the job, and whether they will do the job. Riddles don't really figure into either of those.
--Bruce
There are 10 kinds of people in the world: those who understand binary, and those who don't.
what's the answer?
If I were ever asked a riddle in an interview; unless it were for a riddle-writing position; I'd immediately stand up and leave. Interviews gauge your ability to perform a job; tests/certifications/etc. gauge your aptitude to perform certain tasks. Were I give a 'real-world' problem that I'd be likely to encounter on said job and asked to provide a solution, that would be a different story.
This is just as unethical and likely illegal as the "do you think lying is ok?" 'personality' quizzes often given by temp agencies and the like. Being asked ethics questions for a position of responsibility is a different story, however.
I think with the interesting people, their lives can't possibly be wrapped up into a nice little package.
Admittedly, I'm not very good at math, but here's what I've come up with...
If I remember my geometry correctly area of a square is (base x height) and a triangle is (base x height / 2)
Big Triangle: 5x9.5cm Area: 23.75
Small Triangle: 7x3.5cm Area: 12.25
Dual Triangle: 5x9.5 and 2x5 Area: 28.75
Square: 3x3 Area: 9
Square Triangle: 5x4.5 and 2x4.5 Area: 27
Total Area: 100.75cm
Sqrt: Approx: 10cm
Am I right so far?
I'm still not getting it.
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
I dig the challenge of riddles. Far worse are the syntax quizzes! Knowing about semicolons after function declarations or 'else' is the compiler's job and not a strong indicator of creativity or capability in a programmer.
The riddle:
"U2" has a concert that starts in 17 minutes and they must all cross a bridge to get there. All four men begin on the same side of the bridge. You must help them across to the other side. It is night. There is one flashlight. A maximum of two people can cross at one time. Any party who crosses, either 1 or 2 people, must have the flashlight with them. The flashlight must be walked back and forth, it cannot be thrown, etc. Each band member walks at a different speed. A pair must walk together at the rate of the slower man's pace:
* Bono: - 1 minute to cross
* Edge: - 2 minutes to cross
* Adam: - 5 minutes to cross
* Larry: - 10 minutes to cross
For example: if Bono and Larry walk across first, 10 minutes have elapsed when they get to the other side of the bridge. If Larry then returns with the flashlight, a total of 20 minutes have passed and you have failed the mission.
---
Another:
You are given 10 baskets. 9 of the baskets each have 10 balls weighing 10kg per ball, however one basket has 10 balls weiging 9kg each. All the balls and baskets are identical in appearance. You are asked to determine which basket contains the 9kg balls. You have a suitable scale, but may only take a single measurement. No other measurements may be taken (like trying to determine by hand). You may remove balls from the baskets but may still only take one measurement. How do you do it?
Big Daddy, Johnny, Burp, Aunt Zelda, Scott, Slurp, Big Momma
I have put up my own little riddles page. Time for a little slashdotting... ;)
Make even shorter URLs - 8LN.org
000 0
001 0
010 0
011 1
100 0
101 1
110 1
111 1
(a & b) | (a & c) | (b & c ) | ((a & b) & c))
Karnaugh Mapping...
'a'b 'a b a'b a b
c _ x x x
'c _ _ _ x
so the simplifications that can be made....
(c & (a | b) ) | (a & b)
there are no other 'little circles' that can be made on the map (as my EE101 prof was so fond of saying) therefore there are no further simplifications.
--Ks9
Why such an extrange answer?
r u crazy?
Explain your answer...
--
ACid
I would call it "the Bingo solution"...
- You are asuming that everyone has paper and pencil (or similar instruments).
- They have to be careful (not to loose the count of the days so that incorrect info is transmited)
- If the prisoners were taken at a regular pattern, they would never go out, but the text says "Everyday, the warden picks a prisoner at random" so there in no regular pattern.
The first days:
In average, in the first 100 days one should be picked in his own day, so himself and the next one who visits the room know that he has been there. Both can tell about it if they are chosen in that day.
The last dyas:
Probably, the last days before freedom many of them have their "bingo cards" almost complete and they are waiting for the last to be chosen to visit the room in his own day.
--
ACid
Maybe from the number of cars etc you could work out how many gas pumps there are in the US, but not all gas stations are the same size. some have multiple lanes and can cope with large numbers of cars simultaneously, and others are 2 or 3 pump mom and pop style operations (especially in small towns.)
Gas stations sell other things besides gas and oil.
This is the elegant solution I was looking for. I started trying something like this but didn't get it quite worked out, so I tried another tack. I'm glad you figured it out.
The only weird sort of problem with this solution is that if you are picked in order every day, you'll never leave. In fact, there are many orders in which numbers can be essentially "segregated" from each other, so that no one ever knows that everyone has already been picked.
But if distribution really is random, then this is definitely the best strategy. It'll certainly be quicker than my Master Counter way. Thanks!
He who refuses to do arithmetic is doomed to talk nonsense.
Comment removed based on user account deletion
They're being held in solitary confinement. There's no reason to assume they can all see the bulb every day. The Prisoner's and the Lightbulb is discussed more here.
He who refuses to do arithmetic is doomed to talk nonsense.
just a hunch
~ now you know
- STUPID: e
- CLIMBING SNAIL: 5 days. They left the trick out of this one. They should've made it 21 meters.
- 8-WAY CAKE SLICE: Cut it in half. Cut it in quarters. Line up all the quarters in a row and cut them in half.
- CHESSBOARD SQUARE COUNT: 8 * 8 = 64,7 * 7 = 49, 6*6 = 36, 5 * 5 = 25, 4 * 4 =16, 3 * 3 = 9, 2 * 2 = 4 . Answer is 64+49+36+25+16+9+4+1
- MONTY HALL SHOW: Always switch. This is a really famous problem. You can do the math pretty easily.
- GLASS HALF FULL: Tilt it. The top of the water should reach the upper and lower edges at exactly the same time.
- HANGING CHAIN: 0 feet
BTW AC was right 'bout my 1st answer.Life is too short to proofread.
43 days 8 hours 25 minutes
They spend 24 days forming a union, demanding equal rights for black and migrant workers, spend another 4 days deciding what kind of bricks they should make the wall out of. 23 more days are spent trying to determine which company should provide the bricks for the wall, then they all rest for 8 hours (lunch break, you understand) and finish the actual construction of the wall in 25 minutes.
Just like any gov't project.
Whoever stated that signature sizes should be limited to one hundred and twenty characters can just go ahead and kiss my
Always carry at least three condoms with you at all times, in case you a cornered by a group of women who demand immediate safe sex.
PHB: Uhh, where do you see yourself in 5 years?
I was asked that in October. I leaned over the PHBs desk and said:
"A fucking plane flew into my building 3 weeks ago. I don't think about the future too much."
I got asked 'What does systems analysis mean to you?' in a f*@#ing interview once, right out of school. What the hell kind of stupid question is that? The next thing I remember is this guy asking if I know how to structure a query in Access.
<rant>
I need to ask you tech interviewers something - do you guys ever research what you're hiring for before you jump in thinking you know anything? Being interviewed by someone who asks questions like these is both embarrassing and assinine, in addition to a complete waste of both the propect's and your time.
</rant>
You are all fartheads.
Nicely put, indeed.
An evil king has 1000 bottles of wine. A neighboring queen plots to kill the bad king, and sends a servant to poison the wine. The king's guards catch the servant after he has only poisoned one bottle. The guards don't know which bottle was poisoned, but they do know that the poison is so potent that even if it was diluted 1,000,000 times, it would still be fatal. Furthermore, the effects of the poison take one month to surface. The king decides he will get some of his prisoners in his vast dungeons to drink the wine. Rather than using 1000 prisoners each assigned to a particular bottle, this king knows that he needs to murder no more than 10 prisoners to figure out what bottle is poisoned, and will still be able to drink the rest of the wine in 5 weeks time. How does he pull this off?
...
.etc
SOLUTION: (Think binary)
10 prisoners 2 outcomes
0 = alive (not poisoned)
1 = dead (poisoned)
1000 bottles 10 prisoners 2^10 = 1024
each bottle is assigned a number 1..1000 this is convereted to binary.
this binary determine which prisoner (1..10) drinks it
eg:
bottle num: 1 = 0000000001 is tested by prisoner #: 1
bottle num: 2 = 0000000010 is tested by prisoner #: 2
bottle num: 3 = 0000000011 is tested by prisoner #: 2, 1
.
The number made by the 1s (dead) and 0s (living) is the binary number of the posioned bottle.
Jeez, folks, stop hiring such morons who can only answer trivia questions. All interviewees are worthless unless they can pass the Final Exam.
I can explanate how to administrate your network. You must configurate and segmentate it, so it can computate.
In an interview, you get time to ask maybe a dozen questions of the interviewee.
Every question counts.
It doesn't matter how sure you are that a question is good, if it's controversial at all, you should throw it out without a second thought, because you're basing a significant fraction of your value judgment about a person on a question of arguable merit.
Pick something else to ask about.
At my company, we like to use programming questions that cover material every developer has to know, but won't use every day, and so generally will have to exert a little bit of quick thinking to accomplish. Like writing a hash function (any hash will do), collection classes, clone methods, or nontrivial synchronization.
Just because it works, doesn't mean it isn't broken.
Let's call the mother's age M and the child's age C (in years).
:)
We know that:
M = C + 21
and
M + 6 = (C + 6) * 5
So solving the system we get:
M + 6 = 5C + 30
21 + C + 6 = 5C + 30
C + 27 = 5C + 30
C - 5C = 30 - 27
-4C = 3
C = -3/4
1/4 of a year is 3 months. 3/4 is 9 months. If the child is -9 months old, that means he or she will be born in 9 months, so has just been conceived.
The father isn't necessarily on top of the mother (fertilisation can happen up to 2 days after sex), but he's probably still around.
He may be trying to hold up his pants while running from her father.
Actually there would be another possible "smart" answer if the mother was a few years younger: the father is probably in jail.
RMN
~~~
(n/t)
The answer is not so obvious. Here are the four possible coin flip results (H = heads; T = tails).
H H
H T
T H
T T
If one coin came up heads then there is only a 1:3 chance that the other came up heads.
This is similar to the boy/girl probability question later.
I guess your mileage varies widely from mine, then. My last two interviews (4 years ago and 6 years ago) were very long. The 6 year ago one lasted 3 hours for the first interview and about 1.5 for the second. The interview for my current job 4 years ago lasted all day (8:30 to abt 3pm), but then again, they had flown me in from halfway across the country, so I guess they wanted to get their money's worth
I think if time is so short that you get "maybe a dozen questions" then you're doing it wrong. This person may be with your firm for years and have a significant impact on the projects he/she works on. The cost of the interview gets lost in the noise when considered against the productivity of a really talented dev or the cost of a really terrible developer. Take your time to get to know him. The good interviews I've had covered the gamut from basic electronics & programming to just "shooting the breeze" over lunch to see how I'd get along with the rest of the team. Trust me, if I felt I was being toyed with, I'd mention it. If no explanation was forthcoming, that's the end of the interview. I don't want to work for a bunch of elitist a'holes. The attitude at all fulltime jobs I've taken (not all the ones interviewed for, mind you) was basically to hire motivated people and let them learn specifics on the job. I like that: it lets me grow professionally, and the companies get new blood with different ideas instead of a bunch of people who just happen to be current with the latest buzzwords.
The Tourist Is Critical
Consider _Case 3_:
Three of the monks have red eyes, here's Monk "A"'s thought process:
I see 2 Red-Eyed Monks, that means they both see:
1 Red-Eyed Monk (if I have Brown Eyes)
2 Red-Eyed Monks (if I have Red Eyes)
Assume I have Brown Eyes:
Each of the 2 Red-Eyed Monks I see therefore see only 1 Red-Eyed Monk. Now then, each of them must be thinking:
Either there is 1 Red-Eyed Monk (him)
Or there are 2 (him and me)
Assume I have Brown Eyes
Therefore there is only 1 Red-Eyed Monk (him)
So HE must be thinking:
Either there are 0 Red-Eyed Monks
Or there is 1 Red-Eyed Monk (Me)
Tourist says there's at least 1
Therefore, I have red Eyes
I will kill myself tonight (night 1)
But, DAMN, he didn't end up killing himself
Assumption INCORRECT
I have Red Eyes
I will kill myself tonight (night 2)
But, DAMN, he didn't end up killing himself
Assumption INCORRECT
I have Red Eyes
I will kill myself tonight (night 3)
Monks A,B,C are indistinguishable - they all act exactly in the same way. Therefore A,B,C kill themselves all on the same night.
Midnight isn't key, you right, but because they always kill themselves in synchronization. Midnight just emphasizes this fact and makes for a better story
How many boards would the Mongols hoard if the Mongol hordes got bored?