Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
    • Handle and Copy Puzzles
    • Virtual Method Puzzles
      • Non-Virtual vs Virtual Through Base Handle
      • Missing super.new with Required Base Args
      • Virtual Call from Base Constructor
      • Signature Mismatch Prevents Override
      • Template Method with Non-Virtual Wrapper
      • super Method Call in Override Chain
    • Parameterized Class Puzzles
    • Factory Override Puzzles
    • OOP & Testbench Puzzles: Tricky Q&A
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Virtual Method Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. OOP & Testbench Puzzles
  4. Virtual Method Puzzles
  5. super Method Call in Override Chain

VLSI DV Interview Puzzles · All levels

super Method Call in Override Chain

A derived override calls `super.report()`. Predict final string and explain call chain.

On this page

    Puzzle

    Difficulty: Hard · Puzzle 6 of 6 · Topic: Virtual Method Puzzles

    A derived override calls `super.report()`. Predict final string and explain call chain.

    Code

    design.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    class base_r;
      virtual function string report();
        return "B";
      endfunction
    endclass
    
    class mid_r extends base_r;
      function string report();
        return {"M-", super.report()};
      endfunction
    endclass
    
    class ext_r extends mid_r;
      function string report();
        return {"E-", super.report()};
      endfunction
    endclass
    
    initial begin
      base_r h = new ext_r();
      $display("%s", h.report());
    end

    Hint

    `super` is lexical (next class in inheritance chain), not dynamic back to most-derived.

    Step-by-step solution

    Diagram
    1) Dynamic dispatch picks `ext_r::report` for `h.report()`.
    2) `ext_r` calls `super.report()` => `mid_r::report`.
    3) `mid_r` calls its `super.report()` => `base_r::report`.
    4) Concatenation yields `E-M-B`.

    Answer

    Answer: Final output is `E-M-B`; dynamic entry is most-derived, then explicit `super` walks up one lexical level each call.

    Why candidates get it wrong

    Some candidates think `super` re-dispatches dynamically and can recurse to most-derived.

    Interviewer follow-up

    How would behavior change if `mid_r::report` were declared non-virtual?

    Related topics

    • Back to Virtual Method Puzzles

    • OOP & Testbench Puzzles section

    Previous

    41 / 210

    Next: Parameterized Class Puzzles

    Up next

    Up nextParameterized Class Puzzles

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Non-Virtual vs Virtual Through Base Handle
    • Missing super.new with Required Base Args
    • Virtual Call from Base Constructor