SystemVerilog OOP Mastery · All levels

Virtual Methods and Override Intent: Interview Questions

Interview Questions for Virtual Methods and Override Intent.

Interview questions

Q1. Where is dynamic dispatch controlled in SystemVerilog: in the child declaration or the base declaration?

Answer: In the base declaration. If the base method is not virtual, calls through a base handle stay statically bound regardless of child implementation.

Q2. Why can a factory override appear ineffective even though the object type is correct?

Answer: If runtime calls go through non-virtual base methods, behavior stays in base code. The concrete object changed, but the dispatch point did not.

Related topics