25 ms·
> My resume speaks for itself. At the time of this writing, I am working with someone who has 10+ years of experience, including former positions as a lead dev
by pault 7y ago
> My resume speaks for itself.
At the time of this writing, I am working with someone who has 10+ years of experience, including former positions as a lead developer. I was involved in the interview process and made the recommendation to hire, as they were able to answer a lot of domain-specific questions very well and had a good knowledge of the ecosystem. Fast-forward three months, and I am spending hours per day sending changes back on code reviews for features that would have taken me 30 minutes to implement. Every review has at least one conditional that always evaluates to true. Yesterday I found a try/catch block that always throws inside of the try block. The crown jewel was the following for-loop (psuedocode):
for i=0; i<=3; i++:
try:
doSomething();
catch:
if i<3:
continue;
else if i==3:
break;
And the best part is because of political reasons and difficulty hiring a replacement, we can't fire this person. I now include coding exercises in my interviews. I typically focus on reviewing code with bugs and refactoring bad code instead of forcing them to whiteboard.
- jimcsharp 7y agoAt least you have a constant source of code for interviewees to fix.
- pault 7y agoYou jest, but the for loop example is now in our pre-screening questions!
- HorizonXP 7y agoWould a better interview test be to ask the candidate to review code rather than write it themselves? That is, give them a code sample, describe what it aims to do, and ask: 1) Does this code accomplish the goal? 2) How would you improve this code to make it more readable? More efficient? Personally, I think I'd rather work with people that know how to review code and provide feedback/commentary, since that usually means they can write good code themselves. It should lead to a better team dynamic.
- granshaw 7y agoI think both the ability to write, and (read+understand+effectively explain and give an opinion on existing code) are important, and the latter is severely under-appreciated in interviews
- oldandtired 7y agoMany years ago, I was given a piece of code and asked to explain what the code did. I got the job because I starting asking questions about what the code was expected to do and what sort of evnironment the code was running in. Even though it was only three or four lines, without first understanding the contextual questions, the code itself could have been doing a variety of tasks. Since I did become the maintainer of the code base, it did turn out that there were quite a few non-obvious effects occuring in that piece of code. There are plenty of programmers who would have jumped right in and explained what the code was doing (surface appearance) and missed the simple fact that there was nowhere enough information present to actually know what that code was actually doing. So even with you two questions, which are a start, getting them to indicate they understand the context/environmental problems can be a more challenging process.
- sokoloff 7y agoIs this person doing (valuable) work that would even require hiring a replacement? If not, fire them. If so, lobby to secure a backfill and then fire them.
- pault 7y agoThe crux of the problem is that we've interviewed dozens of applicants and none of them have been able to pass the sniff test. We are setting the bar pretty low, but the average skill level of the people we've had access to is shocking. There just isn't a supply of good developers for companies that aren't FAANGs or unicorns. And before anyone says we aren't paying enough, or we are being unfair, the reason these interviewees are not passing is because they can't answer basic questions about the languages and frameworks they've been using for years. Things that you would know if you spent five minutes reading the first few pages of the official documentation. It's baffling. If I could even get a talented junior that I thought was capable of leveling up to a senior position in a few years I would be ecstatic. Edit: for example, when interviewing for a react/redux position, one of the first questions I ask is "if you need to make a network request in an app using redux, where do you put it?" at least 3/4 interviewees answer "in the reducer". From page 3 of the "Basic Tutorial" in the redux documentation: Things you should never do inside a reducer: Mutate its arguments; Perform side effects like API calls and routing transitions; Call non-pure functions, e.g. Date.now() or Math.random().
- SkyBelow 7y ago>There just isn't a supply of good developers for companies that aren't FAANGs or unicorns. ...at the salary you are offering. I see many people hiring adjusting for cost of living but not adjusting for the place being less desirable to live. Also, given the reputation of FAANG and similar, working for them is viewed as something of a future investment. That is a benefit your company likely cannot offer. So even if everything else was on par with a FAANG in terms of pay, benefits, and working conditions, ideally you would have to pay a slight bit more to make up for the difference. Granted, the market is never that rationally acting in any individual case. Having seen numerous IT managers having trouble hiring, the most common shared issue is too little pay.
- doitLP 7y agoI do the same for a “senior” developer with 20 years more experience than me and a bafflingly appalling understanding of how to write basic code. Bless you sir, you are keeping the code legible and clean for everyone else on your team and doing a great service for your company — even if they don’t appreciate it.
- e40 7y agoSo, the developer is overconfident. Have you tried coaching this person into understanding this? I feel that is part of good management.
- mav3rick 7y agoThat's not what they bargained for when they hired a senior person. Basic coding questions would have filtered him.
- deleted 7y ago[deleted]
- pault 7y agoWe've had several sit-downs. The problem with a low-skilled senior developer is you'll never convince them that they are writing junior-level code. It would shatter their world view.
- threwawasy1228 7y agoI think a bigger problem is that they probably weren't lying or fabricating their resume. They probably weren't trying to trick you in some way, they probably just have actually programmed like this for the last 10 years! In a lot of work environments especially in the midwest, it isn't surprising to encounter people like this that don't know basic best practices. The standards for what a company wants from their programmers can vary wildly depending on the location. This speaks to a broader problem of not having consistency across the industry and various locales.
- kamarg 7y agoAs someone from the Midwest I can assure you that we don't have a larger percentage of crappy coders than the coasts and tech hubs do. We spend just as much time fixing the code from your terrible developers as you do from ours. It's really a lack of training provided by companies and that most 4 year degrees don't actually prepare people to write good maintainable code so new developers have to luck into finding a mentor that can teach them these things.
- threwawasy1228 7y agoI didn't mean it to be insulting or to imply that there are not talented people in the Midwest. What I mean is that if you look to places like Louisville, KY for just one example, or Dayton, OH and look at the type of pay that is being offered there, it is vastly below the coasts. Even adjusted for cost of living and other expenses, many cities across the midwest pay below what is a reasonable market value, and naturally they only get people who will accept those below-market rates. When I said 'the midwest' in my original post I didn't mean places like Chicago, St.Louis, or Indianapolis that pay industry standards adjusted for cost-of-living. It isn't out of the realm of possibility though for someone to get 10+ years experience in a place like Lexington and have them still not know basic things EVEN after having been trained. Again this is just my anecdotal experience, I don't mean to insult anyone from these places. This is about brain-drain and salaries, not about anything intrinsic about a place or their people.
- 7y ago
- ubershmekel 7y ago> This person is so convinced that they are a good developer that they refuse to take direction or ask questions While I agree a coding exercise is valuable - this is the actual problem. The way I test for that humility is by asking "tell me about a time you personally did a poor job." I then follow up by asking for a time they identified a failure of a colleague. I look to see if they're empathetical, open to being wrong, and declaring they're always trying to improve.
- neilv 7y agoA difficulty with this kind of question is that the how-to-beat-the-coding-interview books and sites, which many students and professionals read, already prep them for how to answer. People get step-by-step strategy for this kind of question, what the interviewer is looking for, and what notes to hit. And sometimes prep them for the exact question, so that they can have a prefab answer ready. Then we might be selecting for more like what used to be MBA students, or at least people who know how to play along, and say the right corporate going-through-the-motions things. Some organizations will want to select for test-prep specifically, as a good predictor for the kind of employee they want, but I like to think there's other organizations that decidedly don't want that.
- pmikesell 7y agoI don’t think this is a great approach. You’re selecting for good talkers. There are many great engineers and coworkers who don’t do well on these types of verbal psychological games. Folks are given all sorts of interview advice about leading to claim things like “my greatest weakness is that I work too hard”.
- AgentME 7y agoOne way to test for humility is have them do a programming challenge that isn't too difficult (it's not about whether they remember the algorithm for merge sorts), but has a few common pitfalls and arbitrary choices, and see how they react when you ask questions about their choices or make suggestions to them. Can they explain a choice? Can they follow a suggestion (or correctly and politely argue that it's unnecessary)?
- dbancajas 7y agowhat was wrong with this code? I don't deal with exceptions a lot so not familiar with the idioms here. Is it because the catch is not doing anything at i<3? And then at i==3 it just breaks from the for? So rendering the whole thing useless ?
- pault 7y ago`if i<3: continue; if i==3: break;` is what a for loop does. You don't have to manually control it.
- onlyrealcuzzo 7y agoEntrepreneurial engineer here... If I ever hire an engineer for my business -- I hope it'd be someone I've already worked with and know -- but if it had to be someone random, I'd pursue this method: 1) Solicit Resumes 2) Pick N candidates 3) Phone screen to make sure they aren't complete assholes 4) Stack rank & pop top candidate 5) Pay them to develop a feature on contract 6) If satisfied, repeat step 5 until ready to hire; else repeat step 4. I think it'd be important from the start to let candidates know they might need to do a week or more of work (for pay) before getting a final hire. Some people would be put off by this, sure. But I suspect the people put-off would be people desperately seeking full-time employment. I think it might attract a lot of talented people that don't want to go through a 4-week long ceremony of an interview process that takes up days of time with no pay, though.
- neilv 7y ago> 6) If satisfied, repeat step 5 until ready to hire; else repeat step 4. How do you mean "ready to hire"? You're interviewing and giving audition gigs before there's an actual job opening?
- kevstev 7y agoThis seems good on the surface, but I can't imagine top tier talent at a FANG or equivalent ever leaving their job to do this. I feel this filter will only leave behind those who are currently contractors that are interested in maybe going full time, and the unemployed/employed who are desperate enough to go along with such a scheme. Foregoing the typical crappy interview process is one thing, but working, even for money, without any certainty as the end outcome would certainly turn me off. To be honest, this setup seems like something that would be hatched by a scummy company to constantly string you along with a carrot that will never come. I am not implying that you are that type, but there are enough horror stories out there that I would avoid ever getting myself put into that position.
- mixmastamyk 7y ago> top tier talent at... Must be looking to get out for some reason. Doing a small side-project shouldn't be a big impediment. > I would avoid ever getting myself put into that position. Extreme risk-averse behavior can cause problems on the other side. Easy enough to give a small-project a try and cut out early when red-flags are actually encountered. Just the cost of doing business, IMHO.
- zerr 7y ago> I typically focus on reviewing code with bugs and refactoring bad code instead of forcing them to whiteboard This is a completely different (and actually relevant) thing compared to leetcode/hackerrank riddles.
- mixmastamyk 7y agoIndeed, came to say that is a much better alternative.
- naveen99 7y agoFor loop syntax is unnecessarily complex when you first encounter it. A simple if then control flow is much easier to understand and is how it’s done in assembly anyway. Unfortunately he used both. Maybe an opportunity to teach him about goto and labels...
- pault 7y agoWhen you first encounter it sure. After you've been writing code for more than a few months I would expect you to have mastered it. If you don't understand the fundamental behavior of a for loop after ten years of professional experience, something is very wrong.
- naveen99 7y agoI wasn’t disagreeing. Just adding that their code shows they don’t understand goto and labels either.
- siscia 7y agoBut code like that pass your unit tests, integration test, CI, and LINT? If it does, you may consider to improve the quality of your tests. If you don't have all of those it is your fault since you are cowboy coding instead of doing engineering and at this point he is playing along.
- mikeash 7y agoHow are tests supposed to help when someone writes atrocious code that works? The posted pseudocode probably gets the job done.
- siscia 7y agoI answer to brother below. Anyhow, if it get the job done, just carry on. The importance of a random snippet of code of a random company is so small that is pointless to discuss about it. Just don't let him do any design work and be quick to throw away bad code and refactor. You got all your tests and procedure in place so it should not be that hard. We are really overestimating the importance and difficulties of our work.
- sethammons 7y agoI don't agree. I think there is no reason to get over pithy about code style. Question one is "does it work," but question two is "can others read and maintain it." By adding in extra logic and lines that do absolutely nothing, the next reader of the code has to slow down and think, "ok, person A did this for a reason, what is their reason..." and disassemble the bad code only to realize that they just waited their time doing so. Readable and maintainable need to be considered for any code that will be maintained or read by others.
- pault 7y agoCan you show me a linter or a unit test that would reject that code?
- siscia 7y ago
- mixmastamyk 7y ago> political reasons and difficulty hiring a replacement, we can't fire this person Believe that's the root problem, right there. Gun-to-head coding problems aren't the solution.
- achenatx 7y agook Im stumped :) Would be interested to read some clarification on this. the try always throws an exception, and if i<3 resumes the code. But on the last iteration through it breaks so will not execute code after the exception is thrown. The first 3 times it will execute code after the exception is thrown. Does continue return to the beginning of the for loop or resume execution where the exception was thrown? If continue returns to the beginning of the for loop then I could see that the code is pointless. But if continue resumes execution inside of dosomething the line after the exception was thrown, then it could actually be useful. Is your issue that the code does actually work, but conceptually it is horrendous to implement the branching in that way, or is it that the code doesnt work at all, or is that it actually does nothing? When I see things like this I integrate them into our interview process.
- pault 7y agoSorry, I think there's a couple of confusing things there. I mentioned a try block that always throws, but that was a different bit of code. In the example I posted of the for-loop the try/catch is unrelated to the previous, so we can assume it doesn't throw every time. The only WTF is why are we counting `i` and using `continue` and `break` to control a for loop.
- deleted 7y ago[deleted]
- Scarblac 7y agoThe part in the except: does exactly what the for loop already does, it's completely superfluous. It also has nothing to do with handling the thrown exception.
- janee 7y agoYeah it's pretty weird. Was trying to think of something that would need this exact behavior, assuming it's legit...maybe parsing some piece of text where you expect a fourth part only if the third was parsed successfully and you don't care about the outcome of the previous two ¯\_(ツ)_/¯ Scenarios like this scare the bejubus outta me, it's like a business logic landmine waiting for a refactor tractor to drive over
- Kuraj 7y agoSince they are knowledgeable about your domain, maybe there is a position at your company that they would be able to fill better? Edit: I apologize - I wrote that comment before reading the rest of the discussion, after which I had more context.
- Consultant32452 7y agoSome people have 10 years of experience, others have 1 year of experience 10 times. This is a very hard thing to really make a part of your thinking process, in particular because nobody wants to come to terms with the fact that they might be in the latter group.
- geebee 7y agoWow. That's a hell of a loop. That said, this does seem like another reiteration of the "senior engineer couldn't write fizz buzz" story, though this particular example is amusing. I can write fizz buzz. Hell, I've interviewed enough that I can print all permutations of a string (or all permutations of a set and/or subsets of that set). I used to be able to implement merge sort in 45 minutes at the whiteboard, but I can't now, and I never want to be able to do this at 45 minutes at the whiteboard again. I could certainly detect a cycle in a linked list, and I could do DFS and BFS on a binary tree. I might be able to reason through how to find the last common ancestor of two nodes, or find all matching subtrees in a binary tree if I could hack around for a while, but at the whiteboard, in 45 min? Nah. So, no-hire. It's time to stop pretending these tests are about weeding out people who lack very basic coding skills. Tech interviews are one of the reasons I'm not enthusiastic about recommending a career as a software developer.
- pault 7y agoThat's all true, but it's not really relevant to what I was saying. We don't do whiteboard interviews; that was some code I found during a code review. My original comment was in response to the assertion "my resume speaks for itself", and was simply meant to serve as a counter example. A lot of people seem to have interpreted it as "interviews should involve complex whiteboard programming" and/or "you should always use redux for your back office CRUD apps".
- kragen 7y agoThe original story here wasn't about code written in an interview, but code written on the job by someone who wouldn't have been hired if they'd had to write code in the interview. But, 45 minutes for mergesort? I mean, it's not fizzbuzz, but this took me seven minutes, and it passed the test on the first run (well, not counting the test runs that verified the test was invoking an empty function and correctly reporting that None wasn't the correctly sorted list). Does it have some kind of subtle bug I'm missing? def mergesort(items): return (items if len(items) < 2 else list(merge(mergesort(items[:len(items)//2]), mergesort(items[len(items)//2:])))) def merge(sa, sb): ia = ib = 0 while ia < len(sa) or ib < len(sb): if ib == len(sb) or ia < len(sa) and sa[ia] <= sb[ib]: yield sa[ia] ia += 1 else: yield sb[ib] ib += 1 def ok(a, b): assert a == b, (a, b) ok(mergesort([3, 5, 3, 1, 10, 11, 12, 0, 1]), [0, 1, 1, 3, 3, 5, 10, 11, 12]) If I were doing it on a whiteboard I'd probably want to use something like http://canonical.org/~kragen/sw/dev3/paperalgo http://canonical.org/~kragen/sw/dev3/paperalgo rather than Python, but I can't imagine it would take 45 minutes. Do you mean in assembly language or something? In minimal space (none of the logarithmic number of copies required by this version)? I agree that these are not very basic coding skills, but they are kind of basic coding skills, I think? Like, it's covered in the first part of an undergraduate CS curriculum, isn't it?
- confusedcoder 7y agoForgive me because I have used a similar idom when dealing with io. I do something like: for i=0; i<3; i++: try: doSomeIoWork() catch: if i<3: # maybe some network/disk issues retry? sleep SOME_TIME * i; continue; else: # tried too many times now quit raise Am I doing something stupid here?
- kamaal 7y agoNothing. Probably the original developer was trying to do the same thing. There is always a context to what some one is doing.
- pault 7y agoI think the try/catch block is confusing commenters; it's irrelevant to the control flow in this case. You could consider it equivalent to: for i=0; i<3; i++: doSomething(); if i<3: continue; else: break;
- hackinthebochs 7y agoWell the continue isn't doing any work for you since the else clause prevents the raise from being called.
- kamaal 7y agoEvery body writes something like this. Every body. Just because some devs don't write this in a single block of code, and scatter them across program logic doesn't make them any better. I've had developers balk at other developer's code for writing a series of like 100 if-else's until I show them, they do it themselves only that they scatter it. You could say this thing about nearly every OO programmer out there. Everybody writes code that mutates state in a way that produces the kind of code you mentioned as an example. It's only that some developers think they can never write bad code, while thinking other's almost always do. This is one reason why some shops hire only OCaml, or Haskell or Clojure devs because bad devs tend to use those languages less. So you buy into a great community by default.
- hackinthebochs 7y agoI... never thought to use a continue inside a catch block. Points for creativity at least....
- hlindwin 7y agoI am kind of new to all coding. Can you explain what is wrong with that code?
- dragonwriter 7y agoThe catch block merely does exactly what the loop would do at the end end anyway; it's no different than: catch: pass (That is, if the pseudocode isn't making a Rubyish distinction between exception handling and control flow [rescue vs. catch] it's just an extremely verbose way of silently swallowing exceptions, and if it is making a Rubyish distinction it's an extremely verbose way of doing nothing and the whole try/catch construct is unnecessary.)
- hlindwin 7y agoAh, I see that now with the while loop restrictions. Thank you.