This question evaluates understanding of memory management and ownership semantics, covering competencies such as RAII, reference counting, lifetime management, custom deleters, and the roles of unique, shared, and weak smart pointer types.
What is a smart pointer? How do smart pointers manage ownership and lifetimes compared with raw pointers? Describe common types (unique, shared, weak), mechanisms (RAII, reference counting, custom deleters), typical overheads, and pitfalls like reference cycles; include examples from C++ or Rust.