- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Wear mirrored sunglasses.
Admin
Oy. Some folks need it spelled out explicitly 8 coins. All visibily identical, but one heavier.
First weighing: 3 coins versus 3 coins, with two held out. If the weighing is balanced, then the heavy coin must be one of the two held out. A second weighing shows us the heavy coin. If the weighing is NOT balanced, than the heavy coin must be one of three. Two are weighed, and the third is held out. The heavy coin will either be on the scale, or if the scale is balanced, the heavy coin was the one held out.
Two trials, no fuss.
Admin
Six correct, 2 incorrect. That's 75%, which is better than my 50% solution.
Admin
Yeah, I don't really see how problem-solving skills would apply to a career in programming.
/sarcasm
Take the problem of weighing the airplane. There is no correct and practical answer. But how would YOU approach it?
Admin
Admin
I confess that I have "How Would You Move Mt. Fuji" at home somewhere, and worked on a large number of the riddles.
The "five pirates" riddle (google it) is still one of my favorite riddles ever, and the inmates and two switches is probably the second.
I think that the benefit of these questions depends on the interviewee being indulgent enough to view the problem as the intended mathematical or algorithmic problem, and to form a precise answer. I say "indulgent" precisely because, obviously, it pisses off a lot of reasonable people who have decent answers outside the weird world where pirates and prisoners are collaborative mathematical geniuses.
As I see it, the context of the problem is there mainly for entertainment; Instead of asking you to distribute loot among very clever pirates, how would you feel if an interviewer asked you to "Determine the maximum possible value of L1,1 for some values L1,1 to L1,5 where LA,1 to LA,5 = 100 for all A, and LM,N = 0 where M < N and LX,Y > LX-1,Y for half of all nonzero blah blah blah..." PIRATES, man, PIRATES!
Admin
A: three litre jug B: 5 litre jug
Fill A and pour into B; Fill A and pour into B what you can; Dump out B; Pour the remainder of A into B; Fill A and pour into B;
So they don't fall in.
This one is too long to type out
Admin
I interviewed for MS once and was asked a few of these questions. I probably failed miserably, but not because I am incapable of answering the questions. Answering these is just not in my frame of reference when I am interviewing. I prepare carefully for the subject of the job, and I guess I'm blindsided when concentrating on having a good interview and then suddenly thrown a question out of context. I think this would be the equivalent of walking over to a software engineer's cube and asking them the appropriate temperature at which meat can be assumed to be fully cooked. Why the hell would most engineers know that?
I did, however, ask why the person was asking me the question. The response was, "I want to see how you think."
Well....I have since come up with the exact answer I will give the next time (if ever...I doubt I'd ever apply at MS again) I am asked this question:
If you are asking this question to see how I think, then there can be no right or wrong answer. Unless you have specific criteria in which you will give me some sort of "grade" by which to compare me to other candidates that are asked the same question, what you are really asking for is my opinion. In my opinion, a question that involves solving a puzzle is hardly relevant to providing a software solution to a non-arbitrary, real world business problem. But since you asked, here is what I think:
Did the people that architected, approved the release of, and implemented that disaster called ActiveX prove that they were exceptional people by answering this type of question? Would you hire them now if you could see the future? If I let you watch me write an ActiveX control right now that pwnz0r3d your box, would you hire me?
How about the people that came up with COM/COM+ as the future of cross platform development? I guess that little performance problem called marshaling that is done WITH EVERY SINGLE METHOD CALL sort of killed it, eh? Not to mention that it never actually went mainstream with those bogus cross platform problems.
Microsoft Bob. Enough said.
If this interview method lets you only choose brilliant people, why is it that so many security holes are found in your software that involve simple buffer overruns?
Did the developers and QA people responsible for letting BizTalk 2004 out the door when it would crash when receiving a file larger than 2GB (or was it 3GB?) prove they were k-k00l, aw3s0m3, and l33t people by answering these questions?
I could seriously find a lot more points I think. If your interviewer, imho, can't figure out if you're skilled from just asking you questions about relevant past experience or even questions relevant to the job position, they are the wrong interviewer.
Admin
Admin
Not a WTF in the least, we're really scraping the barrel now aren't we?
Questions like these can be a useful way for an interviewer to guage how a potential employee thinks.
It doesn't matter whether they get the brainteaser right or not, it's how they approach the problem and how they communicate to you what solutions they're considering and discarding and why.
Someone who say there silently for 60 seconds and then gave the correct answer would get less credit from me than someone who talked coherently and briefly through several possible solutions and made a justifiable choice out of them.
Think of it like an exam question with the little bit at the end that says "show your working".
If I was interviewing this guy would have got the job based on his ability to recognise fucking stupid requirements and meet them without costing me much time or money or upsetting the customer.
Admin
Google it--err, I mean Live Search it!
Admin
Admin
That's pretty easy: just designate only one person who will guess his hat color. A random answer would already have 50% chance of winning. To bring it to 100, designate another person who will communicate the right answer to the guesser when lookng at him. It could be something as subtle as eye movement, or blinking if the hat is red or whatever. Good luck proving that the "no communication at all" rule have been broken then.
Admin
If you don't know if the odd coin is heavier or lighter, the binary search will have exactly the same problem as the ternary solution. I haven't worked through the worst case scenarios, but in both cases it should be significantly more than 4 weighings.
Admin
For this question, if you also have to tell in the end if the odd coin is heavier or lighter, my solutions gives 2 as the best case, and 4 weighings in the worst case. It won't take more than 4 to find the odd coin and also know whether it was lighter or heavier. I dont think I used either Binary or Ternary...
Admin
RE: hat riddle
Simple: make a mental note of everybody's toin coss result and correlate that to the color hat they are wearing. You now know what color hat you are wearing based on your coin toss.
Admin
The first person that sees two hats of the same color should pass. At that point the other two participants will know that they are wearing the same color hats and will be able to guess correctly.
Admin
"And that candidate will be the same person who designs their software."
their software?? c'mon, it is MY software! it is on MY machine. I use it, not they! i use it every day! i'm quite sure this guy is the same who wrote the part in explorer for deleting files. as deleting a single file takes 5 seconds on my pc.
Admin
The interviewer wants to find out if you require a 20 page document explaining every functional requirement for each method. Or can they say "Hey, go write BlahBlahMethod()." and you can basically figure out what they need.
Admin
Admin
For the hat thing: Assuming that you aren't allowed to communicate in any way (including pointing, jumping up and down, and so on) and that you can't see your own hat and so on, then the best you can do is have one person guess for 50/50. You have no matter what a 50/50 chance of guessing your hat color - the problem says you have a 50% chance of red, a 50% chance of blue, and learning about what others have does NOT tell you anything. All those who think otherwise have not learned probability.
Admin
Answer: "The Aristocrats"
Admin
Hat question:
The problem explicitly states that no communication is allowed, however, it is possible to communicate in many non-standard ways. Depending on the attitude of the test-giver, it is possible to solve this with 100% success every time:
Captcha: Yummy. Mmm, "Hats Of Meat".
Admin
That's the one that I've heard of. Took me a long time to get the answer and would never have thought of it in the span of an interview.
Turn on switch A for a couple minutes. Turn A off then turn on switch B. Quickly open the box. The bulb that's on is switch B, the bulb that is off but is still warm to the touch from being lit is switch A, and the remaining bulb is switch C.
Mind you, with LED and compact fluorescent bulbs becoming more popular because of the regulation on power usage for incandescents, this solution will quickly become invalid.
Admin
I interviewed with a company that asked for a written response to "how do you move a mountain from one side of a town to another". (My answer, by the way: move the town.)
This is a great question (especially if you have a while to think about it.) Not only did it give me a chance to show off elements of my personality that wouldn't normally come through in an interview, but it gave a question for which I knew there was no wrong answer and made me relax a bit. Now maybe there are some folks who don't like writing or creative thinking, but I wouldn't want to hire them anyway. Programming is all about being creative, and if you can't write a paragraph answer to a silly question, how are you going to write a spec sheet?
So I would advise that when faced with these questions is to just relax and answer creatively, constructively, and in a way that showcases you. There worst thing you can do is stress about it because it "doesn't test" your programming aptitude.
Admin
Hats question.
Before you go into the room, 3 of the people make a plan. Two of them will go into one corner of the room. If they have the same color hats, the third will join them. Then both of them will know what color their hat is.
Everyone else just sits down.
Admin
Actual questions I got at an interview (not with MS):
I was told the point of these questions was to see how comfortable I am to admit that I don't know the answer. The only problem is the situation -- when I'm at an interview, I feel like I have to give an answer. In normal work I'd have no problem admitting I don't know, or I'd just go look it up. You can't use the interview to see how someone will act in a typical work environment. There are certain expectations and pressures at an interview that simply aren't there when you actually hire a person.
Admin
The number of people who don't have the reading comprehension to handle the riddles here is utterly appalling.
Admin
If you state that you expect loud thinking not correct answer - then, yes I agree with you. Otherwise, you have a problem. There is a lot of different level of recruiters. Some of them are smart enough to figure out that the thinking is important, some of them think that the answer is. How, should I know what recruiter is expecting in such situation?
I would put in another way. Recruiter should be able to communicate what he is expecting, not just state the problem and hope that you got the right way to answer it.
Lately, I had both types of recruiters. I still have a problem when deciding which way to go. This not only applies to teasers, some questions even from programming are ambiguous.
Admin
That's pretty good advice. The only thing I'd say to this is that I'm not stressing because it doesn't test my programming aptitude (which it clearly does not). I'm stressing because I'm not great at solving brain teasers.
I interviewed (over the phone) at a place that did brain teasers. The main thing that the interviewer stressed was that he didn't care if I got the right answer but rather he wanted to see how I worked it out. I required a few hints from him on the answers but in the end, he said I did pretty well.
If you're going to use brain teasers, that's the way to do it. However, I still think they shouldn't be used at all.
Admin
"If you are asking this question to see how I think, then there can be no right or wrong answer."
That's the wrong answer here at my shop, at M$, or anywhere else.
Getting the right solution is just for bonus points. If you can demonstrate that you have conceptualized the problem and have some idea as to how to attack it that will lead you to the right answer, you've passed the test. I'm mystified how people who claim to be qualified programmers could fail to be able to do something that simple, let alone balk at attempting it.
Admin
Read the problem. They must answer simultaneously.
Admin
Is it just me or is WTF loosing the grip with it?
It's several months since I've started reading it daily, but it seems to me you're trying to grow a bit too much struggling to get the content...
Do one thing, do it well and do another one when you're ready to do it, otherwise you'll mess up everything.
Not only Microsoft but oogle as well is famous for using puzzles in the recruitment process, so maybe it's useful, you know we're talking the two major software companies in the global market!
And, by the way, if so many comments are about puzzles does it mean only bad programmers do read the daily WTF .... mmmmh should start thinking if I have to keep reading it!
Admin
As is the number of people who take internet forum postings so seriously.
Admin
Concerning the 8 coins.
If you don't know if one is heavier or lighter, how is binary search going to work? You weigh 4+4. One side is heavier. Is it because the heavier side has the heavy coin or is it because the lighter side has the light coin?
Admin
Actually, Microsoft doesn't ask brainteasers on the interviews. Wall Street companies do.
That is besides the completely moronic idea that the people who can solve brainteasers are less capable to be software developers than people who don't.
Admin
Agreed. Everyone who has been saying that you have a 75% chance of winning is incorrect. In fact, what people are calculating is that, on average, 75% of the hat outcomes will be two same colour, one different. Once the three hats have been picked, there is still only a 50% chance that you will guess your hat correctly because of the coin toss. The optimal solution is still "two people pass, one person guesses", but everyone has been calculating the win probability incorrectly.
Admin
Three women want to [redacted] with you, but you only have two condoms. How do have safe [redacted] with all three?
This was an actual interview question!
CAPTCHA: bathe - which is NOT the answer above.
Admin
It requires an extra weighing.
Admin
why call boeing when you have google?
empty weight for a 747-100 is 358100 lbs, and the 747-400 weighs in empty at 399000 lbs
Admin
[quote user="Ken][quote]Hat problem - make the strategy be: The person who sees two other people with the same colour hat calls out the opposite colour. He's got a 3/4 chance in being right. There is a 1/4 chance that they are all the same colour, in which case they'll all call out the (wrong) opposite colour.[/quote] Hmm... (Using "0" and "1" rather than "red" and "blue".) 000 -- Result: everyone yells "1" -- wrong 001 -- silent/silent/1 -- correct 010 -- silent/1/silent -- correct 011 -- 0/silent/silent -- correct 100 -- 1/silent/silent -- correct 101 -- silent/0/silent -- correct 110 -- silent/silent/0 -- correct 111 -- 0/0/0 -- incorrect
Six correct, 2 incorrect. That's 75%, which is better than my 50% solution.[/quote]
Solution...as stated earlier...say what is to your left actual -- said -- result 000 -- 000 -- all correct 001 -- 100 -- middle correct 010 -- 001 -- first correct 011 -- 101 -- last correct 100 -- 010 -- last correct 101 -- 110 -- first correct 110 -- 011 -- middle correct 111 -- 111 -- all correct
In all cases at least one person is right. 100% of the time you win!!
captha: onomatopoeia
Admin
Ternary search can get the final result with exactly three weighings.
To start, you have 16 possibilities (each of the 8 coins could be either heavier or lighter). Weigh 3 coins on either side, with two left out.
If the batches of three coins are unequal, you have six possibilities (3 possibly heavier; three possibly lighter). If we call these H_1, H_2, H_3, L_1, L_2, and L_3, weigh H_1 and L_1 against H_2 and L_2. If H_1 L_1 > H_2 L_2, weigh H_1 against a known correct coin (for example, one of the two coins left out of the original weighing). If heavier, H_1 is heavy; if equal L_2 is light. Similarly, if H_1 L_1 < H_2 L_2, weigh H_2 against a known correct coin. Either H_2 is heavy, or they are equal, in which case L_1 is light. Finally, if H_1 L_1 = H_2 L_2, weigh H_3 against a known correct coin; either it is heavy or L_3 is light.
If the original batches of three coins equal, you have four (2 coins, either heavier or lighter). You have two weighings left (only one used), so weigh each against a known correct coin.
The key in each case is to make certain that the number of possibilities remaining, no matter what the result of your current weighing, is equal to no more than 3^(number of weighings to use).
Admin
Admin
It's like the "Let's Make a Deal" problem, where you have a 2/3 probability of winning by switching. However, that problem only works if Monty truly picks a door at random, in which case 1/3 of the time he exposes the real prize. In "real life", Monty skewed the odds by knowing ahead of time which is the correct door.
Admin
If one person is wrong then everyone loses. Your solution has a 1/8 chance of winning.
Admin
Disagree. You're both wrong, and you'll probably never understand why.
Admin
Or more succinctly put: The hat colors of the other two people have absolutely no bearing on your hat's color.
This thread has given me a lot of good retorts for when such an interview question is fielded. It's not about figuring out the question, but figuring out why they're asking the question.
Admin
It's pretty obvious that all strategies are equally effective here, because the only information a player gets before guessing is independent of his own hat color.
Admin
I think we've discovered the WTF right here.
Admin
In 75% of the cases, at least one person is wrong. You lose 75% of the time!