Live data from Hacker News

Ask HN: What is the point of algorithm-heavy interviews?

news.ycombinator.com

61–70 of 104 posts

Re: Ask HN: What is the point of algorithm-heavy interviews?

#61
I think the HN crowd goes 50/50 on this. One half hates it and the other believes it's a necessary evil. And then there's the small minority that enjoys it.

I was apart of the former half who hated algorithms until I was tasked with help hiring people. The only thing I believe that is worse than an algorithm is me spending 8+ hours of my free time on a "take home" problem. So, I used pretty easy to solve algorithms alongside real problems I had solved recently for interviews.

Being on the other side as the interviewer really made me see the value of algorithms. It becomes a medium where candidates can convey competency. I think it has gotten murky due to the lines between a web developer and software engineer blurring. That statement alone can be a can of worms.

Anyway, I would say algorithms / data structures for backend development do come up when laying the groundwork for a new project or something that might see a lot of traffic. Lots of things in development model certain data structures (queues, stacks, graphs, etc.) so knowing them allows you to converse with your co-workers and conceptualize them to others. Probably comes up somewhere between 2-5% of the time. Design patterns probably get brought more as their a bit more applicable for everyday tasks. It really depends on who you're around, how challenging the work is, and what the engineering culture is like.

Re: Ask HN: What is the point of algorithm-heavy interviews?

#63

> Who really cares about algorithm on daily bases. I find that statement really depressing to be honest. Why would you be so happy to deprive yourself of a huge source of potentially useful information that is the foundation of our field that shouldn't take long to learn? Algorithm and data structure knowledge helps you write processor + memory efficient code that scales well, and stops you reinventing the wheel when…

> You might not need this knowledge every day but someone who understands fundamental algorithms and data structures surely has an edge over someone who does not.

There is a huge difference between knowing the fundamentals and having detailed knowledge about things you hardly use at the ready. For example, how often do you need to implement a sorting algorithm ? How often do you even have to make an informed decision on which one to use ? The one time you do, you can just look up the different options and their trade-offs. All you need to know is that these trade-offs exist, so you know that you have to look them up that one time when it matters.

> I've interviewed programmers before who couldn't explain what a linked list or a hash table was, and when you'd you use one of those over an array.

So have I, but that's the complete other end of the spectrum. You need a high-level understanding of these concepts, sure, but don't get bogged down in details when they don't matter.

Knowledge of these subjects also doesn't mean someone is a good programmer. I've worked with people who had very in-depth theoretical knowledge, but who I wouldn't let within 10 feet of any production code. Usually people with an academic background. They would write a beautifully optimised piece of code but forget to do any input checking, error handling, etc. They were more concerned with their pretty algorithm than with writing robust, production-ready code.

Also, writing the most efficient code isn't always desired. Code also has to be robust, readable and easy to maintain. In a lot of cases a slight performance improvements come at the cost of readability and maintainability.

Re: Ask HN: What is the point of algorithm-heavy interviews?

#64

