5 ms·
> And the interviewer was an ex-Google engineer so I imagine he had some familiarity with Python since it's an official Google language. Be careful of such ass
by gknoy 11y ago
> And the interviewer was an ex-Google engineer so I imagine he had some familiarity with Python since it's an official Google language.
Be careful of such assumptions. Google has a lot of languages that they use, and it's not inconceivable that someone that worked at Google might be mainly a Java engineer, without much exposure to Python -- in which case list vs array is a pretty meaningful question from their perspective.
- ritchiea 11y agoGood point. Though if that's the case then the question is why schedule a Java dev to interview a Ruby/Python/Javascript dev?
- reagency 11y agojava.until.ArrayList says that question makes no sense, unless the question was really about the extra overhead and API of the list wrapper object.
- gengkev 11y agoThat's what I was thinking, too. But perhaps it's because of C++, where std::list is actually a linked list.
- stickfigure 11y agoNot meaningful in Java. java.util.List is an interface; java.util.ArrayList is the most commonly used implementation.
- _asummers 11y agojava.util.LinkedList also implements that interface. ArrayList has the same semantics under the hood as an array (fast insertion at arbitrary places, fast random access, slow extension), and any Java programmer who's remotely familiar with data structures should know the difference between the two. Especially when LinkedLists are so commonly used under the hood in e.g. the java.util.Queue family.
- stickfigure 11y agoYes, of course. But if someone - especially a java programmer - asked me "list or array?", I would regard them amateur. In most of today's popular programming languages, list != linkedlist. Of course, the proper response to a dumb interview question like this is "You mean linked list or array, right?" Because a reasonably seasoned programmer should recognize this poor choice of terminology for what it is.