SystemVerilog OOP Mastery · All levels
Object Lifetime and Null Handles: Interview Questions
Interview Questions for Object Lifetime and Null Handles.
Interview questions
Q1. Why do null-handle bugs usually appear in random seeds and not directed smoke tests?
Answer: Randomized control paths exercise rare branches where construction is skipped. Smoke tests often run a narrow happy path that always allocates.
Q2. What is a better policy than sprinkling null checks everywhere?
Answer: Assign one owner for allocation and assert contracts at boundaries. Local null checks can prevent crashes but hide root-cause ownership violations.