VLSI DV Interview Puzzles · All levels
OOP & Testbench Puzzles: Tricky Q&A
Rapid-fire interview Q&A for OOP & Testbench Puzzles.
Section Q&A
Rapid-fire questions an interviewer asks around OOP & Testbench Puzzles. Answer out loud, then check yourself.
Q1. In a copy/clone debug session, what is the fastest way to prove nested-handle aliasing instead of scoreboard compare bug?
Answer: Print `%p` (or object IDs) for the nested handles in source and clone before and after one controlled mutation. If identities match and both values move together, the clone path is shallow at that nesting point.
Trap: Inspecting only top-level object handles and concluding clone ownership is correct.
Q2. Why can a perfectly implemented derived method still never run in UVM flows?
Answer: Because framework code often stores objects/components in base-typed handles. If the base declaration is non-virtual or signatures do not match for override, calls bind to base implementation regardless of runtime type.
Trap: Believing method-name match in derived class automatically guarantees polymorphic dispatch.
Q3. How do you intentionally design one counter per `foo#(T)` specialization and another truly global counter?
Answer: Place per-specialization static members inside the parameterized class, and place global static state in package scope or a non-parameterized base class. Validate by constructing at least two different specializations and checking both counters.
Trap: Keeping both statics inside `foo#(T)` and expecting one of them to be global across all `T`.
Q4. When both type and instance overrides exist, what mental model predicts factory result reliably?
Answer: Resolve each `create()` by specificity at that path: exact instance override wins first, broader wildcard instance overrides next, and type override is fallback. Then remember direct `new()` bypasses all of it.
Trap: Using only registration call order and forgetting path specificity plus `create` vs `new` behavior.