This is one of those questions where you think you know it until someone asks you to explain the implementation side.
Start by defining weak and unowned references in terms of their optionality and lifetime assumptions, then explain when to use each to break retain cycles with concrete examples. Finally, describe the runtime behavior of accessing a deallocated unowned reference, emphasizing the crash and how it differs from weak's safe nil-ing.
Pro tip: Mention that unowned references are non-optional and have zeroing disabled, so they offer a slight performance edge but require a guaranteed lifetime relationship. Also, note that unowned is often used for delegates or closures where the referenced object outlives the reference, but be cautious with unowned in multi-threaded scenarios.
Explain that weak is an optional reference that becomes nil when the object is deallocated, while unowned is a non-optional reference that assumes the object will outlive it.
Describe how both break retain cycles by not strongly holding the referenced object, and give scenarios: weak for delegates or parent-child where child may outlive parent, unowned for closures where self is guaranteed to exist.
State that accessing an unowned reference after deallocation causes a runtime crash (fatal error: unexpectedly found nil while unwrapping an Optional value or similar), because it does not zero out.
Contrast that weak references are automatically set to nil, so accessing them after deallocation is safe (returns nil), but requires optional handling.
Conclude that weak is safer but has optional overhead, unowned is faster but riskier; choose based on lifetime guarantees and thread safety.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.