7 ms·
I agree with you that a non significant number of developers need this kind of problem-solving ability for their daily work, but I would disagree that they neve
by ascar 8y ago
I agree with you that a non significant number of developers need this kind of problem-solving ability for their daily work, but I would disagree that they never need it. And when they do it can have huge impact.
There are many applications of these fundamental problems in system building. They are usually not as obviously in your face as the coding interviews and it is often not possible to let a library do that stuff for you. That's why it's beneficial that every developer who might have to do this stuff, is capable of doing it.
E.g. it's a common problem to have a list of objects A and another list of objects B and you want to find all elements in B that match an element in A.
The naive approach is thinking of 2 boxes with balls of different color. You pick one from the first box and compare him one by one with each ball from the second box. This is equivalent of nesting two loops and has a runtime complexity of O(n*m).
But this problem is absolutely solvable in O(n+m) with added memory of O(n) (or m, pick the shorter list), by creating a hashmap and then iterating once.
The difference in real world performance is huge. I optimized a small system dealing regulary with about 20mb of translation data from a 20 minute runtime to a few seconds. Not for a tech giant, but for a small webshop with about 100 employees.
- lwansbrough 8y agoMy thought process: 1.) this is an intersection problem, 2.) what does a quick search have to say about efficiently solving an intersection problem in $language? That thought process does not require any algorithm knowledge. That knowledge is already out there in abundance, and there are enough people smarter than me focused on those problems that I am wasting everyone’s time by implementing a solution myself. (Btw the answer in C# is LINQ, if you wrote an algorithm yourself I’d call you a bonehead and tell you to rewrite it. I suspect the answer is similar for any other language that has a standard library.)
- mav3rick 8y agoAnd what if you don't have a standard library ? You're working on a new device, on a new language ?. Frameworks breed programmers with less adaptability, foundations breed problem solvers that can adapt across problems.
- sidlls 8y agoThe fraction of engineers at Google to which these conditions apply is tiny. It's absolutely absurd to interview based on some fictitious need. The real reason Google interviews the way they do is not because they need a high bar. Their interviews are structured to preserve the egos of the interviewers and because, like the gaming industry, they can simply due to the sheer number of applicants.
- mav3rick 8y ago"Their interviews are structured to preserve the egos of the interviewers " You just stereotyped about 100k people. You have no idea about how many people work to make the interview questions as interviewee friendly as possible. You may hate the company but don't judge the people without knowing them.
- mav3rick 8y agoGoogle's requirements also allow easy mobility between teams. If all I knew was one framework, I'd always have to prove myself again when I move teams. The hiring bar ensures that most candidates can adapt due to their strong CS base.
- sidlls 8y agoNo, these interview questions do not signal for that kind of adaptability. They're a signal that someone studied (crammed for a few weeks, often) a small slice of CS. They're a poor signal for the work engineers do there, or anywhere, in almost every case.
- mav3rick 8y agoPlease hire using frameworks knowledge for your company. More power to you.
- anongraddebt 8y agoEgo abounds everywhere. However, your point about applicant volume motivating the setting of a high bar for entry is spot on. This is happening throughout the corporate world. Too many candidates for too few high-paying and elite positions. My girlfriend works in finance and recently interviewed for a post-MBA position at (arguably) the top company for the work she does. She talked with other candidates, and discovered it was not uncommon to pay thousands of dollars on interview preparation (books, coaching sessions, etc.), and to spend, say, over 100 hours prepping in total... for interviews with a single firm... which you weren't even certain you'd be interviewing with. This trend is only accelerating. The less pessimistic stance is to just say this is a consequence of greater specialization. The less optimistic stance is to say we are seeing professionalization for the sake of professionalization. I'm not optimistic.
- ascar 8y agoYou have two lists of objects and the thing you want to compare against is a property nested two levels deep in one kind of object and one level deep in the other object. Are you sure you still want to pass this to a library and not write this simple and basic approach yourself? 1. Pick shorter list 2. Create hashmap comparable -> object 3. Iterate longer list and check for each item: comparable in hashmap? Done. That doesn't need a library. Sure, let's say in Java, you could maybe pass your custom implementation of comparable to the library, but is this seriously your interpretation of better code? In fact in many cases the library can't help you, because your structures are not as basic as the library would need them and transforming is a huge and unnecessary overhead. That's the thing, you usually don't need (and want) to implement an algorithm on basic strings. But the kind of problem, where you need the same approach but don't have strings appear a lot. Especially if you enjoy to work in system infrastructure like I do.
- dbt00 8y agoThe problem with "just use a damn library" is that software is full of abstractions and they leak. If all you know is libraries, and you don't invest in knowing how underlying technologies and algorithms work, you're going to get destroyed and look completely lost at some point. Sooner than you think.
- devocracy 8y agoI'm 15 years into my career and have yet to be destroyed for not taking the time to learn the details of every abstraction I utilize. That seems like a massive wasted effort when I could be busy adding value to the products I'm building vs becoming an expert at all things.