TORC Robotics Interview Question

I was asked to implement a smart-pointer class with automatic garbage collection and reference counting.