Inserting in the middle forces every later element to move. An array keeps its values packed with no gaps. Making room at position k means shifting everything from k onward one slot to the right.
If you insert near the front of a million-element array, you shift almost a million elements. That shifting is the O(n) cost, and it grows with how much sits after the insertion point.
Appending at the end avoids this, because nothing follows the last element. Deleting from the middle costs the same, because shifting later elements left closes the gap. When you need frequent middle inserts, an array is often the wrong tool.
Rewriting in plainer words…
This answer doesn't lend itself to a diagram - it reads best . No credits were charged.
What happens when the dynamic array is already full and you insert in the middle?A strong answer says the array grows first, copying every element to a new block, and still has to shift. That insert stays O(n).
If your workload needs frequent middle inserts, what would you use instead, and what do you give up?Name a linked list or a balanced tree. Say that finding the position in a list is still O(n) and that you lose O(1) indexing and cache locality.
Shifting is O(n), so why do array inserts often beat linked list inserts in practice?A strong answer cites one bulk move over contiguous, cache-friendly memory, while a list has to walk scattered nodes just to reach position k.
What you can say
Inserting in the middle of an array is O(n) because every element after the insertion point has to move.
An array keeps its values packed side by side with no gaps, so there is no empty slot waiting at position k.
To make room, you shift everything from k onward one slot to the right, and that work grows with how many elements sit after k.
Insert near the front of a million-element array and you shift almost a million elements.
Appending at the end avoids this because nothing follows the last element, but deleting from the middle costs the same, since you shift left to close the gap.
So if I need frequent middle inserts, I would question whether an array is the right structure at all.
Weak answers to avoid
Blames finding the positionReaching index k in an array is O(1). The cost is moving the elements after k, so name the shift as the O(n) work.
Says every array insert is O(n)Appending at the end shifts nothing. Say the cost grows with how many elements sit after the insertion point.
Points to resizing as the causeEven with spare capacity, the later elements still have to move. Resizing is a separate cost. The shift is what makes a middle insert O(n).
Jumps to a linked list with no catchA list splices in O(1) only once you hold the node. Reaching position k is O(n) and you lose cache locality, so say both.
Interview lens
Likely follow-ups, what you can say, and the weak answers to avoid.