TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Green Lumber Fallacy in Software Engineering

133 点作者 weekendvampire超过 3 年前

43 条评论

vp8989超过 3 年前
Its shocking to me how people don't get bored of rehashing this same, tired opinion over and over and over again and discussing it with hundreds of comments. There is a blog post like this every other day on the front page of HN and it always generates the exact same discussion.
评论 #29930426 未加载
erehweb超过 3 年前
Article says &quot;There’s no better way to see how someone performs at the job than having them actually do the job.&quot; and argues for a trial work period.<p>Well sure, except the first part of any job is coming up to speed on the domain, the codebase, who the key people are, etc. So if you want to see how someone really performs, you&#x27;re going to have to wait a while past that initial period. And that means you&#x27;re going to have a lot of people who won&#x27;t make it past the trial needing support.
评论 #29927087 未加载
评论 #29933342 未加载
评论 #29927046 未加载
评论 #29930294 未加载
评论 #29930319 未加载
评论 #29927655 未加载
tacostakohashi超过 3 年前
I used have a similar perspective as the author, that the leetcode style questions &#x2F; data structure &#x2F; algorithm stuff they ask in interviews but seems to have little to do with day-to-day corporate software development is all a big waste of everyone&#x27;s time.<p>I&#x27;m not sure I still do, though.<p>It&#x27;s true that this stuff rarely comes up and often doesn&#x27;t matter for most real-world applications... but when it does, it matters <i>a lot</i>. The difference between O(n2), O(n) and O(log n) is huge for big values of n. Being about to go straight to a (nearly) optimal solution, instead of hacking together something, waiting for it to burst a the seams, and then having to fix it... or being able to spot someone else doing that, can save weeks or months of development at a time.<p>It&#x27;s a bit like saying it&#x27;s silly for pilots to have to know what to do in the case of engine failure or stall from memory and regularly practice in a simulator, because that stuff rarely happens and most of the time they&#x27;re just using autopilot. That&#x27;s true, it usually doesn&#x27;t matter, but when it does... it matters <i>a lot</i>.
评论 #29930297 未加载
评论 #29930896 未加载
评论 #29930571 未加载
评论 #29931498 未加载
评论 #29931309 未加载
compiler-guy超过 3 年前
The test isn&#x27;t so much about the ability to invert a binary tree (for example), but the ability to problem solve complicated problems where the obvious solution is probably not the best one.<p>In interviewing, it is hard to produce real world problems that don&#x27;t require a huge amount of context and details of some obscure software stack, so we go with abstract problems which are kind of irrelevant to real work, but the problem solving approaches you need to take are very relevant. Thinking about the requirements, thinking at the right level of abstraction, defensive coding, to name just a few.<p>Communication and whatnot are all on top of that, and yes, absolutely do need to be evaluated.<p>I&#x27;ll also note that MAANG companies have extremely sophisticated software stacks (and multiple ones for each company!) that were built by people who were hired using that method.<p>If it is wrong, it&#x27;s working pretty darn well.<p>There are many things I would change if I could, but we do have an existence proof that, in the aggregate at least, the people this interviewing method selects for can build amazing software stacks.
评论 #29925081 未加载
评论 #29928315 未加载
评论 #29930801 未加载
评论 #29926627 未加载
strict9超过 3 年前
I think this phenomena is at least partly responsible for why so many devs stay in the same position and why they are difficult to find&#x2F;hire.<p>Before a tech interview, good candidates will spend a large amount of time doing &#x27;homework&#x27; which is just practicing answering the asinine questions that tech interviewers give that is usually barely relevant to the position, if at all.<p>Equally, if not more important, is the candidate&#x27;s experience or ability to navigate legacy code, testing philosophy, handling incomplete&#x2F;inconsistent requirements, and attention to detail, among other traits. Of course these won&#x27;t merit the same attention in an interview.<p>On the one hand firms have difficulty finding good candidates, on the other hand they are giving ridiculous tech interviews that aren&#x27;t a great judge of what kind of employee they will be.
评论 #29925350 未加载
评论 #29926416 未加载
评论 #29925615 未加载
评论 #29925547 未加载
caethan超过 3 年前
I&#x27;ve heard bitching about some of the interview questions our team asks before, but here&#x27;s the thing: each of those questions is about a problem our team actually had to solve before, reformulated into an interview-style question. Yes, we&#x27;ve had to use Hamming distances, worry about the scaling (N log N vs N^2) of particular solutions, use error-correcting codes, interesting data structures and all of that. Is that most of the job? No, we do a lot of more boring stuff too, but the algorithms and data structures are definitely a part of it. I don&#x27;t want someone who can <i>only</i> glue pieces together, developing novel tools to solve the problem is important too.
评论 #29927830 未加载
评论 #29926629 未加载
评论 #29938150 未加载
评论 #29927085 未加载
评论 #29926773 未加载
kokanator超过 3 年前
The post arrives at the wrong conclusion.<p>DSA style problems are good if used correctly.<p>Give a candidate a good challenge, preferably with some requirements that can have different interpretations, ask them questions, help them and collaborate with them.<p>The analysis of the whole exercise should be your hiring determination not whether the problem was actually solved.<p>Did the candidate:<p>- stick with the problem?<p>- ask meaningful questions about requirements?<p>- ask for help from a senior when stuck?<p>- explore different avenues to solve the problem?<p>- handle criticism?<p>Of course it is great if they solve the problem but often that often only shows you that they have memorized algorithms. ( we have the internet these days )
评论 #29926156 未加载
评论 #29925327 未加载
评论 #29925756 未加载
floober超过 3 年前
In the physical world there are folks who design bridges, dams, buildings, telescopes, furniture, and a million other things. All of those have unique requirements and skill sets. In software, we also make a huge number of categorically different systems each with its own skill set, but we call all of it &#x27;software engineering.&#x27;<p>There are folks who are great at their job (called &quot;software engineering&quot;) and their work never invokes their knowledge of algorithms. There are also folks who spend day in and day out tuning and designing new systems and deep knowledge of algorithms is essential (we also call this &quot;software engineering&quot;).
评论 #29924984 未加载
评论 #29925932 未加载
评论 #29928182 未加载
KerryJones超过 3 年前
As a previous CTO and hiring manager, we did do trials, and it worked great. At the time I found an article showing that traditional interviews resulted in an 18% true-positive expectation of how they would perform, while a week-long trial got you to something like 73%.<p>We paid them for the week like a contractor, and made an evaluation at the end of the week. It weeded people out who were great at code but bad culturally, or people who worked great.<p>Sometimes we couldn&#x27;t get a whole week to commit, but just a few days -- but these days made a huge difference.<p>Now, I work at a FAANG company and _hate_ the interview process. Give me 3 months and I think I could teach just about any CS interview how to pass it (without being specific to any particular FAANG company), but that doesn&#x27;t mean they would be good engineers.<p>They are loosely related but different skills.
评论 #29931895 未加载
paxys超过 3 年前
Data structures and algorithms questions are a perfect proxy for (1) is the candidate smart and (2) can the candidate write moderately complex code (arrays, hash maps, pointers, nested loops). 90% of candidates will fail 2, and you will get a good idea of the rest with 1.<p>Unless your company can afford a month-long interview process for every candidate which the author suggests, this is the best we have.
评论 #29926855 未加载
评论 #29927099 未加载
评论 #29927140 未加载
mytailorisrich超过 3 年前
Data structures and algorithms are important to very important in software engineering and I think it&#x27;s quite right to include questions on them in interviews.<p>But that&#x27;s not the same as knowing by heart how to implement non-trivial algorithms. There&#x27;s the green lumber fallacy.<p>To have a feel for the &#x27;right&#x27; data structures and algorithms to use for specific problems is a key skill. But then the detailed algorithm is only one Google away these days, although I would expect someone to be able to derive the simple ones themselves.
评论 #29925306 未加载
评论 #29925164 未加载
评论 #29925100 未加载
rojobuffalo超过 3 年前
&gt; I’d take working with someone who’s great at naming functions and variables over someone who can code a solution to the knapsack problem.<p>totally agree
angarg12超过 3 年前
&gt; but the best solution is to have trial work periods. There’s no better way to see how someone performs at the job than having them actually do the job.<p>&gt; I agree trial work periods may not scale<p>Great to see the author uses the Green Lumber fallacy to argue against leetcode-style interviews. Now I&#x27;m going to guess he also must have skin in the game, otherwise he would only be an empty suit doing armchair recruiting.<p>Let&#x27;s say we want to do work trial periods. I tell you what actually happened to us: we opened an internship position and we had ~1600 applicants. Since having 1600 trial periods is impossible, we need a way to weed this down to a manageable number. Congratulations, now you moved the problem of &quot;who do we hire&quot; to &quot;who do we invite for a trial period&quot;.<p>The software engineering interview isn&#x27;t perfect, but sadly trial periods are not the answer.
评论 #29957841 未加载
d4nyll超过 3 年前
Personally, I dislike competitive programming interview problems. Competitive programming, when viewed as a sport, requires training and practice. It&#x27;s a muscle that you must constantly train. If you stop for a few months, it may take you a few days or weeks to get back to the previous level.<p>So it&#x27;s always frustrating to find a new job because I know I&#x27;ll have to spend weeks practicing on problems that will have no relevance to the posts I&#x27;m applying to. To me, it&#x27;s a waste of time.<p>I think companies that uses competitive programming problems (that are irrelevant to their engineers&#x27; day-to-day jobs) end up hiring people who are very good at interviews and perhaps not as good at their actual jobs.<p>Of course, there are jobs which deals heavily with algorithms and optimizations, for which these types of interviews are relevant. But the article is not talking about these relevant cases.
unwind超过 3 年前
While trying to read more about the actual case of the trader who didn&#x27;t know what he was trading, I found [1] which contains this quote:<p>&gt; The “green” in green Douglas fir refers to the fact that it has been newly cut (it has not been dried), just like someone who is new at something is referred to as green.<p>This was interesting&#x2F;funny to me, since I was sure that the name &quot;green lumber&quot; comes from the fact that it is green if you look at it (being plant material which was recently alive). I&#x27;m not saying a full-size tree will be green like your kitchen garden basil stalks inside, but e.g. under the bark there are green hues.<p>I would never have thought it came from the &quot;green = n00b&quot; connection. Am <i>I</i> the mistaken one, now?<p>[1] <a href="https:&#x2F;&#x2F;with.thegra.in&#x2F;green-lumber" rel="nofollow">https:&#x2F;&#x2F;with.thegra.in&#x2F;green-lumber</a>
评论 #29926619 未加载
评论 #29926112 未加载
waynecochran超过 3 年前
<p><pre><code> &quot;but software development is not data structures and algorithms&quot; </code></pre> Now I know why there is so much bad software out there... you just gutted the core of what SD is.
vrnvu超过 3 年前
The biggest problem for me is that this style of interview focuses on theoretical efficiency. And the discussions about the interview process only cares about &quot;real world engineering&quot; vs &quot;interview questions&quot;. We are discussing algorithms and data structures. What about actual performance? Your code will run on real hardware. Are we interviewing considering that?<p>Do you know what memory alignment is? Padding? Branching? The implications in performance of a cache miss? These questions are never asked!<p>Two nested for loops O(n2) where you considered memory alignment and your cpu cache size when choosing the data structures and defining your structs will perform better than your O(log n) algo with a high missing rate and branching all over the place.<p>In my day to day I work on a garbage collected language (which I think are great, don&#x27;t get me wrong) and I&#x27;m tired of seeing programmers thinking that memory is free, GC is free, syscalls and networking are magic...<p>Software engineering culture is broken in general. From the education phase to the &quot;real world&quot;.
andrewflnr超过 3 年前
So a lot of the more complicated DS&amp;A questions seem ridiculous, but I had to check on &quot;inverting a binary tree&quot; to see if it was really as simple as it sounded. It is. Just swap left and right, recursively. It&#x27;s one of the easiest possible tests of being able to grok recursion[0]. You should be able to do this, even if you&#x27;re self-taught or early in a college degree program.<p>Am I missing something? The only excuse I can imagine is interview anxiety, which is a real problem that deserves accommodation (bad explanations of the problem may play a role too, but you should be able to ask good clarifying questions). But if someone is really incapable of this very minor feat of programming, then I&#x27;m sorry but an interview process is right to reject them.<p>[0] Even if you don&#x27;t literally write recursive Java methods, which you probably shouldn&#x27;t, understanding recursive logic is critical all over the tech stack.
评论 #29931892 未加载
MattGaiser超过 3 年前
A lot of it is that building successful software requires product knowledge.<p>I have never used that in my career as a dev (despite being hired for it once). Others hand that to me. I’ve also never gotten any credit whether customers like what was built.<p>Homebrew is a great product. But in a tech firm, the product manager gets the credit for its greatness.
grogers超过 3 年前
I recently went through two interview loops at big tech companies and the DSA questions are not very hard. The typical question starts super easy and then layers on more complexity as time and skill allows. If you are nervous about interviewing because of that, just try a few &quot;easy&quot; leetcode questions or the first ~5 days of advent of code, it really is about that level. Don&#x27;t be intimidated, you do NOT have to be perfect to get an offer. If you know what a priority queue&#x2F;heap is you will be fine. Yes practice, but don&#x27;t slack on preparing for the 1-2 system design interviews and 1-2 behavioral interviews (for senior candidates). System design especially I personally think is way harder because it&#x27;s (typically) candidate driven and there&#x27;s no fixed finish line, just tradeoffs and more tradeoffs.
daotoad超过 3 年前
Excessively complex DSA questions are not very useful for me as an interviewer. I prefer to offer a fairly simple test problem that has room for elaboration. For example, when evaluating SQL skills, looking how the candidate would model mapping between companies and stock ticker symbols is instructive. You can start with a simple flat table, extend to one to many relationships, discuss when normalization and denormalization make sense. You can keep elaborating this, too--add in multiple exchanges to get many to many, and so forth. This lets you see how the candidate evolves a design in the face of changing requirements, which is critical.<p>These kinds of questions are great for leveling an applicant. How a junior dev answers these questions will be very different from what a senior dev has to say.
评论 #29925260 未加载
teg4n_超过 3 年前
I am a frontend web developer and I still get these types of questions. It&#x27;s incredibly stupid. I don&#x27;t think I&#x27;ve passed any of them yet I&#x27;m making 250k still so whatever. The most I have to think about data structures is deciding when to use a map, set, or array.
bsedlm超过 3 年前
&gt; solving DSA-style problems and building software are two different things<p>disagree. I&#x27;d say that both are needed skills for software. Software is made layers, like a cake. Maybe DSA style problems are like grounding the flour (or making the oven itself?) and the other building skills (which I agree, seem like different skillsets) are about decorating the cake and mixing the dough or something.<p>So in practice nobody is grinding their own flour; the flour is being bough already processed (in programming this&#x27;d correspond to importing the algorithms from a lib)
评论 #29924557 未加载
JavaBatman超过 3 年前
&gt; All the MAANG companies use algorithmic and system design style questions as their main metric for hiring candidates. The internal justification for doing so is likely a combination of “this is what everyone else does” and “it’s a quick way to evaluate someone’s skill”.<p>They argue that this is the only way to weed out all these candidates. It is MAANG&#x27;s version of the SAT.<p>&gt; the best solution is to have trial work periods. There’s no better way to see how someone performs at the job than having them actually do the job.<p>Agreed. But how do they implement this?
Scene_Cast2超过 3 年前
One amusing thing I&#x27;ve noticed about MAANG companies (with perhaps the exception of Google) is that despite passing the technical interview, the employees do not actually do any difficult or tricky implementations when something like that is actually needed.<p>I can&#x27;t figure out if it&#x27;s a strong aversion or an inability - the end result being the same in both cases, at best some approximation gets implemented instead, and the analysis &#x2F; feature &#x2F; etc just doesn&#x27;t get done in the worst case.
评论 #29926936 未加载
tanseydavid超过 3 年前
Author wrote:<p>&quot;These test-like interviews mistake the trees (data structures and algorithms) for the forest (building software).&quot;<p>Should say: &quot;interviews mistake the b-Trees for the forest&quot;
maerF0x0超过 3 年前
&gt; software development is not data structures and algorithms.<p>Software development is almost entirely about understanding what others want and then translating them into Data structures and algorithms. Author could have meant software development is not about implementing already implemented data structures and algorithms. imo better questions would have a candidate using the DSAs than implementing them. eg: questions that require them to use binary search, bitsets etc
captainbland超过 3 年前
I can&#x27;t help but feel that this makes a better point about the lack of intrinsic merit in trading and more generally other profit making pursuits.
invalidname超过 3 年前
I very much agree. But this is written in a somewhat &quot;this is bad&quot; style and misses the &quot;you should do this, instead&quot; part. This article contains both: <a href="https:&#x2F;&#x2F;talktotheduck.dev&#x2F;debugging-the-technical-interview-methods-and-cheating" rel="nofollow">https:&#x2F;&#x2F;talktotheduck.dev&#x2F;debugging-the-technical-interview-...</a>
zwieback超过 3 年前
sure, but if performance in those types of questions are a good predictor of success in the job then I&#x27;d go on asking them. Probably they aren&#x27;t but just saying &quot;I won&#x27;t need this in my job so I won&#x27;t ask in an interview&quot; is short sighted.
mavelikara超过 3 年前
&gt; I’ve never heard of an ex ICPC competitor go on to build a great piece of software, yet I’m certain every ex-ICPC competitor would outperform the best software creators on interview-style questions.<p>Are there any great pieces of software written by ex-ICP champions?
throwawaygal7超过 3 年前
people in software tend to be introverts who sink a lot of their life and self worth into the job. We see the effects of this in the gatekeeping by elite software engineers who firmly believe the vast majority of degree holding, gainfully employed software engineers are complete idiots lucky to have a job - which is ridiculous.<p>The other side of it is the ridiculous notion some developers have of not having to meet these standards to get the best jobs.... two sides of the same coin that starts with an unhealthy attachment to your profession as your identity.
Tycho超过 3 年前
If interview tests were truly useful, wouldn&#x27;t companies want to assign them continually to their existing employees? Constantly keeping their skills sharp, proving their competence without any confounding variables.
tharne超过 3 年前
The leetcode style of interviewing is essentially a legal way to practice age discrimination.<p>When you&#x27;re young and just starting your career, you typically have nothing but time, and doing programming challenges on evenings and weekends can even be fun. As you get older, life happens and you have children to take care of, older relatives to help out, a spouse who&#x27;d like to see you every so often, etc. Practicing leetcode-style problems in your 30&#x27;s and 40&#x27;s means less time with your family, offloading more of the childcare and housework onto your spouse, putting off household chores and repairs, and so on. So you end up with a hiring process that&#x27;s incredibly hostile to older workers while being a relatively easy lift for younger workers with fewer responsibilities.
评论 #29926950 未加载
dottedmag超过 3 年前
&gt; I’ve never heard of an ex ICPC competitor go on to build a great piece of software<p>Telegram.
评论 #29925344 未加载
评论 #29926872 未加载
评论 #29928696 未加载
pidge超过 3 年前
Google’s first hire (Craig Silverstein) was an International Collegiate Programming Contest champion. Make of that what you will.
mesozoic超过 3 年前
The real question is why do we keep doing this type of interview even though it seems everyone knows this is a problem?
评论 #29926854 未加载
tantalor超过 3 年前
I think &quot;invert a binary tree on a whiteboard&quot; was meant to be a joke, not taken literally.<p>This was on Twitter, after all.
axiosgunnar超过 3 年前
Good article but<p>&gt; MAANG<p>It‘s FAANG. Don&#x27;t let Facebook whitewash it&#x27;s rightfully tainted name.
mdip超过 3 年前
I agree with the author, mostly, though I don&#x27;t have as much of a problem with the deeply technical questions he&#x27;s suggesting one shy away from -- my problem is with how the responses are handled by the interviewer. And as far as the whole &quot;give them the actual work&quot; approach, I love it -- I do it, and I stand by it, but don&#x27;t abuse the candidates time in the process.<p>For the most part, I avoid the data structures-style questions. We have a limited time as interviewers and while these show off a candidates knowledge in areas we may need very rarely, I&#x27;d rather have someone who is productive at using what the framework we write code in provides. I stick with &quot;when is it appropriate to use &#x27;X&#x27; vs &#x27;Y&#x27;&quot; style questions but usually don&#x27;t have to ask them; the candidate reveals that knowledge (or lack thereof) through other questions and I <i>hate</i> whiteboard interviews. I don&#x27;t penalize the candidate for lacking knowledge they&#x27;re never going to use on the job, but I like to know what areas they have <i>deep</i> understanding of. Before I ask these questions, I&#x27;m careful to point out &quot;I don&#x27;t care if you know the answer to this or not -- you might encounter that once in 10 years, here -- but if we do encounter it, it&#x27;s helpful to know if you have a deeper understanding than others on the team.&quot; For the most part, though, it&#x27;s a waste of time and I&#x27;d rather spend that time on the next two points.<p>My preference is to ask the candidate (very carefully) to provide a link to <i>anything</i> they&#x27;ve written that they can legally[0] share openly. My explanation includes all of the following: I am not interested in judging them on the code they send me -- in fact, I want their worst. I want the code that they don&#x27;t care about, that they wrote in a hurry to solve some random problem that <i>they</i> had and that &quot;just needed to work and do that one thing&quot;. I&#x27;ll use that code as a starting point to discuss refactoring -- i.e. &quot;What if you wanted to take this code and make it worthy of a product you&#x27;d sell&quot;. If there&#x27;s <i>absolutely nothing</i> that they are <i>comfortable</i>[1] sharing, I ask them to take a few minutes and find a project in the framework we&#x27;re interviewing for on GitHub that we can use for that purpose.<p>As for the &quot;give them the actual work&quot;, we have a single-sheet project we give to <i>every</i> candidate, Junior, Mid or Senior. It&#x27;s a &quot;to do&quot; app with basic requirements: Must use a database of some kind for storing&#x2F;retrieving data (Sqlite is called out as an option, but anything relational is allowed), it must allow adding, marking complete, unmarking complete and deleting. We additional coach Senior&#x2F;Mid developers to include things that would be important for a completely released application with examples (none of which are required), such as documentation, instructions for starting&#x2F;setting it up, installers (with advice not to take this too far as that&#x27;s one hell of a rabbit hole). Depending on the outcome of the &quot;actual work&quot;, we might follow-up in a similar manner to ask them questions about their choices.<p>I&#x27;ve seen everything from a To Do app that used SignalR to perform its operations, allowing multiple users to watch the check-list get updated in real-time (complete with a WiX installer, OWIN hosted web service running as a Windows Service with everything wired up and a doc generation project[2]) to a simple HTML-template based solution that is done in four files. Of course, we check the usual sources for obvious evidence of whole-sale copying, but we&#x27;re not terribly strict here, either (this point is made on the spec sheet -- it&#x27;s such a simple app, it shouldn&#x27;t require a lot of research&#x2F;copy-pasta to build).<p>[0] The first time I did this, I left off that &quot;legally&quot; part and the candidate shared code that -- while not representing anything their employer would care about (basic library code that probably every programmer as written from time to time) and certainly not representing anything the company I worked for was interested in &quot;stealing&quot;, it carried a copyright that they did not own. Unfortunately, it disqualified the candidate (not my choice in this case, but the company I was working for at the time had concerns that the employee might introduce liability we didn&#x27;t want). And I don&#x27;t want any candidate to think I&#x27;m asking them to break their contractual obligations in order to get a job -- we operate ethically and don&#x27;t want to imply otherwise.<p>[1] I&#x27;m always careful to say &quot;comfortable&quot; so as to allow them to not have to feel bad about not having any code written &quot;outside of work&quot;. I have met many software developers (albiet often in the Junior&#x2F;mid-level skill levels) who simply don&#x27;t care to write software outside of work. At the senior level, I&#x27;ve met several software developers who haven&#x27;t written anything publicly shared in a while -- they&#x27;re working too much at their current job, have families, and might not have the time to devote to things outside of that. Interviewing sucks and anything I can do to disarm the person and get them talking&#x2F;excited will help me to evaluate them better.<p>[2] The dude <i>really</i> wanted the job. OK, I lied, the dude was me, but it was rare that I wouldn&#x27;t include these things in an app I was writing for my current employer, so those parts were automatic (and easy at that point) for me -- it felt wrong not to include them. I used the documentation to explain my choices, mostly, which avoided a second technical interview.
jcrites超过 3 年前
One employer that I respect gave me what I thought was one of the best technical interview questions that I have seen at any recent company where I have interviewed:<p>Design a binary tree containing integers. Design a function to serialize this to a byte array (or byte stream); and design a function to deserialize that same output back into its original tree form.<p>I thought this was completely reasonable and also very practical, as it tests data structure knowledge to the extent that is likely to come up during real programming tasks, in a context that is entirely plausible as well (needing to serialize data in order to store it or pass it between systems, etc.)<p>I had to look up what it means to invert a binary tree since I hadn’t heard that term in a while. It seems like something you’d be more likely to do with a binary search tree than an arbitrary binary tree, but the operation makes sense on both. (Given that a binary tree represents a sequence of elements, “inverting” the tree means constructing a tree representing the same sequence of elements in reverse.)<p>If you realize that inversion is as simple as swapping the left and right edges for every node — either in place or by constructing a new tree - then the problem is actually fairly simple.<p>… as long as the candidate has a clear understanding of what “inverse” means — I might clarify and ask them to “reverse” the tree - it doesn’t seem like a particularly difficult interview question.<p>However I’m not a fan of interview questions that require a “flash of insight” - even one such as “oh this question has a simple solution: swap left and right of each node” - since candidates might get tripped up looking for traps that require algorithms something more complex than the obvious.<p>Also I think that kind of task is rather removed from the kind of problem that we typically work on as software engineers on a daily basis. Serializing and deserializing data structures is something that I do in one fashion or another not infrequently - usually not with custom code but I think a competent programmer should be able to write that code.<p>Binary trees and algorithms on them are not something that come up very often in practice in my experience. They might come up if you were building a collections library or a particularly optimal solution to a large scale problem.<p>Otherwise, I don’t think I’ve seen a binary search tree in userland business logic the entirety of my professional career. On the other hand I’ve definitely had to write serialization&#x2F;deserialization functions for object graphs. Although this is less common now that there are a variety of good serialization libraries and RPC tool kits, I find it’s often still necessary to convert between their generated structures and the native ones used by business logic.<p>In conclusion: the question seems like one that I would expect a competent developer to be able to solve, as long as they’re given a clear understanding of what the problem actually means (i.e. explain what it means to invert a tree and not takeoff points for not knowing that) - but it’s not a good problem IMO because it’s not the kind of code one would typically need to write while solving routine business problems.<p>All that being said, Google also rejected me during my last round of interviews; I believe this was because I was transparent with the recruiter about my interviewing at other companies and offers that I had, and Google’s offer (per the recruiter) would have been for considerably lower compensation. They said they did not want to compete on compensation because it would be unfair to their existing employee population, and so - per my best read of the situation (there was no discussion about my interview performance, and rather about this) - they decided not to make an offer that was lower on compensation, and potentially also on comparative level. So I might not be the best person to comment on Google‘s hiring practices. During a previous interview they did give me an offer though so <i>shrug</i>. (I interview periodically to benchmark comp and stay sharp)
tetsuhamu超过 3 年前
Reasons we test for data structures and algorithms:<p>- The work sucks because existing employees don&#x27;t know DSA&#x27;s<p>- We want people to re-implement and refactor with better DSA&#x27;s<p>- We want to know the candidate studied for the interview (took it seriously)<p>- We actually do want them to know DSA&#x27;s when joining the team<p>- It&#x27;s the least you can do when applying for a CS job<p>Most recruiters provide links and resources, the material isn&#x27;t a mystery.
评论 #29926171 未加载
评论 #29927397 未加载
mrkentutbabi超过 3 年前
If I have money for every article that rail against DS&amp;A algorithm....<p>I don&#x27;t understand why people hate DS&amp;A so much. Just do it. Get money, jump ship, get more money, it also makes you a better engineer. It gives you better compensation, it helps you, helps everyone, helps your team, your company. It helps avoid wasting time as well on both sides.<p>There is no downside of studying DS&amp;A and Leetcode, if there is, the downside is minimal.<p>And yes, you can have DS&amp;A knowledge without handicapping your other software engineering knowledge. It is a fallacy to think that a Leetcode monkey wouldn&#x27;t be able to code resilient, robust software, with good variables and good readable, maintainable code, and vice versa. Like, seriously. Why this is even an argument?<p>And after DS&amp;A interview, there is behavioral questions interview. If someone is a crazy person, ideally behavioral questions would weed that out.<p>I don&#x27;t understand why people prefer &quot;here take home questions&#x2F;work for 5 hours for free&quot; over DS&amp;A interview.<p>Also, it is &quot;Green Lumber fallacy&quot; to think that a knowledge of &quot;how webpack 1, 2, 3, 4, and nth build system in JavaScript here works&quot; will make you a better engineer. Those kinds of knowledge aren&#x27;t long lasting, and it is also quite easy to learn relative to DS&amp;A.<p>Here is the problem with these kinds of articles. Majority of them are written by people who hate these kinds of interview questions, and by extension, they probably aren&#x27;t that good at it.<p>There are articles that sing praise of DS&amp;A interview but of course it doesn&#x27;t get here on HN because it is not controversial and the number of bitter SWE who don&#x27;t have DS&amp;A knowledge overwhelms those who do.<p>Not saying the author doesn&#x27;t have DS&amp;A knowlege, just my generalization.<p>And yes of course there are people who excel at software engineering without DS&amp;A, but that&#x27;s not the point of DS&amp;A interview. The point of DS&amp;A interview is as fast as possible system to vet engineers that aren&#x27;t time wasting on both sides. It accomplish its purpose nicely. Engineers aren&#x27;t as non-fungible as they think. Deal with it.
评论 #29926390 未加载
评论 #29926642 未加载
评论 #29926594 未加载
评论 #29927678 未加载