Skip to main content
PreparationZone Logo
PreparationZone
Back to Fundamentals

Fundamentals · Medium · Free

When would you choose a linked list over an array in an interview?

FresherFundamentalsProgramming Fundamentals
Model answer

Array vs linked list

An array stores elements contiguously—O(1) index access, costly insert/delete in the middle. A linked list chains nodes with pointers—O(1) insert/delete at known node, but O(n) to reach index i.

NeedPreferWhy
Random access by indexArrayCache-friendly contiguous memory
Frequent head/tail insertsLinked list / dequeNo shifting elements
Binary searchArrayNeeds O(1) mid access
Memory overhead tinyArrayNo per-node pointer cost
In Java interviews, say you'd use ArrayList by default and LinkedList only for deque-heavy workloads—not "linked list is always better for insert".