When your hot operation is insertion or deletion anywhere but the end, because maintaining contiguity forces shifting all subsequent elements, O(n) per operation. If you're frequently inserting/removing in the middle (an ordered list with churn, a free list, a scheduler queue with priority insertion), a linked list gives O(1) splice once you have the node, trading away the array's O(1) indexing. Arrays are also poor when the size is highly variable and you can't bound it, since a fixed array wastes RAM at worst-case size or risks overflow, and growing means reallocating and copying (O(n), plus heap use that embedded avoids). And if you need O(1)-average keyed lookup rather than positional access, a hash table fits better. The decision is always about which operations are frequent: arrays are unbeatable for indexed access and sequential scans, and weak for middle insertion and unbounded growth.
Data Structures & Algorithms · Interview question
When is an array the wrong data structure?
A strong answer
What a weak answer sounds like
You know the answer. Do you know what gets you dinged?
Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.
From the lesson
Arrays & Memory Layout
Contiguous storage is why arrays give O(1) indexing and why row-major traversal is cache-friendly, plus array-of-structs vs struct-of-arrays for embedded data.