Short answer
ArrayList is a contiguous array: O(1) random access and cache-friendly iteration, with amortized O(1) appends and O(n) middle inserts/removes due to shifting.
Explanation
LinkedList offers O(1) insert/remove only if you already hold the node, but indexing is O(n) and every element is a separately allocated node, killing cache locality and inflating memory. In real workloads ArrayList's locality usually wins even for inserts, so LinkedList is rarely justified — its main legitimate use is as a Deque/queue, where ArrayDeque is typically still faster.
Common mistakes
- Saying LinkedList is faster for insertion everywhere — finding the position is O(n).
- Ignoring CPU cache locality, which favours ArrayList.