- A pretty simple take-home problem (something that just implements two or three classes) - An exercise to refactor really terrible code (this is offered in alternative to the take-home) - Questions about architecture that they've worked on in the past, the problems they've had to deal with, etc.
Just asking those questions and seeing how they do with the simple challenge is enough to see if they have at least good code instincts. In person, they can justify their decisions (and it's good here to see if they can take feedback, run with it, and come out with a better solution).
Ultimately the interview process should smell out if 1) they're an asshole to work with 2) if they're able to have good code/architecture instincts.
One thought though, not necessarily for the poster but for anyone who asks these questions: for the second question, finding common elements of two int arrays, the idiomatic Ruby answer is: x & y
Would you be satisfied with that answer? As a candidate, would I be expected to create a set of tests to ensure that it works, even though this is a standard feature of the language?
If you would not be satisfied with that answer, would you be surprised that a candidate might struggle with an alternative, knowing that they would never use an alternative in their normal coding experience?
Instead of asking a quirky question, it is better to have them solve a simple problem and judge on logic and structure.
If you mean “functions provided by a library outside of the core” there are languages where this restriction doesn't prevent the kind of trivial solution you are trying to prevent.
If you mean “any predefined functions/methods” there are languages where this is impossible (e.g., since even literal array syntax is just syntactic sugar for the Array constructor method.)
Note that there are several languages that fall into both categories (e.g., Ruby.)
There are probably a very narrow slice of languages where this restriction, however you define it, really does what you intend.
Yes, reversing an array is arguably lower level than an application engineer needs to go - but not by much (in some languages you will be doing this yourself). And if they can do that, they can do something comparably difficult.
One that demonstrates their ability to write clean, testable, readable OO code, with appropriate abstractions, and not overengineered.
I find most candidates, struggle to do this, including algo wizards. Most software engineers aren't good at this either.
It's not super easy without using library functions when all the operations that work on arrays (including the constructor that makes them) are as much “library functions” as the one that reverses an array. (Conversely, if the mechanism that reverses an array is part of the language core and not a library, the restriction fails to have the expected effect from the other side.)
The restrictions seem to assume that every language has the same division of distinct core “language” features as distinct from what is provided by libraries.
a = [0, 1, 2]
print a[1]
That's just how arrays work. If your elements are 32 bit integers then you are establishing a pointer to the first element. Accessing an element is multiplying the index by the element size and jumping from the first element pointer to a memory address offset.
> The restrictions seem to assume that every language has the same division of distinct core “language”
Fine, if your language has a library for arrays, then reimplement it on the whiteboard. Everyone is able to do that if they know what arrays are. They are just contiguous memory
That's a really nice way to make someone a lot more comfortable. I do have to ask, was any part of your judgement affected by those choices?
I am not sure how many we rejected before the technical interview, because I wasn't involved as much in that part.
- Find the most frequent integer in an array
- Find the common elements of two int arrays
- The buying/selling stock question from https://www.interviewcake.com/question/java/stock-price (slightly modified, I removed the word efficient as I only care about a correct solution, not the most efficient one, and we provided a data-set with a correct answer).
They were asked to bring their own laptop, and use their favourite editor, with the language of their own choosing, and setup a test environment.
It was an eye-opening experience to see how different the responses were, also how few that could actually solve the first two ones, I subscribe most of this to pressure to perform, but I think we at dodged two that was really good at talking, but had never opened their editor for at least a couple of years, despite their resume stating otherwise, and when asked about it they did programming every day.
I am all for finding better ways of interviewing for new engineers, and I really like their points about communication, but I am not sure giving them access to master and start hacking around is a fair challenge either, of course that is where the pairing aspect comes in, maybe it is worth a shot for our next round.