What are Scala collections performance characteristics?

Updated May 24, 2026

Short answer

Different collections have different time complexities.

Deep explanation

List is O(n) for access, Vector is near O(1) for most operations, HashMap provides O(1) average lookup.

Real-world example

Choosing correct structure improves system performance.

Common mistakes

  • Using List for random access workloads.

Follow-up questions

  • When to use Vector over List?
  • Are immutable collections slower?

More Scala interview questions

View all →