Implement WeakArray<T: AnyObject>
Task
A collection that holds objects weakly: for example, a list of observers or child coordinators that must not extend their lifetime. Objects nobody else holds should "disappear" from the collection by themselves.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep