4 ms·
Yeah these sort of questions are pretty ridiculous. Though I wonder what the intent is here, say for the first question - "What is the pattern here ?" After l
by supercoder 14y ago
Yeah these sort of questions are pretty ridiculous.
Though I wonder what the intent is here, say for the first question - "What is the pattern here ?"
After looking up the solution on wikipedia - http://en.wikipedia.org/wiki/Look-and-say_sequence http://en.wikipedia.org/wiki/Look-and-say_sequence I would have to admit there is no way I'd figure that out without knowing the concept ahead of time.
So are they looking for someone that knows the 'look and say sequence' explicitly ? Same way if you presented the meaning of numbers 80 or 443 to someone they'd either know or not, but not be able to guess.
Or did they actually expect someone to work it out on the spot ?
- mattgreenrocks 14y ago> Or did they actually expect someone to work it out on the spot ? My hope is that they'd hope a candidate would be able to identify the connection to run length encoding within the pattern. Why do these puzzles emerge at big companies? It looks like a sort of institutional power trip emerges: "if you want to work with us, you need to be real good, and these are the sorts of problems we want you to think we deal with every day!" Except in most cases, they aren't, and there are plenty of mediocre folks already employed there. But the institution NEEDS to believe it only hires the best, and one way to perpetuate that belief is to haze new applicants more and more. All it really produces is candidates who are very lucky, or very compatible with the existing culture. Hiring is hard, and puzzles are a fail-fast mechanism that is terrible, but produces some sort of results, so it gets used.
- johnmw 14y agoI think Cletus gave a good answer to why these questions are used in interviews in this post: http://news.ycombinator.com/item?id=5264510 http://news.ycombinator.com/item?id=5264510 In short, if you can't write a simple FizzBuzz program, then you are probably not a good developer. Questions like these are good for being a quick way to separate programmers from those who cannot program at all. But I agree - as someone who sucks at puzzles under pressure, questions like 'what's next after 111221?' seems like a totally retarded question to me.
- mattgreenrocks 14y agoFizzBuzz is a legitimate litmus test for a candidate. It probably becomes a bit gauche once you get a bit of experience, however. In that case, I'd expect some sort of domain-specific technical question with some hand-holding to get the candidate talking. The idea is to coax the candidate into the problem.
- rbehrends 14y agoYes, the problem with the look-and-say sequence is that it's not something that you can derive; it requires having the right insight. This makes it a bit different from other problems, where the interviewer is often not even so much interested in the solution, but in how you go about finding one. Many other sequence problems are amenable to a more systematic approach that at least tell them something about your problem-solving techniques. With the look-and-say sequence, you either see it or you don't. Regardless of whether you got it right or not, it doesn't tell an interviewer much about you, and is therefore not a good use of the limited time they have with you that could be used more productively.
- tubs 14y agoIt looked like it was a simple L-system to me... V : 1 2 ω : 1 P : (11 -> 21) (2 -> 12) (1 -> 11) I think that matches the information given in the question. Would that be an "incorrect answer"?
- gmt2027 14y agoAccording to wikipedia[1], the sequence goes 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... [1] http://en.wikipedia.org/wiki/Look-and-say_sequence http://en.wikipedia.org/wiki/Look-and-say_sequence
- tubs 14y agoAye, but the L-system still fits given the amount of data shown in the question. So is the L-system incorrect, because there's no way to disambiguate the sequence given the data?
- raverbashing 14y agoI think you're right on the money Your major problem would be finding an interviewer who knows what's an L-System Edit: you should add the rule 111->31, so it may not be an l-system because there are infinite rules? (1111->41), etc Or we limit it up to digit 9
- PeterisP 14y agoThe whole point is that the provided data supports many different completely valid sequences - unless that specific 'look-and-say' is very common in the company problem domain, there are multiple valid answers. That's an issue with any sequence-style problems.
- bmuon 14y ago> Or did they actually expect someone to work it out on the spot ? I just figured it out on my own, from the comfort of my home, while having breakfast. In an interview with a top notch company that'll be a totally different story.
- Joe-Z 14y agoWhile I also doubt the value of this kind of questions in interviews, I don't think that figuring out this sequence is impossible. I figured it out by myself too when I saw it the first time. Of course that doesn't count for the increased stress levels in an interview situation.
- lucian1900 14y agoIt's also extremely unfair to non-native English speakers.
- roberto 14y agoHow come? It works in any language.
- ajq5623 14y agoIf you add the digits in the sequence you get the Fibonacci sequence. [1 = 1, 11 = 2, 21 = 3, 1211 = 5, 111221 = 8] => [1,2,3,5,8] I'm not sure if there being multiple "correct" answers makes me like the question or hate it. The Fibonacci sequence seems a bit more obvious though than the "look and say" answer.