News for hackers. Stuff that matters.
Re:Data Structures Reference by kylnew on Friday June 29, 2018 @06:48PM (#17428440)
I recently got double slammed with 2 graph questions during an interview after having navigated for years without getting a graph question. It's wholly irrelevant to my day-to-day work but I do hobby game development sometimes which involves more needs for graphing. Still, I can't do much of anything with a graph on a whiteboard. Puzzled as to why it's so important to some companies to grill on this stuff, expecting it to be top-of-mind, even for front end roles.
Re:Data Structures Reference by maxcut on Saturday June 30, 2018 @06:00AM (#17430214)
I have given a lot of thought to the interview process over the years. As a candidate I really disliked whiteboard questions and trying to come up with clever solutions on the spot with hard time and resource constraints. I was always frustrated with how different the interview experience was from actual day to day work. As an interviewer I much prefer a hands on experience with internet access. For that I have prepared a short app riddled with some bugs and half baked features to be completed. For me it is really important to see how a candidate copes with an existing codebase as most people work in environments with large and mature ones. It is also important as the interview progresses to see when and how the candidate resorts to online resources and how they conduct their search. Some just continue to bang their head when they encounter a problem or DFS into the first search result they encounter while others cleverly start opening a few tabs and evaluate proposed solutions before selecting the one that is most suitable for the current problem they are trying to solve. Most candidates after completing the interview stated that they preferred this method to 'traditional' ones and some even said that they enjoyed it.
Re:Data Structures Reference by gaius on Saturday June 30, 2018 @08:08AM (#17430549)
Puzzled as to why it's so important to some companies to grill on this stuff

Because contrary to the narrative, there is no shortage of developers, there is in fact a glut so companies can not only afford to be choosy, they actually need to filter early to keep volume of applicants manageable. At least that is my interpretation of the evidence, I am curious if there is another explanation.

I can remember when there really was a shortage of developers, the dotcom boom. Companies couldn’t shove people in the door fast enough, an interview was a quick chat followed by “when can you start?”. Today it’s nothing like that. In a genuine shortage there is no ageism etc either, noone can afford it.

Re:Data Structures Reference by throwawaymath on Saturday June 30, 2018 @08:31AM (#17430640)
"Shortage" is always a funny term in these discussions, and it always starts a debate. It's too simplistic and disagreeable a term.

I agree with your point but I think it should be clarified. There is probably not a theoretical shortage of people who can be called "software developers" compared to the number of jobs available. But I find that shortages are relative. Companies make their own bars for who they're willing to hire, and how far above or below a given baseline level of competency they'd like to target.

Not all software developers with that title can be software developers at any given company. This is not just because they don't know the underlying theory or because they don't know "real" engineering. So it's much harder to discern if there's actually a shortage, because obviously not all jobs with the same title involve the same specialization or skill requirements.

I think that a more charitable interpretation is Google and other such companies use these interviewing practices because their ideation of a "software developer" is substantially different from the all-inclusive title. It's not just an arbitrary way to reduce the stack of resumes, it's an imperfect proxy for their actual criteria.

Re:Data Structures Reference by godelmachine on Saturday June 30, 2018 @10:44AM (#17431013)
If you have read Cracking the Coding Interview, the author describes a guy who was hired in her company because there was super shortage of developers. The guy barely knew HTML. He used to come late to office, play ping pong and take off before sundown.

I believe things were quite similar in India during the dotcom bubble. Candidates were asked to do some addition programs, hir d immidietely, and within weeks their H1B was sponsored.

Re:Data Structures Reference by jopsen on Friday June 29, 2018 @08:39PM (#17428873)
It's no secret that interviews at crazy, it's like an exam, and you should prepare accordingly. Yes, it's largely irrelevant.

But an engineer who can't reason about DAG, topological sorting, etc, could easily ruin an otherwise elegant architecture :)

Re:Data Structures Reference by WalterBright on Friday June 29, 2018 @09:54PM (#17429085)
> it's largely irrelevant

Maybe not. Wouldn't you prefer a candidate who did prep work before an interview rather that one who chose to wing it?

Re:Data Structures Reference by jacobolus on Saturday June 30, 2018 @01:00AM (#17429552)
If they were just out of school and currently unemployed with no dependents, sure. Otherwise, memorizing answers to homework assignments from an intermediate algorithms course seems like a poor way to spend significant time for someone whose job/career does not actually involve repeatedly implementing well-studied low-level algorithms from scratch on a tight deadline with no ability to look up reference materials.
Re:Data Structures Reference by clarry on Saturday June 30, 2018 @04:34AM (#17430017)
I'd definitely prefer someone who doesn't feel the need to prepare and cram for irrelevant trivia exercises.
Re:Data Structures Reference by platform on Friday June 29, 2018 @09:25PM (#17429008)
Perhaps I do not quite understand what you meant by 'engineer that cannot reason'.

Somebody might not be able to write on a white board, during an interview a topological sort or find-a-union (https://www.hackerearth.com/practice/notes/disjoint-set-unio... ).

But does it mean that they will ruin 'elegant architecture'? (compared to somebody who passed the topologica sort exam)?

Also, wouldn't an architecture that imposes compile time constraints, good documentation and test cases -- on the usage of its most elegant pieces, be more 'elegant' than the one, that could be easily 'ruined' but somebody who does cannot write out a 'topological sort' during an interview?

Re:Data Structures Reference by perfmode on Friday June 29, 2018 @09:47PM (#17429063)
Have you never worked with weak engineers?
Re:Data Structures Reference by rmwaite on Friday June 29, 2018 @10:20PM (#17429156)
I think their point is that just because someone can’t whiteboard something doesn’t mean they can’t reason about it.
Re:Data Structures Reference by atmartins on Saturday June 30, 2018 @12:04AM (#17429417)
Have you ever worked with arrogant ones?
Re:Data Structures Reference by anothergoogler on Friday June 29, 2018 @10:28PM (#17429184)
The problem with using trivia as a hiring filter is it doesn't do a good job of differentiating between those who don't know a thing, and those who know nothing, unfairly penalizing the former.
Re:Data Structures Reference by ozim on Saturday June 30, 2018 @03:51AM (#17429928)
But it is easy to filter out those who think they know something when they blurt out correct responses like machine. But in reality they just lerned canned responses. Usually you want to discuss problem to see reasoning. If there is no reasoning just canned response, that is big red flag. That person probably lacks any depth of knowledge and doesn't understand why the question is asked.
Re:Data Structures Reference by threatofrain on Saturday June 30, 2018 @02:25AM (#17429747)
Can you predict engineering performance from whiteboard exams? I wager Ravens Matrices would do better than your whiteboard exams.
Re:Data Structures Reference by platform on Friday June 29, 2018 @11:41PM (#17429357)
I did. Some of them, I think, would be able to pass these types of data structures test.

I observed 3 characteristics that they had. (not that I was thinking about this before, but since you posed the question...)

1) They lacked ability to leverage others people work.

(and with that, they lacked the ability to quickly review/search/understand available corpus of knowledge )

2) they were not afraid of complexity in coding, but they seem not be able to 'conceptualize a problem' at level higher than code and technical data structures So that produced very complicate/fragile system.

That, I would call too 'literal' in interpreting the immediate business needs. Normally business needs/requiremetns are observeable gaps in some existing process, or in a high level intent. And as such -- these requirements are not 'designed'. So literally interpreting them causes the solutiosn to be short-term, that look like small 'projects', rather than products.

Specifically, they were not able to design with 'composability' in mind. Where the flexibility did not just come from 'millions of configurable attributes', but instead would come from composing working, well defined pieces - together (at the level of data models & UIs, associated with each composable element, not just code).

3) When analyzing performance problems -- they tended to solve them by optimizing details, and not looking at problem statement itself.

In other words, in my experience -- there is rather huge difference between being able to 'find solutions' from existing corpus of knowledge -- vs -- 'being quick on ones feet' so to speak, and being able to code on white board, data structure algorithms on the interview.

I normally look for people who can construct& compose from existing pieces (that includes not just code, but also articles, research papers, analogies from solutions in other domains, etc).

So I tend to look for folks who demonstrate that they can parse large corpus of knowledge, learn quickly, and reason pragmatically.

Of course, as the person describes their experience -- I tend to look for clues on what they concentrated on, what they found difficult/easy, how they leverage other's people work and why. Did they contribute to open source/etc.

I am not sure if being able to write a topological sort on an interview, automatically precludes a person from being able to reason about composable abstractions. But I just saw folks who do well on these types of interviews, but then not be able to 'increase the average of my teams', that consisted of folks who could not write those things at the interview.

Re:Data Structures Reference by yxhuvud on Saturday June 30, 2018 @01:40AM (#17429633)
I mean, tsort is already a library function. The important part is knowing it exist.
Re:Data Structures Reference by nlawalker on Friday June 29, 2018 @07:30PM (#17428662)
>> Puzzled as to why it's so important to some companies to grill on this stuff, expecting it to be top-of-mind, even for front end roles.

Either they do consider it important to the role, or they are trying to select for young CS grads, or they just haven't tried to do any better in their hiring process, or they don't know how.

Re:Data Structures Reference by cipherzero on Friday June 29, 2018 @10:49PM (#17429243)
Maybe I’m not like the interviewers/companies to which you’re referring, but I ask a DAG topo sort question (dependency resolution/task ordering) not because I expect the candidate to regurgitate the algorithm but because I legitimately want to see how they work through a problem - especially one they may(hopefully) not be familiar with.

Most of the time I don’t care if they get the optimal algorithm, rather the can think through something and know where problems might be.

Might not be how/why the “others” use that question, but its worked well for me.

Re:Data Structures Reference by meritt on Saturday June 30, 2018 @01:51AM (#17429662)
Because a large proportion of "software engineers" are simply people who know how to use popular libraries/frameworks to crank out a simple website or app (which often satisfies the needs of most companies anyway).

Some companies prefer to hire people who can write software.

Re:Data Structures Reference by timClicks on Saturday June 30, 2018 @03:27AM (#17429884)
Surely most interviewers are interested in things that are slightly more abstract than answers to specific data structure question.

1) has requisite base level of knowledge, 2) shows humility/knows own limits, 3) has an ability to explain complex ideas simply, 4) demonstrates an innate curiosity and 5) can work through problems methodically

Re:Data Structures Reference by xtiansimon on Saturday June 30, 2018 @08:50AM (#17430709)
Once in an interview a senior designer walked in on my interview. They were introduced. Hung out for a minute. Wrote something on the whiteboard, then left. My interview ended, I was left in the room for a minute and I stared at that frackn whiteboard wondering what that was about.

I didn't get the job, but I had to assume this was something that senior designer was into--something they cared about, something they used, a skill they wanted to manage, a subject they wanted to discuss.

User ItsMe000001 says he was asked about a 'right join', choked during the interview, was still hired, and later became the go to guy for writing queries.

If a question is in the interview, it's relevant to someone in some way unless it's a psychological mind-frack test.

So the question would be, Who was also hired, and later had their head flipped?

Re:Data Structures Reference by mianos on Friday June 29, 2018 @09:32PM (#17429027)
Same, in an interview a few months I got a graph one which I did OK in. Then I got asked to write an algorithm to determine if it is acyclic on not. I could remember the visitation flag but I could not remember, of the top of my head, which side of the recursive call it was on. I picked the later side and obviously failed as I didn't get any offer, although that was more likely due to my age. I dodged a bullet in the end.
Re:Data Structures Reference by ummonk on Saturday June 30, 2018 @11:28AM (#17431162)
Why would you have to remember that to solve it? This is the kind of thing I definitely wouldn't already know, but should be able to reason through.
Re:Data Structures Reference by User23 on Friday June 29, 2018 @08:15PM (#17428813)
Graphs are arguably the fundamental data structure. If you can’t think about objects and references between them then how do you write nontrivial software?
Re:Data Structures Reference by umanwizard on Friday June 29, 2018 @09:08PM (#17428973)
Yes but in normal programming it is uncommon to need to write algorithms that traverse the global object graph. You normally care about some local view of it.
Re:Data Structures Reference by gaastonsr on Saturday June 30, 2018 @11:06AM (#17431088)
It’s uncommon but it’s used once in a while. I do it 2-3 times a year at least. And believe me, most people wouldn’t even know how to start to do it or would think it’s too hard and prefer to do it in a different way so they don’t need to ever traverse the graph.
Re:Data Structures Reference by kylnew on Monday July 02, 2018 @06:45PM (#17446008)
Would you happen to have an example or reference to that kind of problem?
Re:Data Structures Reference by jumper_F00BA2 on Saturday June 30, 2018 @12:46AM (#17429518)
When faced with questions that have answers I could obviously discern by writing and running two lines of code, I willfully shrug, answer by intuition, hoping that's the trap for the wrong answer, and wait for a facial expression.

Today I was asked a question about inheritance and references within a constructor, in which the answer was an either/or for the parent or child class.

I threw up my hands and deliberately said "I dunno parent, no wait! Child!" because honestly who cares, when you can figure something like that out without even googling for it.

A question like that is like asking someone what might they expect a Hello World! program to print.

Waste my time, and I waste yours right back. I could care less what you think about me.

Re:Data Structures Reference by throwawaymath on Saturday June 30, 2018 @08:53AM (#17430720)
I don't really agree with these kinds of questions, but to be honest I find your response to be pretty childish. In my opinion it would be better to be honest and say you don't really know, but that you believe you could quickly find out. But your response indicates that you have the potential to be passive aggressive and uncooperative when presented with a question you disagree with.

Now from the interviewer's perspective, they don't know you're absolutely fed up with the culture of tech interviews. They can't see the full interiority of your thoughts. So they can't know why you're reacting like this, all they can see is your behavior. Keep in mind that you're most likely punishing an interviewer who has either been given a mandate for these questions or who doesn't know any better. From your perspective this could be a teachable moment or a way to showcase your thinking.

Even though that might have been a poor question to ask, doing what you did doesn't demonstrate that your time is important. It demonstrates you might have problems being professional and communicating effectively. It signals that you think your time is so important that you're willing to potentially burn an interview to spite someone asking you a question you feel is beneath you.

It's not a good look. Don't give people reasons to write you off.

Re:Data Structures Reference by jumper_F00BA2 on Saturday June 30, 2018 @11:57AM (#17431271)
Sympathy for the interviewer. Well guess what, you're not going to find much luck pulling this yarn.

Some interviewers get the fist. And that's just the way it goes.

If I'm supposed to play toady to this dog and pony show we're trying put on together, don't step in front of me with some condescending question, that we both know is cherry-picked trivia. You design questions to stump people, knock them off balance, introduce a choke, and project a facade of superiority, when we both know that's not fair play, and you expect something other than contempt?

I'm not reciting all the state capitals, every U.S. holiday on the calendar, and every county in the state of California for you. Try your luck with the next applicant.

You can't expect me to roll over as subordinate, when I'm looking right at you, and you and I both know that the canned question you just asked is total bullshit. Sorry, now I know you're a follower, not a leader, and I won't be led by you. Interview over.

And besides, do you really believe that passive aggression, as a personality trait, isn't a possibility, simply because it wasn't on display during that particular interview. Most smart people do have a passive aggressive mean streak, because it's a tactic, not a personality trait. It's in everyone's tool kit, and smart people use it in anger. If it gets used on you, especially when everyone in the room was trying to make a good first impression, maybe you did something to provoke that.

Re:Data Structures Reference by throwawaymath on Saturday June 30, 2018 @12:32PM (#17431429)
So I can tell you're pretty upset about being treated this way, and I can sympathize with the frustration. But maybe my point will be better received if I clarify it to make it more concise. In essence:

1. You are responding to these kinds of interviews as though the interviewers are malicious, self-aware of their biases and intentionally trying to personally offend you. But it's not personal and not all interviewers are trying to conspire like this. Consider that what you're feeling and perceiving may not be intended by the interviewers.

2. As a corollary, your relationship and responses to these interviewers are retributional and deconstructive instead of educational and constructive. You're writing off companies because their interviewers offend your sensibilities. But just as interviewers don't have enough information to know why you're reacting the way you are, you don't know if they're trying to be as demeaning as you feel they're being.

In other words, not all companies with suboptimal interviewing methods are shitty companies. Probably most are not! Given that, the way you're reacting isn't just a sensitivity to personal offense, it's getting in your own way professionally.

Re:Data Structures Reference by enterogative on Saturday June 30, 2018 @04:25PM (#17432590)
It's on the person holding all the cards to display their power judiciously. Something designed to provoke undue stress is either glib or provocative, by default.

Don't forget, in this card game, you may be the dealer and the asymetric equation may be tipped in your favor, but play fair or some of the players might surprise you by throwing the game.

As "The Boss" you better not only know more, but also consider how put that on display. If you're actually in possession of gifted, multi-faceted intelligence, you won't need to read minds, so much as place yourselves in the shoes of the candidate, as you probe for awareness of facts, and exposure to subject matter.

It's often enough, to understand the conceptual interplay of known processes, before worrying about which color Teletubbie was the "funny" one.

Re:Data Structures Reference by abiox on Saturday June 30, 2018 @03:49PM (#17432437)
> it's a tactic, not a personality trait

that seems like a false dichotomy. you behave as cruel and abusive as you do because it's within you to behave that way.

Re:Data Structures Reference by mosselman on Saturday June 30, 2018 @03:37AM (#17429904)
When do you ever have to rely on 100% top of mind knowledge like that when programming anyway? I usually have a console open and google even fairly trivial things because of how much quicker (second or ~10) it is to look at the API than it is to get it wrong when reloading my code and having to try again.

Usually I challenge getting silly 'traverse this data structure' questions and want to hear what they expect to get out of it.

Side note: The correct expression is "I _couldn't_ care less"

Re:Data Structures Reference by iopuy on Saturday June 30, 2018 @04:06AM (#17429963)
I thought the same thing until I started doing a significant amount of code reviews. You need to know these things to explain to more junior devs to help them become better programmers.
Re:Data Structures Reference by mosselman on Monday July 02, 2018 @08:36AM (#17441105)
Late to reply here, but you don't need to have the exact syntax and code at the top of your mind to review something. You just need the experience to recognise if something can be done in a different way or not. You can always google the exact improvement, implementation, etc later.
Re:Data Structures Reference by ItsMe000001 on Saturday June 30, 2018 @07:29AM (#17430451)
But that's the beauty of the human brain: It knows what is needed and you are going to remember very quickly all those things - when you actually need them. So if you actually have people to coach you will learn and remember all those things effortlessly and almost without noticing it yourself, but when your brain detects no use for something to push something into it by brute force is a pain. It's one thing to learn the basics, it's another to fill your mind with specifics needlessly.

I once had an interview for a very well-paid freelancer position in a large company and could not answer the question "What is a right join?". It's not like I don't know that stuff - I do, but it's strange: there are many things like that, I actually know them, but I have to look them up. I only need 5 seconds then I remember everything. But when asked out of the blue I'm clueless. I was hired - and I became the guy they asked when a large Oracle query had to be constructed to look something up in the DB. Today, right now, I again only have a fuzzy notion of "right join" and would have to look up the details. I happily remove stuff from working memory that I don't need - but one 5-10 seconds look at one of thousands of webpages describing joins is all it takes to have that knowledge back in my working memory.

There are many things that I could not answer when asked out of the blue in an interview, and yet I would claim "I know that stuff". It's not a contradiction. For the last couple of years I've been learning new things like crazy, thanks to edX and Coursera and years of time off work to recover my health. Over 60 (finished) courses thus far, many of them topics I never had anything to do with before (medical mostly). I happily shift knowledge in and out all the time, I noticed how impossible - and useless - it is to keep anything in working memory for long. I'm not sure I could name all cranial nerves right now, and I took several neuroscience courses, they were some of my favorites. Yet I would claim that I know the, I just need a quick glance at a page about cranial nerves and it would all come back.

I'm not a walking Wikipedia, and those kinds of interviews are only useful to test what someone had to deal with in the time just before the interview. Sure, it weeds out clueless people - and a lot of good ones.

What a lot of people commenting on the interview topic also ignore is again that brains don't work like computers: context matters - extremely. We have studies showing that people think differently depending on whether they walk, sit in a small room or a large room, with the exact same task. Being in an interview is not just "stressful" - it's a very specific situation. It cannot just be compared to other merely stressful situations. You can do very well under stress - but not under interview stress. Interviews are, for one, somewhat adversarial. People around you try to find your weaknesses, they will get rid of you if you leave the wrong impression. Later on the job when it becomes stressful people work with you instead, everybody as a team towards the same goal. Not to mention that finding a job is not exactly easy no matter how low the unemployment rate. The kind of stress of an interview compares to nothing in ones actual work.

After the neuroscience courses, here is extremely rough my mental model to explain learning (based on my own interpretation of what I learned, this wasn't part of the curriculum way too fuzzy for actual neuroscience):

It's not like computer (or paper) storage that you fill with "knowledge" and then it sits there ready to be used by "the CPU" (which the brain is not, the computer model to explain the brain is completely off).

Instead, it's like paths through wilderness created by things repeatedly walking the same routes. When you learn you create paths. Literally. Strengthening/weakening of existing connections but also creating and abandoning synaptic connections. But the paths don't encode the concrete knowledge! What in our (computer-centric) models are concrete individual items in the brain becomes the result of signals traveling all over, and a concept we consider one item is the result of waves of signals going all over many paths in the brain, and not just once but with loops.

So when you learn something you don't learn the concrete knowledge like a computer does: "Now it's in memory and in the original form immediately accessible". In the brain it's something else. What created the "tracks" is gone but the tracks are still there! You don't have the original item you learned available, you instead have the path that it created. What exactly that means is not quite clear, but obviously you know something. That something, however, is not a static item of knowledge, it's something dynamic! It becomes useful when you use it.

What you cannot expect is that you put in concrete knowledge and at any later point get the exact same thing out. That's what we have books and computer storage for, the brain does not work like that. Nor should it! We developed those external tools to extend our brains, why are we trying to let our brains be like our tools? Yes, brains are much less predictable. Even from person to person, giving them the exact same knowledge creates different paths in each person's already different brain, and what you get out after feeding them the same input is even more different. Since we have become obsessed with creating predictable results we prefer testing in a way that would work better for how you would test a computer system.

I think something pretty much always overlooked is this: The brain does not attempt to encode the concepts that we talk about (such as "house", "tree", "friendship", "database"). It is the opposite. Our language attempts to represent the inside of our brains, in an approximation that depends on the goal and the context. For maximum confusion we then created new stuff within that externalized language system - and then try to put it back into the brain. There is nothing solid about it, it's all very dynamic and fuzzy. I see communication between humans more like trying to synchronize different dynamic systems. "Fire and forget" (send information and expect it to be understood) only works when there was a lot of prior synchronization. That means when new people meet in a new context (for at least one of them, in an interview) it will go more smoothly if they all share the same base synchronization, the same background - but that may actually be by accident. Out of tune communication partners might actually get better results after they "synchronize their waves". The "tuning" also is not between two fixed systems, both keep changing.

What I look for in new people is not how they are currently tuned but their "tunability", especially "auto-tunability". That means I care more about how much they do on their own to find things out. When an employee does experiments on their own, finds things out that nobody asked them about, digs deep into a problem without waiting to be told to do so - to me that's far more valuable than any amount of static knowledge.

Re:Data Structures Reference by throwaway0255 on Saturday June 30, 2018 @05:37AM (#17430165)
If all the questions were relevant and had objective solutions, they would be put into a lot of situations where they have no justifiable reason to reject somebody that they would prefer to discriminate against.