Category: Data Structures

Question

[Data Structures] Question #16: What is the difference between a list and a tuple?

Answer

Lists are mutable, tuples are immutable. Tuples can be dict keys and are faster for fixed data.

Expand your answer with examples from your projects and link to Interview Prep.

Follow-Up Questions

  • Can you explain a trade-off involved?
  • How would you test this in production?
  • What could go wrong at scale?