Question
Which statement about Shallow vs Deep Copy is the strongest interview answer?
- Shallow vs Deep Copy is mostly a naming style choice and has little effect on runtime behavior or design tradeoffs.
- Shallow vs Deep Copy exists mainly to reduce the number of files in a Python project.
- Shallow vs Deep Copy matters only for frontend scripting and not for backend or automation code.
- A shallow copy duplicates the outer container, while nested objects are still shared unless a deep copy or explicit rebuild is used.
Hint
Start with the core rule behind Shallow vs Deep Copy.
Answer and rationale
Correct answer: D. A shallow copy duplicates the outer container, while nested objects are still shared unless a deep copy or explicit rebuild is used.
A shallow copy duplicates the outer container, while nested objects are still shared unless a deep copy or explicit rebuild is used. This is the base concept interviewers commonly test first.
Track: Python