4 ms·
How about if you are implementing a library for a new programming language? Don't PL developers need to implement things like List.reverse() in their new langu
by kyllo 12y ago
How about if you are implementing a library for a new programming language?
Don't PL developers need to implement things like List.reverse() in their new languages all the time?
Rhetorical question, because I know the answer is yes.
Here's an example for Julia: https://github.com/JuliaLang/DataStructures.jl/blob/master/src/list.jl https://github.com/JuliaLang/DataStructures.jl/blob/master/s...
function reverse{T}(l::LinkedList{T})
l2 = nil(T)
for h in l
l2 = cons(h, l2)
end
l2
end
(Note that this algorithm is not an in-place reversal, so it wouldn't have worked for the OP's interview.)
- brudgers 12y agoCan you imagine someone hiring for such a position using such poor pre-interview screening that reversing a list made sense as an interview? The premise of your remark indicates the absurdity of the claim of relevance. An interview for a position responsible for writing a new language in a language sufficiently low level to require a new `list.reverse` would invariably require implementation of a list type as well...what language includes <List> without a reverse?
- kyllo 12y agoDo I think that it makes sense? No. I agree with you there. Can I imagine it? Absolutely. It's just how the industry does hiring. It's pretty well known that Google's hiring process for SDEs is designed to select for skilled computer scientists--the type of people who could do something like implement a stdlib for a new PL if needed. Then, since they can afford to hire only great all-around CS people, they can just allocate people to projects after the hiring decision is made. Of course not every SDE job at Google requires that level of CS skill, and it's massively wasteful to put most people on projects below their skill level, but they can afford to hire that way just because they're Google. As a side effect, other companies hiring developers are likely to just cargo-cult whatever Google is doing.