by ankrgyl · 4y ago · 0 comments
Over the years of evaluating with it, we learned a lot about its quirks (both false positives and false negatives). At one point, someone got so frustrated that they threw their laptop on the floor. Happy to answer any questions about it!
But the OP says this:
> When you’re maintaining a large codebase, there are always going to be codepaths you don’t fully understand
Ugh... I hate modifying code I don't understand. That doesn't mean I need to understand the entire code base, but if I'm modifying a portion of the code base, I'm loath to touch it till I understand what it's doing.
Also, of all the work I do, I consider this the least expressive of my ability. It's such a mechanical thing to do and doesn't require a whole lot of thinking?
So I guess I can see how this skill—for a job at your company—is necessary but in no way sufficient.
[1] e.g. https://github.com/git/git/search?q=jaysoffian&type=commits, https://github.com/google/breakpad/commit/6446cfcff088b8682b...
I work for a FAANG company in a senior position and I know I will fail FAANG interviews w/o advanced prep.
The second try I practiced.
This is also me. I get flack for spending too long on what seem like "small" fixes but I can't be sure (especially in spaghetti code) until I've dug through it. On a couple occasions, different companies unfortunately, I caught flack for spending too long trying to understand critical finance code. As in, how we were billing every single customer. But it always yielded results, and a week later I'm in a meeting explaining how abc original implementation would have broken xyz, but the scowls never really go away. It's frustrating.
These are generalisations. There are likely far more “types” and different people will act as different types in different situations.
Having a mix isn’t sufficient though. The team also needs to find ways to prioritise and manage conflict to get the best approach in place for any given situation.
Thank you. I've never had a phrase to adequately describe how I like to balance teams and "diversity of thought" fits well.
Edit: same thing in this interview question, the whole point is super quick performance and working under time pressure, and making changes to code bases that you don't have time to understand, why?
This is okay and to be frustrated at it, but it's important to recognize why it's happening.
FAANGs go through an incredible number of candidates with only a few slots (comparatively) and the point is to simply make the bar higher and higher. Just like a pragmatic engineering - you have a 'good enough' candidate set.
For me, the problem is when smaller startups copy the format - expecting candidates to jump through all the same hoops. If a FAANG has 1:100 position to interview candidates ratio, a startup will be lucky to have 1:5 (it's incredibly expensive/time-consuming for a startup to interview).
Running the same test likely means you're rejecting a lot of potentially good candidates who didn't want to go through a 'FAANG' interview.
If any of the candidates they are refusing are capable of doing the daily work at a FANG but can't pass the interview, they're artificially constraining their supply of candidates and increasing the cost they need to pay for developers for absolutely no reasons.
The type of work in a FANG is mostly not that dissimilar to other companies (the exception being teams working with machine learning, performance optimization, dealing with tricky scale). I understand hiring specialists for specialist jobs (and I still wouldn't test them on leetcode; ask domain specific questions).
It's just ego driven over spending on developers.
It's worth considering that engineering interviews are largely conducted by other engineers, and engineering hiring bars are largely set by senior engineering staff. They have a pretty vested interest in maintaining their own status and (relative) scarcity. Constantly raising the technical interview bar keeps engineers a supply-constrained resource...
On the contrary, rejecting a high number of candidates pushes market rates down.
This doesn't fit the "we can't find candidates, so we need more H1B's" narrative.
Supposedly, there are many open slots, unfilled, so purposefully failing people which can do the job, which meet the minimum requirements, should not be the outcome.
Instead of raising te bar, as you say, due to candidates o'plenty.
I disagree. In fact, this validates it.
On the basis of a world-wide talent pool vs a domestic. If you know there are stronger candidates elsewhere then you absolutely want to test away the domestic candidates.
Thinking about it from a hiring manager's perspective. You don't lower your standards just because a specific pool of candidates can't meet your criteria when you can widen the pool - as far as you are able.
If the H1B candidates were tested on a 'easier/weaker' test the I would 100% agree with you, but I'm assuming things equal here. And, ignoring any thing related to domestic vs foreigner workforce, "people taking our jobs" debate.
That said, there were also plenty of candidates who came to the question guns ablazing with the same attitude, and then failed miserably. I'm not saying that's you -- but rather that it worked out in practice to be a fairly good filter for whether people actually had (enough of) that skillset.
How did you rate your negatives to judge the filter was correct? You know the "Positive" status, you know your true and false positives from the interview question (People you hired that performed well or didn't. Or said another way, the predicted value was positive while true value was positive or negative).
But did you know your true and false negatives (the people you didn't hire that would have been good or bad. Or said another way, the predicted value was negative but true value was positive or negative)? Did you know the candidates you rejected who would have been good at fulfilling the roll at your company (False Negatives)?
To be clear, I don't know the false negatives either and the interview question may be the best litmus test for the behavior desired, minimizing false negatives and maximizing true positives. But I just don't know for sure if the question did work out in practice to be a good filter of people with that skillset without a true negative dataset. The Precision is good, but the recall/sensitivity may not be. Then again, you probably know how the candidates you hired performed before you used the new question and after - which may be an indicator on false negatives.
Also, that does seem like a really fun interview question to answer for me. Kudos.
EDITED: Changed the question at the same time the response came from OP. Original post asked if they hired those who failed the test to know more about the negatives. They did.
Most of the time it will be debugging some arcane crap or adding to an existing codebase, anyway.
Still, just knowing they exist and how to formulate the search is usually enough.
I am sure one was a reference in the golang source code. And I once wanted to check multi-way merge sorts (tournament sort).
> This challenge is particularly well calibrated for an interview because there is only one correct answer: “change bool incr to int opcode” (or anything isomorphic to that). The codebase and problem statement together very clearly imply that there are currently two arithmetic opcodes, and your job is to extend that to three arithmetic opcodes. [...] Cloning even one of these functions is probably suboptimal, but I might spend twenty minutes before realizing that.
I just completed it sans writing tests (took ~30min), considered and discarded that approach, instead duplicating the code-paths (leaving incr/decr untouched and instead making mult_ versions of everything). I did reuse the delta_result_type, though.
Briefly my reasoning was that this would make the fork easier to maintain against hypothetical future upstream changes and keep the logic simpler, while guaranteeing that I didn't miss to implement any particularity - compiler would complain about missing constants or functions as long as I covered entrypoints.
A bit of rule-of-three thinking: If in the future there would be even more arithmetic functions added, maybe it would be prudent to refactor and generalize parts of it? But not at this point.
Curious to hear if you agree with OP that my approach was incorrect or with me that it's equally valid (:
Whether or not your approach is "better" depends on factors that aren't part of the problem statement, so it would be a mistake to assess it as incorrect.
If there already are two arithmetic opcodes, shouldn't both of them already be handled by the same code, only with an operation parameter? In that case all that should be necessary is the handling of that parameter in the place where the operation is actually performed, and you only add one more value of that parameter.
Having said that, I haven't looked and memcached yet how it actually implements these operations. I'll have to do that.
1. If you don't do arithmetic on it and it's not a primary key then it's not a number (eg an employee number might be "123456" but it's a string not a number); and
2. It's almost never a boolean; it's an enum.
I've lost count of the number of times I've had to change a boolean to an enum (some of which I created in the first place).
My favourite hack for this is when someone decides to add a third value to a boolean with:
Optional<Boolean> foo
Nope. You're wrong. It's even more hilarious when they add a fourth value: @nullable Optional<Boolean> fooChanging a bool to an int is the kind of thing that I would worry would have unknown side-effects somewhere, whereas adding new code paths is unlikely to explode the existing.
Upstream would be a consideration, and potentially seeing what kind of a patch they'd accept.
> "diving into an unfamiliar area of the code and quickly figuring it out" was very important for us.
Universally applies to all software jobs.
What's I find interesting (based on my own personal history) is not only the ability to solve a task in an unfamiliar code base, but also do so without creating side effects (like say quadrupling the size of a binary since you incremented a poorly named constant that is reused as a size of a memory allocation by multiplying itself with itself).
I dunno, I've worked at a bunch of places where it seems people have gone "I'm not bothering to understand the old code, I'll just replace it with <framework/technology du jour>[1] and GOOD LUCK MAINTAINERS."
[1] Sometimes they write their own frameworks. These are almost always the worst.
I'm amused at the comments suggesting this is too easy (or your own suggesting the same for redis), I think if I tried this I would have filtered almost everyone, at least if they only had an hour (minus time for soft resume questions to ease them into it, and questions they have at the end). So many programmers have never even used grep (and that's not necessarily something to hold against them at least at my last job where the "As hire Bs and Bs hire Cs and Cs hire Ds" transition had already long since occurred). I've made two attempts at the idea though by crafting my own problem in its little framework, the latter attempt I used most involves writing several lines of code (not even involving a loop) into an "INSERT CODE HERE" method body, either in Java or JavaScript, and even that was hard enough to filter some people and still provide a bit of score distribution among those who passed. Still, I think it's the right approach if you have a large or complicated existing codebase, and even in the confines of an hour seems like a better use of time approximating the gold standard "work sample test" than asking a classic algorithm question.
I wouldn't necessarily consider these questions a substitute to an algorithms question, but rather a way of obtaining a different and important signal. An algorithms question may be a valuable signal too, depending on the nature of the role.
That said, I don't think this is a VERY easy task, per se. And even if it were, there's achieving the stated objective, and then there's you taking the ability to demonstrate some additional skills. I'm in the Java world, and whenever I requested candidates doing exercises, them building a solution with no unit tests, or at least not voluntarily acknowledging that omission, would be a red flag.
And then I'd ask: let's say this wasn't an exercise, what things would you add before shipping this to production, which would be a great conversation starter around (again) testing (second chance), observability, logging, and so on.
We had other questions (which I won't spoil) that tested more complex system-design skills, without having to implement them within an existing codebase. We felt this provided clear independent signals (ability to "hack" within a codebase and ability to reason through complex system design) vs. conflating the two.
As the team grew, and we needed folks who were much better at one or the other, this helped us round out the team with folks who excelled at either skill.
It can start with getting it to compile in the first place. I've spent days on building C code bases, getting the dependencies there, everything in place, then you wait, then there is some error, then you google, then you don't find anything, then you debug a makefile of one of the dependencies, etc etc. Some projects don't compile with packages from apt-get at all. Take most Rust projects for example, unless you are using a rolling release distro, your rustc version is too old.
Then you need to look at the quality of the code base. Sure maybe it's just a simple else if chain and one of them has an add and sets result = a + b; inside. Then you can copy it, modify it for multiplication, done. Trivial!
But maybe it's done via a plugin system and spread over 5 different components, and there's actually two plugins you have to add, one for the repl, one for the internal handling, and there is non trivial communication between them. So you copy the 2 thousand lines of plugin code spread over 8 files and there's a bug. How do you debug it?
You also need to be able to start the thing. Maybe it's not meant to run on developer's laptops but instead is deployed in the cloud and you have to use some unfamiliar tooling to access it?
Now, apparently in this instance the project was easy to compile, modular enough (and also not too modular) for the position needing the change to be identified in quick time, and easy enough to run and test that you could also explain your solution in one hour. But this is not guaranteed.
In enterprise Java, there is almost certainly a crazy amount of indirection, both static and compile-time.
A trivial task like "Write an API to retrieve a certain set of records from the database, and return them to the client caller" can involve:
1. Figuring out how the framework calls your API, and where the parameters are in the call. This is specified in some config (yaml/xml/whatever) file somewhere that the framework reads so that it can validate the parameters before it passes them to your code.
2. Figuring out the config-file syntax for specifying the validation criteria for each parameter and for the return value.
3. Determining if the specified list of columns is already encapsulated in an existing class. If it is, you're luck, just instantiate that class with the correct criteria and read the fields into the instance you will return to the framework.
4. If no existing class satisfies your needs (99 times out of a 100, there won't be), you realise by looking at similar existing API code that you need to create a application-logic level class that contains fields with all the values you require.
5. You do #5 above; then you read the existing API callchain again, and see that all other application-logic level classes don't talk to the DB directly anyway. They go through a DB-level class. This is because at some point in the future someone may want to swap out the underlying DB with another DB.
6. The DB-level class is tied to a specific ORM (say, MyBatis). It uses classes generated by MyBatis. You write your DB-level class to use a MyBatis-generated DAOClass.
7. You then dig into the details of the ORM, figure out which config-file (xml/yaml/whatever) to modify, how to write the template that contains the specific parameterised SQL statement (if using SQL), how to specify to the ORM that each column be matched to a specific Java type, and how to convert it if it is some other type.
8. You Aren't Done Yet! For each of those classes you created (the API handler, the Application-level class, the Dao class and maybe the generated classes from the ORM, you need to write unit-tests! The unit tests, in this simple example, will easily be twice as large as the actual new code written/generated.
9. You're done, for now, until integration testing in a pipeline fails. But that's a different issue that will always exist regardless of language or development methodology, so that one gets a pass.
And, believe it or not, the above is actually a simplified version of how it actually gets done. For example, there's going to be more lines of code mocking an instance in the tests than there are lines of code implementing the class itself.
Also, the framework calls your API, but your API probably doesn't directly instantiate the Application-level class - it hands it off to a 'call_handler' type of class that performs a threaded/sleep invocation[1] of an actual 'call' method in your API class.
Also, anything your class may need (instances of other classes that perform non-local stuff, like recording metrics, logging, lookups, etc) will be injected at runtime, and so you cannot simply declare an instance of the (for example) LookUpAddress class - you have to request an instance of that class from some sort of dependency mapper or injector, which will be provided to you when the framework calls into you.
This is normal. There are various reason for every single step above, and large companies (FAANGs, for example) will adhere to every single step (and more, like using classBuilders) because it checks all the boxes except velocity.
A startup, OTOH, had better forgo all of the above; create a monolith with no runtime injection or modification and skip all the unit tests (use more beefed up integration tests, for example). A startup can't afford to spend a day adding a single simple API, when, in the same time, they might be adding 25 new simple APIs.
There's no point in all of the rituals if the startup finds out 5 months in that the product doesn't have market-fit. It's better to determine market-fit in the first month or two.
Having paying customers is more important than having dependency injection, or the ability to switch databases.
[1] When not using Java, the 'call_handler' will use some sort of async/await call to do a proper async request.
There’s a million different reasons for why they could bomb it and a million different ways they could succeed at it and none of those reasons might be evident to the reviewer.
And this, of course, they are expected to understand in an unfamiliar code base with 3 hours total for the whole task. LOL
(I’m planning to give the interview question a shot before returning to read any more of your replies.)
False positives: we hired a few folks who could prototype changes but struggled to ship them. This question wasn't solely to blame for it, but it wasn't enough of a signal on someone's ability to _thoroughly_ work within a large codebase.
False negatives: senior candidates who were very used to a particular programming environment (e.g. at Microsoft) and didn't have side projects that kept them up-to-speed with the basics of editing code on the command line over SSH. We did a lot of work over time to setup alternative environments for these candidates.
A couple years ago I was asked to interview via CoderPad and while I appreciate their attempt at having emacs and vim bindings, the fact that they're not actually accurate was worse than using Google Docs.
That is, it's actively worse to be almost your editor of choice than I think it would be to obviously be a "clumsy editor". In the former case, the interviewer perceives you as poor at writing code when you're fighting with a slightly drunk editor, while in the latter (like at a whiteboard) the interviewer adjusts for the environment.
Edit: the interviewers let me retry via projecting my screen while using emacs locally in a terminal. I hope CoderPad has improved it's key bindings since then, but I hope interviewers test out these editing environments before assuming people would be 100% proficient.
After I had two more technical interviews where I got asked more traditional leetcody questions.
I can't remember exactly, but I probably administered the question for Arthur when he interviewed (he may remember). I do (fondly) remember working with him.
To be honest: it's how I would have failed this question.
Did the laptop throwing make you think you'd gone too far?
During the interview, the interviewee worked on the problem live, and the interviewer stayed silent, except for questions. If they didn't come up for air after 30 minutes or so, I'd check in and see if they were stuck, offer help, etc.
I recently contributed to letting in a false positive into my org. Properly interviewing people is a skill I need to develop!
Worst part of programmer interviews are coding as performance art.
I don't code "out loud". I kind of get lost inside my own head. I can explain myself after I figure something out, not during. If I'm supposed to talk, then I'm thinking about talking, not programming.
Obviously: I've never liked pair programming. Rubber ducking has never worked for me.
Also — we gave candidates one hour (the author of the blog post does not seem to remember that detail).
Rubbing ducking works, but only has a debugging measure. Explaining what your code is actually doing on a line-by-line basis can sus out the root cause of a bug.
I suppose that's the only time pair programming could work for me; by explaining what each line of code does, another programmer could stop me and tell me "No, that's not right".
assuming signed int16 (for simplicity of discussion), 32767 + 1 is far easier to error handle (a simple check of the max_int value) than 10000 * 4, unless you are just blindly allowing the range of values and don't care about overflow/underflow.
Looks pretty fun too actually! Nice work and I hope you got some good engineers out of it. Any other retired interview questions you're particularly fond of?
Later on, we tried to diversify the question to other codebases (because it leaked, although less publicly). I remember trying it out on Redis, which was too easy because the codebase is so nice. We never found a great alternative while I was there (through 2016). Although, the team may have found something since.
At my current company, Impira, we have a similar question on a different codebase :)
You problem setup seems to assume that your interviewee is compeltely unfamiliar with memcached. So how do you expect someone to be able to answer this question if you haven't told them how to add commands to memcached?
[UPDATE] Ah, I see you actually want them to go hack on the memcached code base. That is not at all clear from the problem description. The language of the problem setup is pretty elementary. I think anyone who is actually capable of doing this task would find the description pretty condescending.
Seems like everyone else here thinks it’s perfectly clear.
Our programming challenge: Add a mult command to memcached.
Maybe "adding a command" involves "hacking the codebase"; maybe it doesn't.From the problem statement as such, you can't tell.
Interesting approach, I bet your codebase is a thing of beauty...
I saved up enough that I paid off my house and I opened a bar. I just don't have the heart for the /r/iamverysmart crowd, that always paints themselves into the same corners because "neat and new", or dealing with more political crap where the customer is never a thought in their equation