A setter in non-ARC code
The essence
The question is about manual memory management (MRC) and thread-safe accessors. An MRC setter must release the old value and retain the new one; a getter must return the object so that it does not die in the caller's hands. If the property is touched from several threads, both operations also need synchronization.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep