Cadence Design Systems interview question

How to implement shared pointer class. how will keep count of reference.