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."
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!!
I believe you are the guy on goatse.cx.
My first thought was, where are the answers. My second thought was, thank god I have a job.
"Karma can only be portioned out by the cosmos." -Homer Simpson
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?
I thought for days about this riddle, but it is impossible! I give up! Nothing could be the answer to that!
Can't you just xor all three numbers?
return (a^b^c);
--
Promoting critical thinking since 1994.
Nothing.. unless you're an atheist in which case your riddle isn't cross-platform ;-)
"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.
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?
"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?"
How is the view from the Ivory Tower?
Here is what actually happens:
I have 25 minutes to write out the parser. It's 11:35am September 30th, and our guys in marketing promised that C-Checker 5500 would be out in September. If its not finished on time, management will start complaining that we need to double the number of programmers or something crazy like that.
The hard part of the problem is variable identifiction. Have to look up the standard keywords again and type them in, and make allowance for a couple of other things.
After finishing that part I've got 10 minutes left.
Now I zip through with a little routine that takes the first varible it comes across and replaces it and all future occurences of it with VAR#1, and so on.
So I run my program on the main development project to test it out.
I press compile on the modified program. Cherchunketa, cherchunketa --- boom! Compilier error messages out the wazoo.
Who the hell named his loop counter VAR#37534? Goddamn that bastard! Who the hell does something that crazy?
Now I have 3 minutes to implement the fix. Do I write in the simple check algorithm that all the CS students you managed to trick came up with?
Hardly, I rename the thing to VARXY750#XXXXXX, and wait for a bug report.
As for the triple redundancy problem. Before you start going into your ANDs and ORs and wherefores, there are a few things to keep in mind. First off, if its really important, you need some non-local copies. What if there is a hard-drive crash? Or a nuclear war? The internet will still be around even if the main office is a glassed over glowing area in the North Western U.S. If it's important enough for triple redundancy, it's important to survive any forseeable catastrophe isn't it? So now you have to encrypt the numbers coming and going, and sign it, to keep the hackers from fooling you.
And so what is the easiest way to implement all this? Simple--there is no simple way. It'll take a lot of work. So you might as well throw your computer out of the window and tattoo the number to the back of your hand.
Because the holes are round.
I mean, really, any other shape wouldn't fit...
*ducking*
My video compression blog
Oh, that's easy. Martha Stewart.
Sig? What sig? Do I have to have a sig!?!?
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'."
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...
You're right, these are easy. Take this one:
You are in an empty room and you have a cup of water. The cup is a right cylinder, and it looks like it's half full, but you're not sure. How can you figure out whether the cup is half full, more than half full, or less than half full? You have no rulers or writing utensils.
Obviously, you
1. Grab the cup with your thumb at the water level.
2. Pour the water into your mouth, but don't swallow.
3. Whip out your dick and piss in the cup, up to the level of your thumb.
4. Spit the water back into the cup.
If the water + piss fills the cup exactly, the cup was half full. If it spills over, the cup was more than half full. If it comes up short, the cup was less than half full.
Do I get the job?
Could Jesus Microwave a Burrito so HOT That Even HE Couldn't eat it?
>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