What is the difference between Array and List<T> in C#?

Answer

An Array (T[]) is a fixed-size, contiguous block of memory for elements of the same type. Size is set at creation and cannot change. Direct index access is O(1) — the fastest possible. Arrays are the most memory-efficient collection (no overhead). Use when: the size is known and fixed, performance is critical. A List<T> is a dynamically resizable array (wraps a T[] internally). When capacity is exceeded, it allocates a new array (2× size) and copies elements. Supports adding, removing, inserting elements. Has LINQ extension methods and convenient APIs. Use when: the number of elements varies or is unknown. Performance: both offer O(1) indexed access. List adds, removes at the end are O(1) amortized. Insertion/removal in the middle is O(n). For frequent insertions/removals in the middle, consider LinkedList<T>. For sets and lookups, use HashSet<T> or Dictionary<K,V>.