10 ms·
Best engineering interview question I've gotten
- wakawaka28 3y agoGotta be careful with such a thing. You could be getting used to implement something useful for free.
- iLoveOncall 3y agoYeah I'm not doing a 3h interview without being paid, and nobody else should. This is the same as take home assignments which plague the industry.
- jonathanlydall 3y agoAnd that’s your choice. However, as technical assessments go this is very reasonable. It’s not them getting work done for free. It’s only very minimally contrived. It’s not “leet”, as in it’s straight forward (you’d essentially copy and alter an existing feature) and absolutely the kind the task you could encounter during a day job there. If I were interviewing you and you were not referred (referrals might be able forego assessments) and if you refused to do this, I would feel that your attitude was a bit unreasonable and it would make me think less of you as a candidate. But really it’s a willing buyer willing seller scenario, so you do what you feel is important to you, and I would do the same, but don’t be surprised if it counts against you.
- iLoveOncall 3y ago> If I were interviewing you and you were not referred (referrals might be able forego assessments) and if you refused to do this, I would feel that your attitude was a bit unreasonable and it would make me think less of you as a candidate. Don't worry, I would withdraw my application. > But really it’s a willing buyer willing seller scenario Yeah and my point is that I'm the seller and so should be every other candidate.
- jonathanlydall 3y ago> Don't worry, I would withdraw my application. Without a strong referral beforehand, it's really you who doesn't need to worry, there would likely be no need for you to withdraw as most employers are apprehensive about making the financial and time commitment to an employee who is not willing to do even a reasonable assessment.
- gardenhedge 3y agoHuh?
- tayo42 3y agoI disagree this is actually a good question. Also I would have been a type 1 person, mostly becasue I would have assumed there's some clever trick to it, since we're in an interview.
- albert_e 3y agoI was thinking on the lines of Type 1 myself -- some reasons I can think of in hindsight: 1. I assumed that low-level code and performance optimization was not the ask (given it was a mere three hour programming challenge with a unfamiliar codebase) 2. The very elaborate description of Incr, Decr with emphasis on atomicity and multiple clients -- was heavily leading us towards thinking about how to utilize the already implemented, stable, and presumably finely performance-optimized functionality -- rather than re-implement your own. So I assumed it was a test of design thinking where you can apply the concept of atomicity, parallelizable operations, resolving conflicts / locks / race conditions etc. If they are looking for talent in Type 2 space where they can do incremental edits to a codebase powered mostly by copy-paste -- I am not sure this intervew question is for roles that need the highest levels of generic problem solving needed from experienced Software Developers who will drive software design. Also if implementing Mult was so straightforward that it can be done so thoroughly (including tests) in under three -hours by a single person that is opening the code base for the first time; Then why had this feature not been implemented already by then by the original project maintainers? I am sure I can find some use cases where there is a need to do multiplication of an in-memory numeric value say in gaming, cypto, etc. in order to justify this feature addition.
- xw31099 3y ago> Also if implementing Mult was so straightforward that it can be done so thoroughly (including tests) in under three -hours by a single person that is opening the code base for the first time; Then why had this feature not been implemented already by then by the original project maintainers? Exactly. That set off my warning bells too.
- FabHK 3y ago
- FeistySkink 3y agoI suppose this beats LeetCode and take-home, if this is a replacement. But this might just devolve into free work under pressure. Also, previous discussion: https://news.ycombinator.com/item?id=31065143 https://news.ycombinator.com/item?id=31065143
- mkl95 3y ago> You have three hours. Go! Cool challenge, but isn't it a bit of a red flag? I don't expect you to ask me to get familiar with a codebase, test, and implement a feature in 3 hours. Ever. It's also oddly specific, if you know what I mean...
- Aeolun 3y agoI'm not sure, if there's no gotchas in this question I feel like it'd be mostly copy and paste from the addition or subtraction command? Doesn't necessarily mean that it's a good question of course.
- mkl95 3y agoI'd assume there's some kind of gotcha that makes naive solutions not scale. I may just be cynical, though.
- simonw 3y agoNo gotchas in there. It's a realistic and straight forward problem that exercises your ability to navigate and modify a well-written C codebase.
- JoshTriplett 3y agoTake a look at part 2 for a step by step walkthrough of solving the problem.
- salomonk_mur 3y agoSpoiler, it's basically copy paste of addition replacing + with *.
- yuliyp 3y agoThat's part (not the only) of the signal thing being evaluated: can you efficiently familiarize yourself with a codebase. I'd encourage you to try it. It's not that big a codebase: 140 files, 80k lines of code. Given that similar commands (incr/decr) exist, finding a way to get multiplication to work shouldn't be out of most qualified candidates' skillsets for a software engineer job (language skills aside).
- supriyo-biswas 3y agoAs another data point, I’ve faced this question as well when interviewing with them. Having said that, it’s a great alternative compared to Leetcode style questions, where you’re penalized for just asking about the problem or not having the right insight from the get go, or not using the interviewer’s preferred formulation of the solution (such as using two queues for a graph search problem instead of just one).
- themoonisachees 3y agoMaybe it's just because I do that a lot, but imo potential candidates that are HN readers already know how to do this, if there are no gotchas. I find leetcoee considerably harder.
- belval 3y agoYeah I would be fun to do a analysis of commenters, my guess would be that people defending leetcode style interview are probably younger and people praising a real code change are older simply because that's what each group is more used to.
- Xelbair 3y agoIt's been more than 10 years. if they are still using the exact same question, that's on them.
- brcmthrowaway 3y agoThis is an incredibly milquetoast question, I'm shocked it's on the front page. No crazy insight into anything related to computing.
- orthoxerox 3y agoThat's because 99% of people you hire are hired not for their ability to provide crazy insights, but to write bug-free and performant code with reasonable speed. "Here's the spec, here's the repo, can you get it done by the next release cut?"
- execat 3y agoCompanies that plan on doing something like this: please make sure you are paying your candidates market wage for the interview. For Leetcode style questions, there is some amount of interaction from the interviewer, so the cost to the company is that employee's 1 hour wage. If as a company, you feel like this is an efficient and superior way of interviewing, consider giving that amount to the candidate.
- supriyo-biswas 3y agoThis question is asked over an interview (I’ve personally faced this question) and the company isn’t deriving any more value out of asking this question as opposed to a Leetcode-style question, so I disagree.
- PUSH_AX 3y agoA 3-4 hour interview is a nope from me. I can’t believe this is normalised.
- supriyo-biswas 3y agoThis was a one-hour interview when I faced it.
- PUSH_AX 3y agoFor OP he said it was three hours after the context was given. I guess it depends, this is personal to me but I'm bowing out of most processes that I deem to be meaningless/a waste of everyones time.
- supriyo-biswas 3y agoThen of course, the natural conclusion is that some portion of potential candidates would always be dissatisfied with the interview process and question set, which maybe explains the persistence of Leetcode-style interviews with all that entails.
- jumploops 3y agoThis is a great “engineering assessment” type question (as opposed to general problem solving or system design). I like it because the solution is simple (add an op code via find/replace), but quickly shows how a candidate approaches a new codebase. Testing how one deals with existing code and perceived technical debt (i.e. Chesterton’s Fence) is hard to do otherwise. Can they dive into the weeds? Do they get stuck refactoring until realizing why some code path is the way that it is? Praise aside, I’d hope most shops could craft an exercise that takes less than an hour!
- xw31099 3y agoActually, I'd probably get stuck at: if it's only three hours of work to add mult to memcached, why isn't it already there?
- bpicolo 3y agoProbably because it’s not a particularly common real world need. Have you ever found yourself grasping for a multiply command in a cache?
- xw31099 3y agoNo. But I don't often work on databases so I don't find myself grasping for any commands in a cache. It's hard to imagine that if there's a use case for adding a delta there's not also a use case for multiply by constant. But I'm not familiar with the market so maybe I'm wrong.
- jstanley 3y agoYou add a delta in any situation where you want to track "how many" of something. (Page views, for example). I can't immediately imagine when you would want to multiply.
- bpicolo 3y agoThe one I can think of is tuning circuit breakers so that failures are additive but successes decrease more multiplicatively/exponentially, which helps with fast recovery. That’s more dividing than multiplying though
- nneonneo 3y agoAgreed - this is a great type of question. Being able to dive into a new codebase and read code at speed is a critical skill. Even when working on "the same old codebase", sometimes you run into weird corner cases that have you diving through a dependency, or debugging a perf issue that has you walking through other parts of the system. And reading a codebase doesn't always mean grokking the whole thing - if your goal is to figure out why some API call is failing, targeted reading is exactly what you want to be doing. FWIW: Took me 20 minutes from start to finish, without editing tests, but including ~5 minutes taken to update the codebase so my new-ish Clang would actually compile it. I didn't touch the binary protocol, though; in a real setting you'd have to make sure the binary protocol extension would be compatible with other extensions made since this version.
- deleted 3y ago[deleted]
- sethammons 3y agoThe best received interview question we used to give was for a role that involved fixing existing code bugs. The technique to design such a question: distill an actual problem your team faced recently into something a competent developer could solve in about 15 minutes. The problem: we had a credit reset script that users complained about. Apparently it gave incorrect resets. We sanitized the db tables needed and introduced a couple more simple bugs in the data, sanitized the script and provided a couple different language adaptations with a couple added logic bugs. The candidate was given access to the repo and it had a clean way to reset the tables. The candidate had 45 minutes to fix the issue in the associated bug report tickets. We received so many compliments from candidates, even those who were not hired. TL;DR: design a work sample test and give that. Base it on recent work. Give the candidate 3x the time to solve it than what it takes you or a midlevel dev on your team to solve.
- b-side 3y agoThis can be optimised why only use problems that the team already solved? Just give the candidate access to the current JIRA tickets and let them choose one to tackle. Think about all the value that you could be extracting /s
- PeterisP 3y agoA three-hour test is above what I'd consider acceptable for most potential employers. I can talk with you a bit, but if you want me to come in and do work for half a day, I'm going to refuse, I've got actual paid work to do.
- jonathankoren 3y agoBro. Most interview panels are more than 3 hours. If you're getting a multihour test, it's literally the only interview in the day.
- PeterisP 3y agoI've never had such a panel interview in my quite long career and possibly never will. I'm not allocating a whole day for an interview, that job offer isn't likely to be that much better than the current job or other alternatives to justify jumping through such hoops. If you want me to do work for you and judge me on that, I'm available as a contractor.
- jonathankoren 3y agoYou have never had an all day interview? Not even onsite? That’s weird. Seriously. That’s weird. Every job I have had in my 20+ year engineering career had a multihour interview panel. I’m talking like at least four separate hour long interviews all on the same day. Big company. Small company. It literally didn’t matter. And you’re saying this has never happened to you? I have to ask, what has been your typical interview experience been, and how tiny are these places?
- PeterisP 3y agoI did just literally say that this has never ever happened to me. Likely that's a regional thing, perhaps panel interviews are popular in USA - but my practice has always been 1-3 rounds of <1 hour interviews, at various sized places including a multinational bank (where I also did many interviews from the hiring side both for technical and nontechnical roles, but it always was ~3 rounds of <1hour interviews with no take-home tasks; if more people were needed, they were included at one of the interview rounds, not as extra time), a major government institution, and a matured tech ex-startup - and while your question was reasonable, IMHO framing your prejudicial assumptions as "how tiny are these places" was an unprovoked insult that's not entirely appropriate.
- fragmede 3y agoThe best one I've heard of lately is "here's some code that ChatGPT generated, where/what are the bugs/issues/problems with it?"
- mdavid626 3y agoThis is actually not a good interview question.
- ein0p 3y agoThree hours? My own time was about 45 minutes (at MemSQL, did not get an offer), completely unprepared. It's not a complicated codebase to comprehend, and you can rely on the existing plumbing for other ops. The best candidate I've interviewed also implemented DTrace instrumentation support for this in the same amount of time. I do agree this is a great question, far better than irrelevant Leetcode bullshit that gets typically asked. At least it's far more predictive of the actual on-the-job performance, because this is what the candidate will be doing mostly, as their job.
- xkbarkar 3y agoIs there any other field that normalizes this type of insane interviews. They are even applauded by the vast majority in this thread. Do mathematiticans have to interiview like this? Medical doctors? Police officers? Rocket scientists? Chemists? Architects? I cant think off a single profession apart from the IT domain that does this. I dont think there is a single profession that gets mocked on their interviewing strategies as much as IT still I see senior devs defending this insanity.
- GardenLetter27 3y agoThe issue is without it how do weed out the bullshitters and frauds? I've done loads of interviews of "engineers" who could barely program at all. A short test like this can remove them completely and then you just need one discussion interview for the handful of candidates that remain.
- tgv 3y agoThe point is: it isn't exactly short. I do agree that this probably has no value for the company. They could implement this easily themselves. Now, if they would give a different arithmetic operation to each applicant...
- isbvhodnvemrwvn 3y agoIn the 2022 thread it was mentioned the time limit was either 45min or an hour and not three hours, same as any standard coding interview.
- tgv 3y agoThat makes a lot more sense.
- dagw 3y agoA short test like this can remove them completely If your goal is to remove the bullshitters wouldn't a 5-10 minute, slightly harder than FizzBuzz, test also remove them just accurately and save everybody a bunch of time.
- redbell 3y ago(2022) Form 'Part 2': > This is a great engineering interview problem because it pretty cleanly partitions the candidate pool into three different types: > Type 2 looks at the problem and says, “Ah! I know just how to do this! Multiplication is just like addition, except wherever addition does +, I should do .” So they copy-and-paste, change all the +s to s, and they’re done in 90 minutes. Candidates in this group stand a really good chance of being hired. As a non-expert in C/C++, I would definitely be of type 2, but I would be too afraid to apply for a job to work on a database engine's codebase.
- reyqn 3y agoI'm definitely not fluent in C/C++ and I think I might have done ok with this question, even if I probably wouldn't be a right fit for this job. I guess I wouldn't have gotten to this point in the interview process so it's ok.
- devnonymous 3y agoThis comment is about some of the replies here. On the one hand everyone seems to agree that software engineering interview process is broken because it doesn't make sense to ask comp science implementation questions for an engineering job. On the other hand some people balk at having to do a 3 hour engineering interview...or take home tests or full day meet-the-team style interviews. Payment for interviews is a can of worms w.r.t legality, either that of you restrict your candidate pool to people not currently employed. To those who refuse engineering intervies that take time - what is your solution?
- liampulles 3y agoI feel like this type of interview misses otherwise good candidates who struggle to perform under this type of interview pressure. Granted that they would be generally undervalued in interviews, but for me a truly great interview question/interview setup is not about a clever technical question, but rather about being able to assess true on-the-job ability despite the interview setup. Not an easy problem to solve I think.
- throwaway2037 3y agoOh, so another interview question where a Eureka[1] moment is required. And, don't tell me: You got it right. Next, you are write about it how it is such a "genius" interview question to select the 10x engineer. This question looks ridiculously hard, considering the setup. > Type 2 looks at the problem and says, “Ah! I know just how to do this! Multiplication is just like addition, except wherever addition does +, I should do *.” So they copy-and-paste, change all the +s to *s, and they’re done in 90 minutes. Candidates in this group stand a really good chance of being hired. And just before that, he wrote: > By the way, MemSQL-in-2013 was doing deeply arcane and high-performance C++11, so the fact that this challenge incidentally requires fluency in C was a plus, not a minus, for their purposes. Sheesh. [1] https://en.wikipedia.org/wiki/Eureka_(word) https://en.wikipedia.org/wiki/Eureka_(word)
- praptak 3y agoI don't believe this falls into Eureka moment category. This is adding an operation into a codebase which already implements a similar operation. The problem is also not "fluency in C" because they require it for day to day work. If anything sucks about this task it's that it also tests "set up a C IDE from scratch on Linux". This might reject a good candidate who nevertheless didn't recently set up such an environment. OTOH this one is easy to fix - either set something yourself or tell the candidate they will be expected to do this, so they will have time to prepare.
- stavros 3y agoThe article does mention you get a computer with all that set up already.
- kqr 3y agoYes, it's a hard question, but if you're grepping for skilled programmers you want a hard question. The point of these types of tests is not to minimise false negatives, but eliminate false positives. (And besides, "I need to replicate this addition-based functionality but for multiplication" does not seem like such an Eureka moment to me. The main difficulty for me seems to lie in navigating a big codebase, and exposing a new function on the API -- the difficulty of which depends on how well modularised the codebase is.)
- deleted 3y ago[deleted]
- deleted 3y ago[deleted]
- dirkc 3y ago> Basically, this question is to software engineers as FizzBuzz is to programmers I don't get this comment at the end or the follow-up article? What's the difference, sure, FizzBuzz is a simpler problem, but I would imagine it being a common interview question for software engineers
- 000ooo000 3y agoGarden-variety elitism. Safely ignored.
- brickteacup 3y ago"Expecting basic programming ability" isn't elitism, sorry
- ric2b 3y agoIf it's basic programming ability why bother making the distinction?
- ZephyrBlu 3y agoThe point he's making is that software engineering skills are about a lot more than just programming. Being able to navigate an existing codebase, implement new functionality and blend it into the surroundings is an important skillset that is pretty distinct to just writing code.
- UncleMeat 3y agoThat to me still feels very much like a programming task. To me, broadening to software engineering means things like requirements gathering, timeline estimation, prioritization, etc. If you just wanted to focus on code I'd choose things like writing programs that are extensible over writing extensions to existing programs.
- ZephyrBlu 3y ago
- dugmartin 3y agoI'm not a TDD (test driven development) zealot but this kind of problem is begging for a test harness. Even if you don't want to dive in and figure out the memcached test system you could write a script that did something like this to greatly speed up your development: (echo "set age 0 3600 2"; echo "mult age 10"; echo "quit") | telnet 127.0.0.1 11211 | diff expected.txt - and then create expected.txt to test the output. (Note: I created the command line from memory - maybe nc would be better to capture stdout.)
- viraptor 3y agoTelnet reads keypresses from terminal instead of using stdin/out. You need to use nc instead. Or expect, but that's stacking one terrible thing on top of another...
- deleted 3y ago[deleted]
- timthelion 3y agoI presume that the poster did not get the job. The correct answer is that while addition and subtraction are mutually order independent addition and multiplication are not. This cannot be implemented for a value that allows addition. You need to create a new type of value "multiplyable" and implement multiplication only for that new special type of int. Otherwise you'll end up with meaningless race conditions in the case,of multiple clients.
- resolutebat 3y agoCongratulations, you have qualified as a Type 1 candidate and did not get the job. "and the whole thing needs to be atomic. Let’s look at how the locking works…” They spend all three hours getting deeper and deeper down various rabbit holes, and never produce anything that works. Candidates in this group don’t get hired."
- timthelion 3y agoActually, I know how to communicate and would explain the problem to them.
- timthelion 3y agoAlso, locking wouldn't help with this as even that wouldn't fix the fundamental design issue.
- brickteacup 3y agoI actually can't tell whether you're serious... The article mentions an `append` operation which is obviously not commutative; does that imply memcached needs a separate "appendable" string type? Of course not. Memcached only guarantees that the individual operations are atomic, it's the client's responsibility to avoid race conditions between multiple operations.
- downut 3y agoYeah, um, there's a difference between "the client" and "multiple clients". Multiple clients racing can't be fixed. I begin to wonder about this programming culture. Speed at generating LOC, doesn't necessarily have to work IRL...
- BonoboIO 3y agoI think of myself as a decent programmer, not a 10x or some other superlative, but after reading the article and challenge i was like: „Let’s find the incr method and see how it works, take it as a base and work from there“ Is this not common, because some treat this here as some kind of „Eureka“ moment. My absolutely 1 minute trash try would be to run the incr k times, see if it works and optimize from there.
- dolmen 3y agoIf incr is atomic, running incr k times will not be atomic.
- pflenker 3y agoI would not apply. Besides the fact that I don’t want to spare half a working day unpaid, I find it worrying that implementing a feature on an unknown code base without any kind of collaboration with co-workers before or during the implementation step is considered normal in that company. I’m not a fan of pairing all day, but coding tasks like these always seem to assume that it’s normal to not talk to other experts in the team, and that asking for advice or brainstorming on solutions or pitfalls is the exception.
- toast0 3y ago> that implementing a feature on an unknown code base without any kind of collaboration with co-workers before or during the implementation step is considered normal in that company. Isn't this collaboration? They've identified the codebase that needs changes, so it's not unknown to the company, just to you. They've designed the feature. They'll review your work in 3 hours. I don't want to work at a company where it's not normal to get simple half day tasks with enough detail that you don't need further communication. I want to work independently, not be stuck communicating all day.
- pflenker 3y agoas a rule of thumb, I think the person doing the implementation should be part of the analysis. And as a second rule of thumb, I think it should be avoided to let someone dive into a completely unknown code base alone, at least when we talk about implementing new core features. I’m not advocating communicating all day, but I think coding exercises like these miss the very important collaborative aspect of coding. I would also not try and find a drummer for my band just by listening to them drumminggor three hours, instead I would like to see them performing a bit with other band members.
- tracker1 3y agoIt's not a bad challenge question.. that said, Is ask if the input and result should still be treated as an integer, floating point or arbitrary decimal value. What level of precision and if rounding at .5 should always be up or random in the case of interest precision. For the simplest path I'm pretty sure I could figure it out. It's been a few decades since I touched C though. Aside: currently job hunting and really hate the automated coding challenges. They all suck with too many assumptions. I'd much rather be tossed into a task like TFA in a language I don't even know.
- jasonjmcghee 3y agoThis was top of HN a year or so ago. Lots of interesting comments, including the author of the question. Previous discussion: https://news.ycombinator.com/item?id=31065143 https://news.ycombinator.com/item?id=31065143
- 1letterunixname 3y agoImplement a gossip protocol for cache replication would be a good question, which doesn't necessarily require modifying memcached and would probably be easier and cheaper to maintain. Use case might be something resembling a TLS session store, even though we don't necessarily do that specific task anymore.