DataStax interview question

What's the difference between ArrayList and LinkedList?

Interview Answers

Anonymous

8 Jan 2019

Unless you're implementing very low-level software (OS components, DBMS, something like that) -- this is a pointless question and indicates the interviewer is off base. Unless you are hiring brand new graduates, any CS / algorithm type questions are frankly kind of stupid. A good interviewer will focus on depth and breadth of knowledge, problem-solving skills, and engineering process knowledge. Playing "gotcha" to see if a candidate can contrast (e.g.) binary trees and binary search trees is a waste of everyone's time. Knowing the secret CS incantations doesn't make you a good developer.

1

Anonymous

18 Mar 2015

I was asked this question by 2 people, they got it from stackoverflow and there's a big post debating that an experienced engineer should know this. The first time I was asked this question I hesitated because I wasn't expecting it. Seriousely even if you have 15 yrs of experience how many times do you get to choose between an ArrayList and a LinkedList because of their underlying implementation. Most of the time we use ArrayList, HashMap or Hashset collections, they others are rarely used. The difference is the underlying implementation, one is an Array and the other is a list where elements are linked. ArrayLists are good for direct access to elements using an index but the LinkedLists are more efficient when adding and removing elements randomly. Still I beleive some data structure question you had on you first year of CS degree shouldn't be used as criteria to see if you're a good software engineer or not.

Anonymous

16 Aug 2015

I am a fresh graduated Computer Engineer and I knew this. So, they were right when stated that an experienced software engineer should know this (at least the basic answer, not necessarily how each implementation was done).