How would you implement an automatic garbage collector in C++?
Anonymous
The answer I gave (which he said is how it is actually done) is to mirror how a cache works in hardware and periodically delete all references that are not held in the "cache" (which I stored as a priority queue).
Check out your Company Bowl for anonymous work chats.