KLA Interview Question

Algorithm for reference counting in c++