|How would you test a coin-operated Coke machine?
||[Oct. 31st, 2012|08:21 pm]
What is your favorite interview question*? Could be one you love to ask candidates, could be one you've been asked yourself.|
I'm particularly interested in the real curve balls, the questions that stop the candidate short and make them think.
For funsies (did I really just type "funsies"?), I will answer your questions**, provided I see the relevance. If I don't see the relevance, I will ask you about it until I get it, and then answer it.
Because Facebook does not support message threading, please respond here if possible. Anonymous comments are enabled, but if you do post anonymously, I ask (but do not require) that you identify yourself in your comment.
Feel free to comment on other people's questions as well.
* Mine is the one in the subject line. Coke machines are ubiquitous enough that I don't have to argue back and forth about the spec, they're simple enough in concept that the test planning isn't too daunting, and there's enough discoverable complexity that this one question can keep a good candidate busy for pretty much the whole hour. I learn a lot about a potential tester from how they approach the Coke machine problem.
** Full disclosure: With hopefully a raft of interviews upcoming, I'm hoping to encounter the difficult questions here where I have a chance to rehearse my response, rather than being blindsided on the day. I call this "due diligence preparation", by the way, not "cheating". :) So feel free to tell me how I did with my answer!
This entry was originally posted at http://georgmi.dreamwidth.org/231994.html; please feel free to comment below or at Dreamwidth.
2012-11-01 07:05 am (UTC)
I think you gave me a version of the coke machine, but added that it took credit cards and connected via wifi to the internet to process sales... and it was interesting, this got me thinking about the different issues one could encounter with different versions of 802.11x... not only did that fill our time up but when Steve came in for his leg of the interview it spilled over into that as well. :D
The most fun I had with the MS interview was the brain teasers, back when they still did it. Most of the time I would get a strange look and they'd ask me if I'd heard that one before. Some, more than others, just seem so obvious they weren't worth writing down and labeling as a brain teaser. There was one about two bags of marbles blue and red... equal amounts of marbles in each bag. They are all mixed together and put back without regard to color into the bags in equal amounts again. How do you tell from the contents of bag 1 how many blue marbles are in bag 2. Seriously? The only brain teasing aspect of that question is how someone thought it merited being called a brain teaser.
But one that stumped me recently is... how do you walk a string and identify the first character in the string to occur twice? I gave three answers and they took away all those abilities I used to do it, then I was officially stumped. And they were noticeably disappointed. :(
Some of the constraints on the problem are:
1. You don't have enough memory to put the entire contents of the string in another variable
2. You can't use the built in InStr function in VB
3. You don't have enough memory to build an array, much less a multidimensional array
2012-11-01 04:23 pm (UTC)
Re: Brain Teasers...
Hmm. What do they mean by "the first character to appear twice"? Is it the first character that has a duplicate, or the first character that is a duplicate?
For example, in the string "abba", 'a' would meet the first case and 'b' would meet the second.
For the first case, declare a temporary variable, 'search'. For each character in the string in order, put the character in 'search' and walk the rest of the string looking for a match. When you find the match, Robert is your parent's male sibling.
For the second case, declare two temporary variables, 'search' and 'found'. For each character in the string in reverse order (start with the last one), put the character in 'search' and walk the rest of the string backwards looking for a match. When you find a match, put the character in 'found' and move to the next character. When you have finished the entire string, the character in 'found' is your answer.
Obviously, you'll have to account for the case where no match is found, but that's pretty trivial.
Oh, that was another constraint, you can only walk through the string once.
2012-11-01 05:07 pm (UTC)
Re: Brain Teasers...
So basically they're looking to see if you happen to have the one arcane piece of knowledge that lets you perform a useless operation in a degenerate environment. Assuming that piece of knowledge exists.
At the point where they had closed off the last thing I could think of, I would say, "that's the best I can do, but it's going to be distracting me the rest of the day if I don't get closure. How would you do it?"