4 ms·
It's really annoying when somebody gives examples of difficult unsolvable problems when in fact they're pretty damn solvable. For example, instead of an "index
by SamReidHughes 10y ago
It's really annoying when somebody gives examples of difficult unsolvable problems when in fact they're pretty damn solvable.
For example, instead of an "indexable skip list" (whatever that is) I'd have said a red-black tree (or whatever) where each node keeps track of how many elements are in its subtree. At least if a simple log(n) solution is tolerable. And you know, I've never seen this problem before. I didn't "memorize the answer." You have to put together general background knowledge and find a solution. Putting summary information on the nodes of a tree is a general-purpose data structures trick.
Also, take, for example, the cycle finding problem. I came across that question once in a low-pressure situation and invented Brent's algorithm. Today, that is a bad interview question because it's too famous. But generally speaking it's very easy to solve if you've never seen it before: maintain a hash table of the pointers you've seen. Does that take up too much space? You can adapt that solution to use less space.
Granted, there are developers that can get some kinds of useful stuff done that can't figure out math problems or algorithms problems on the spot, but it's wrong to conclude that other people are memorizing answers to these questions. After all, interviewers at some companies are trying to come up with questions and tasks people haven't heard before and keep their questions secret.
- deleted 10y ago[deleted]
- greenleafjacob 10y agoAn indexable skip list is a skip list annotated with, like you said, the number of elements in the sub list. I think you are discounting the setting of the interview. It's not an impossible question, just like it's not an impossible question for an electrical engineer to discuss PID control tuning, but it's something that is not very appropriate for an interview. There's a reason these style interviews are called "grilling". Interviews are stressful without the pop quiz style questions. One could easily misread the question as "calculate the median of a list of integers" and forget the sliding window aspect of the question, and spend 15 minutes explaining sorting a list, grabbing the middle element, then getting thrown off when they realize it's a data structure question instead. These are reasonable problems outside the interview context, but not appropriate within.
- SamReidHughes 10y agoYou can always screw up an interview, or maybe some interview process is suboptimal, or some people feel pressure. But the claim you made was that these are questions that you memorize the answers for, that they're trivia questions. I can tell you, I have not, in any interview, in the past 7 years, gotten a question that I already knew the answer for. And I've asked questions that people didn't already know the answer for, and guess what they do? Many of them figure out the answer. After all, they're questions designed to be ones that you can figure out the answer to in 20-30 minutes.