Back to problems

Implement and Explain a C++ Smart Pointer

Object-Oriented Programming · NVIDIA · Hard

You are asked to design a C++ smart pointer and then defend the design decisions behind it. A bare request to "write a smart pointer" is under-specified: it never says whether ownership is exclusive, reference-counted, non-owning, or intrusive. So your first move is to pin down the ownership model and the interface that model implies. Only once the interviewer has named a model should you produce a working implementation for it, and you should also be able to explain how the…

Checking your access…