People complain about algorithm heavy interviews a lot but I honestly think they're pretty useful for several reasons (some are beneficial to the person interviewing as well). Even though we many software engineers aren't doing challenging enough work to require algorithms work daily (though, wouldn't you want to be doing this kind of work?) algorithms problems have a lot you have to do. Even if you don't use a linke…

> not being able to code without an IDE, frankly this is a red flag... that makes it pretty clear they don't write a lot of code

Muscle memory is real. Plus as a polyglot I find the context helpful for jogging my memory for how to do something in a particular language.

I had to google how to declare a variable in Go the other day, but I've written 10ks of lines. I'd had a break and was confused with Python. Oh well. I'd have failed on several of your whiteboard red flags.

Bar none, what I most want to see as an interviewer is someone's own code on GitHub. But I can count on one hand the number of times I've ever seen that after 10 years of hiring :-(

Re: Ask HN: What is the point of algorithm-heavy interviews?

#65

Earlier quoted context omitted.

I think it is often much better not to write them yourself, but rely on a battle tested implementation. Of course we're not talking about left-pad here, but implementing your own Diffie Hellman key exchange from scratch is usually a very bad idea.

No one is asking you to write them yourself. But it is important to know when Quicksort becomes quadratic. Or when separate chaining in a hash table can lead to linear look ups. I find it abhorrent that this thread thinks these things are unimportant. Just use a "Library". How about you know your stuff .

> I find it abhorrent that this thread thinks these things are unimportant. Just use a "Library". How about you know your stuff .

How about the fact that "your stuff" is not algorithm. In 99% "your stuff" is to pick the right library

Re: Ask HN: What is the point of algorithm-heavy interviews?

#66

I think the HN crowd goes 50/50 on this. One half hates it and the other believes it's a necessary evil. And then there's the small minority that enjoys it. I was apart of the former half who hated algorithms until I was tasked with help hiring people. The only thing I believe that is worse than an algorithm is me spending 8+ hours of my free time on a "take home" problem. So, I used pretty easy to solve algorithms a…

> It becomes a medium where candidates can convey competency

I really struggle to see how regurgitating something someone's read/heard about something they didn't invent/modify conveys anything beyond memory.

Re: Ask HN: What is the point of algorithm-heavy interviews?

#67

I realized that everyone needs a base level of algorithms knowledge to write and design good software. Ideally it is pretty basic (leetcode easy), but the initial employees at FAANG companies decided to have a hazing ritual by creating increasingly complicated questions (e.g. leetcode hard) and it is exacerbated by a large number of kids from universities who mindlessly play this game. It spread to all other tech com…

The rules of the game seem to be well-known at this point. If one desires a job at a FAANG, it is fairly clear what ‘skills’ are expected to be demo’ed during the interview process. It is as flawed as the SAT for college admission, but again, the individual knows what to focus on to maximize a successful outcome.

Since the rules are known, the threshold has increased so much that people don't see any issue when leetcode hard questions are common place.

I have seen multiple instances where the interview questions are ridiculous by any sane terms. It incentivizes gaming the system by just getting good at algorithms and not building up other skills.

Just as an example, look at Google as a new user (without any brand context). The design is terrible, the product management is terrible, the hideous search bar everytime you open the android home screen, etc. all in my opinion caused by optimizing for one attribute in 99% of the hires. It causes them to think "oh well the data says people don't mind the change", but you can't track the growing discontent of the customer base. And you are a monopoly so don't have to give a shit about UX anyways.

Re: Ask HN: What is the point of algorithm-heavy interviews?

#68

People complain about algorithm heavy interviews a lot but I honestly think they're pretty useful for several reasons (some are beneficial to the person interviewing as well). Even though we many software engineers aren't doing challenging enough work to require algorithms work daily (though, wouldn't you want to be doing this kind of work?) algorithms problems have a lot you have to do. Even if you don't use a linke…

> not being able to code without an IDE, frankly this is a red flag... that makes it pretty clear they don't write a lot of code Muscle memory is real. Plus as a polyglot I find the context helpful for jogging my memory for how to do something in a particular language. I had to google how to declare a variable in Go the other day, but I've written 10ks of lines. I'd had a break and was confused with Python. Oh well.…

> Bar none, what I most want to see as an interviewer is someone's own code on GitHub. But I can count on one hand the number of times I've ever seen that after 10 years of hiring :-(

I would also love to see my own code on GitHub (well, perhaps another platform but anyway). Unfortunately having a full time job as a software developer leaves too little time & energy for my own projects, and work stuff at my current place will probably never land on GitHub. :-(

Re: Ask HN: What is the point of algorithm-heavy interviews?

#69
Often the problem isn't phrased as "please implement algorithm X", but "solve this business related problem that requires use of algorithm X". The expected answer is the same, though...you're supposed to implement algorithm X.

I've failed these sort of interviews by suggesting I'd rather find a well tested library and use it than implement the algorithm on my own. What's the point really.

Re: Ask HN: What is the point of algorithm-heavy interviews?

#70
post #59

Earlier quoted context omitted.

> On the rare occasion that these coders need to worry about algorithmic scaling, they will re-use an implementation from their fine standard library or adapt one from another source, without turning it into a brain exercise of reasoning about and building the whole algorithm on scratch on whiteboard while a bunch of strangers are sitting there judging you and prompting you to explain your thought process as you go).…

> I'm saying you should be able to explain the basic principles of e.g. an array, a linked list, a hash table and a binary tree, and where each would be appropriate to use. I think most of us agree with that. But that's beside the point, because that's not the algorithm-heavy interview people are complaining about big time.

It depends what you're describing as algorithm heavy. Do you have any examples?

I've seen people arguing you shouldn't have to know how a linked list, hash table or binary tree work. I think every programmer should know these ones. I think having to describe how quicksort works is getting too much, but knowing e.g. some search tree and graph algorithms might be appropriate depending on your domain.

Post reply on HN