`ArrayList` has no synchronization, so concurrent writes can corrupt its internal state or cause inconsistent reads. Options: external locking, `Collections.synchronizedList`, `CopyOnWriteArrayList` for mostly-reads, or using concurrent queues depending on the use case.
Advanced answer
Deep dive
Expanding on the short answer — what usually matters in practice:
Explain the "why", not just the "what" (intuition + consequences).
Trade-offs: what you gain/lose (time, memory, complexity, risk).
Edge cases: empty inputs, large inputs, invalid inputs, concurrency.
Examples
A tiny example (an explanation template):
// Example: discuss trade-offs for "why-is-`arraylist`-not-thread-safe,-and-how-can-"
function explain() {
// Start from the core idea:
// `ArrayList` has no synchronization, so concurrent writes can corrupt its internal state or
}
Common pitfalls
Too generic: no concrete trade-offs or examples.
Mixing average-case and worst-case (e.g., complexity).