All jobs / Backend developer / Backend Languages

Backend developer interview question · 0–1 years

When do you use an array rather than a List<T>?

The strongest answer

When the size is fixed and known, or an API demands one — List<T> grows, exposes Add and Remove, and is what most code should take and return

Why it works

Right. Fixed size is the reason; otherwise List<T> says more about intent.

What a good answer covers

Answers that fall short

Who gets asked this

More Backend Languages questions