2. Compare arrays and linked lists.
EasyData structures & algorithms
TechnicalAtlassian guide
Sources & context
- Atlassian engineering interview handbook
Official engineering guidance covers data structures, code design and systems design. Related practice format; not an exact employer question.
Show model answer
Arrays store elements contiguously, so indexing is O(1) and they are cache-friendly, but inserting or deleting in the middle is O(n) because elements shift.
Linked lists store nodes with pointers, so insertion or deletion at a known node is O(1), but reaching the i-th element is O(n) and each node carries pointer overhead. In practice dynamic arrays win most of the time; linked lists suit frequent splicing such as an LRU cache.