Microsoft Interview Question

What is deep and shallow copy?

Interview Answer

Anonymous

Oct 6, 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.