🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Memory and Smart Pointers: all 10 questions

Quiz: Memory and Smart Pointers · Question 1 of 10

Which smart pointer should be your default choice?

Which smart pointer should be your default choice?

  1. A.unique_ptr
  2. B.shared_ptr
  3. C.weak_ptr
  4. D.auto_ptr
Answer & explanation

Correct answer: unique_ptr

unique_ptr has no reference-counting overhead and clear single ownership.

Can you get the rest right without peeking?

Take the timed Quiz: Memory and Smart Pointers quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →