Problem Statement
Describe the lifecycle of an object from creation to destruction including constructors and destructors/garbage-collection.
Explanation
When code uses new to create an object memory is allocated, the constructor (default or parameterised) initialises the object, and the object is ready for use. Later when it is no longer referenced (in languages with GC) or delete-ed (in C++), destructor or GC finaliser runs to free resources. Understanding this helps you reason about memory management and resource leaks in interviews.