Will deinit be called?
Task
Will deinit print?
final class Node {
var next: Node?
deinit { print("deinit") }
}
var a: Node? = Node()
var b: Node? = Node()
a?.next = b
b?.next = a
a = nil
b = nil
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep