Microsoft interview question

What is deep and shallow copy?

Interview Answer

Anonymous

6 Oct 2025

Shallow copy is used when you only need to copy it's outer data and deep copy when you want to completely clone it .it creates a new object and also recursively copies all nested objects.