Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



Good point. Though if that's the case then the question is why schedule a Java dev to interview a Ruby/Python/Javascript dev?


Not meaningful in Java.

java.util.List is an interface; java.util.ArrayList is the most commonly used implementation.


java.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.


Yes, 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.


java.until.ArrayList says that question makes no sense, unless the question was really about the extra overhead and API of the list wrapper object.


That's what I was thinking, too. But perhaps it's because of C++, where std::list is actually a linked list.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: