A linked list chains elements together through nodes. Each node holds a value and a pointer to the next node. The list only knows where its first node lives, so you reach any element by following pointers one hop at a time.
An array stores elements side by side in one contiguous block. That layout lets you jump straight to index 5 by arithmetic. A linked list cannot, so reaching position 5 costs O(n) hops. Arrays give O(1)random access, and linked lists give O(n).
The tradeoff flips for growth. An array has a fixed block, so growing may mean copying everything. A linked list just allocates a node and rewires a pointer. Choose based on whether you index often or reshape often.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
A linked list is a chain of nodes, where each node holds a value and a pointer to the next one, and the list itself only knows where the first node is.
To reach an element you start at the head and follow pointers one hop at a time, so reaching a given position costs O(n).
An array keeps its elements side by side in one contiguous block, so finding index 5 is just arithmetic, which gives O(1) random access.
Growth flips the tradeoff, because an array's block is fixed and growing it may mean copying everything, while a linked list just allocates a node and rewires a pointer.
So I pick an array when I index often, and a linked list when I reshape the collection often.
Weak answers to avoid
Defines both but never compares themTwo separate definitions miss the question. Tie layout to cost. A contiguous block makes indexing O(1), and following pointers makes it O(n).
Claims list insertion is always O(1)The rewire is O(1) only once you hold the right node. Finding a position by index still walks the list in O(n). Say both parts.
Says arrays cannot grow at allA fixed block means growing may need a copy into a bigger block, not that growth is impossible. Dynamic arrays do exactly that copy.
Lists costs but gives no rule for choosingStopping at Big-O leaves half the question unanswered. Close with the rule. Use an array when you index often and a list when you reshape often.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.