Question
When should a Python developer choose Tuples and Fixed Records deliberately?
- Use a tuple when the position-based shape is stable and the record is lightweight enough that a full class would add noise.
- Choose Tuples and Fixed Records mainly when you want to postpone validation and fix issues manually later.
- Choose Tuples and Fixed Records whenever you want the code to look more advanced, even if the design gets less clear.
- Choose Tuples and Fixed Records only to avoid modeling the real data shape or domain contract explicitly.
Hint
Think about the production scenario where the choice genuinely improves the code.
Answer and rationale
Correct answer: A. Use a tuple when the position-based shape is stable and the record is lightweight enough that a full class would add noise.
Use a tuple when the position-based shape is stable and the record is lightweight enough that a full class would add noise. Interviewers often ask this to see whether you can connect the concept to real design decisions.
Track: Python