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
    • Datatype and Bit Puzzles
    • Fork Join Puzzles
      • join vs join_any vs join_none
      • Loop Variable Capture in Detached Threads
      • wait fork Synchronization Point
      • disable Named Fork Scope
      • join_any Without Cleanup
      • Inner disable fork Does Not Kill Outer Sibling
    • Queue and Array Puzzles
    • String and Casting Puzzles
    • SystemVerilog Language Puzzles: Tricky Q&A
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • 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

‹Fork Join Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. SystemVerilog Language Puzzles
  4. Fork Join Puzzles
  5. wait fork Synchronization Point

VLSI DV Interview Puzzles · All levels

wait fork Synchronization Point

Order these prints by time and explain what `wait fork` waits for.

On this page

    Puzzle

    Difficulty: Easy · Puzzle 3 of 6 · Topic: Fork Join Puzzles

    Order these prints by time and explain what `wait fork` waits for.

    Code

    p3.sv
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    module p3;
      initial begin
        fork
          #3 $display("%0t A", $time);
          #7 $display("%0t B", $time);
        join_none
        $display("%0t parent_after_join_none", $time);
        wait fork;
        $display("%0t parent_after_wait_fork", $time);
      end
    endmodule

    Hint

    `join_none` returns immediately, but `wait fork` blocks until all currently active children from this process finish.

    Step-by-step solution

    Diagram
    1) Parent prints `parent_after_join_none` at t=0 immediately after spawning children.
    2) Child A prints at t=3.
    3) Child B prints at t=7.
    4) `wait fork` unblocks only after both children complete, so final parent print is at t=7.

    Answer

    Answer: parent_after_join_none@0, A@3, B@7, parent_after_wait_fork@7

    Why candidates get it wrong

    A frequent miss is assuming `wait fork` only waits for the most recently spawned child.

    Interviewer follow-up

    What if another nested fork starts a forever loop before `wait fork`?

    Related topics

    • Back to Fork Join Puzzles

    • SystemVerilog Language Puzzles section

    Previous

    13 / 210

    Next: disable Named Fork Scope

    Up next

    Up nextdisable Named Fork Scope

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • join vs join_any vs join_none
    • join_any Without Cleanup
    • Inner disable fork Does Not Kill Outer Sibling