4 ms·
I rotate through various simple function implementations. It’s important to stick to fundamentals and not introduce anything where a specific context is require
by matthewwolfe 4y ago
I rotate through various simple function implementations. It’s important to stick to fundamentals and not introduce anything where a specific context is required. Examples of this are
- function to reverse a string
- function to sum an array of integers
- function to get a deeply nested property value from an object
Since I work a lot with React and also interview people for that, I use the following to determine if people are at least somewhat familiar with react:
- take a static array of objects (first name, last name) and render a list of those objects
If people can’t write the map function, or are confused about the console warning for needing “key” that is usually a great indicator that they don’t actually know react.
What consistently surprises me is that I’ll interview people with 5-10 years of directly related experience, who will see questions like this and laugh or say it’s trivial, and then absolutely bomb. One person complained that they were senior and above these types of questions, and then spent 20 minutes trying to reverse a string.
- arcturus17 4y agoThat’s strange, it’s taken me like 2 minutes to think of three methods of reversing a string, depending on what you want, space efficiency (use two moving pointers and operate in-place), simplicity (use a new array and a loop starting at the origin’s end), functional semantics (use map() and a bit of modulo math)… I’ve written a lot of software but I wouldn’t even consider myself a professional programmer. What happens to these people, do they get really nervous or do they really not know?
- matthewwolfe 4y agoI think there probably are people that get nervous and absolutely blank, that is bound to happen. As an interviewer, what can you really do in those situations? Also to note that looking up documentation is perfectly fine, and I explain that as well. As for others, I think some people graduate out of writing code when they become senior, or something similar. But we make it very clear that senior/lead engineers are primarily writing code, so I don’t think it is a mismatch of expectations. Other people are genuinely overstating their skills and are no programmers. The incentive to lie is there, based on how much money a programmer can make.
- deleted 4y ago[deleted]
- timeon 4y agoThere is also alternative to use some high-level language that implements iterator beyond map/reduce like this: `s.chars().rev().collect::<String>()`
- wink 4y agoWhat I can 100% relate to: Writing Java for on and off 20 years but if you didn't for a year or two fumbling to start with a blank file and getting the psvm and args right. But I mean, you should totally get back into at least being able to write something like fizzbuzz in the language you're probably using to write some sample code. Except trim() vs strip() - that will forever trip me up per language.