← Questions

Thread-safe reference-counted smart pointer in C++

0
NvidiaCodingLast asked Sep 2026

A coding interview question asked in Nvidia's coding round, last asked Sep 2026. It tests c++, memory management and atomics.

Write a reference-counted smart pointer class template in C++ from scratch, in the spirit of std::shared_ptr. Several owners may share one object; the object is destroyed exactly once, when the last owner releases it, and never while an…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

  • Nvidia · Coding · Last asked Sep 2026Live coding, often C++-leaning; each round usually opens with 10 to 15 minutes on your past work · Assume no AI unless the interviewer offers it

What it tests

c++ · memory management · atomics · concurrency

Your code and the AI tutor open when you unlock this question.