SystemVerilog OOP Mastery · All levels

Static and Parameterized Gotchas: Interview Questions

Interview Questions for Static and Parameterized Gotchas.

Interview questions

Q1. How do you intentionally get global IDs across all packet types?

Answer: Place static counter in a common non-parameterized base class and document global sharing as a design choice.

Q2. Why can parameterized wrappers still alias each other?

Answer: Because handles retain reference semantics regardless of parameterization. Without deep copy, wrappers can reference the same underlying object.

Q3. What debug print helps distinguish static-scope bugs quickly?

Answer: Print type name plus static value and object handle identity together; this reveals whether counters are shared and whether objects are aliased.

Related topics