← Back to Python

deepcopy vs Shallow Copy

Pythonpython

The Question

What is the difference between deepcopy and shallow copy?

What a Strong Answer Covers

  • shallow = new container
  • same nested
  • "deep = recursive independent
  • "assignment = reference only

Related Questions

  • GIL — What It Is and What It Protects
  • ThreadPoolExecutor & ProcessPoolExecutor
  • Decorators — Under the Hood
  • Generators & yield
  • Context Managers

Practice This Question

Get AI-graded feedback on your answer with follow-up probes on weak points.

Take the Free Assessment
GrindQuestionsAITechnical interview assessment
TermsPrivacyAbout