SystemVerilog OOP Mastery · All levels

Callbacks and Policy Classes for Open Extension: Interview Questions

Interview Questions for Callbacks and Policy Classes for Open Extension.

Interview questions

Q1. How do callbacks reduce inheritance depth in UVM?

Answer: They let you attach extra behavior to an existing component instance instead of creating one subclass per variation.

Q2. Why are policy classes often easier to debug than callbacks?

Answer: Active policy is typically a single handle owned by one component, while callbacks can be registered from multiple places and executed in sequence.

Q3. Can callbacks and policies coexist in one component?

Answer: Yes; callbacks can instrument lifecycle hooks while a policy object controls the component's core algorithmic decision.

Related topics